[JAVA] Beginners try using android studio Part 1 (Hello World)

Overview

Assuming that android studio can be installed, let's first create the Hello World app. Even if you say ~~, there is nothing special to do because Hello World is already completed when you create a new project. ~~ Here, we will mainly explain the files. Tsukkomi welcome.

Prerequisites

・ Install java ・ Install android studio

Start android studio

First, start android studio.

説明_01.jpg

Android SDK settings

The first time you start android studio, you need to install the Android SDK. First, click File-> Settings to see the Android SDK settings.

説明_02.jpg

Click Settings-> Apperance & Behavior-> System Settings-> Android SDK ** It seems to be an error if the Android SDK Location contains Japanese. ** **

説明_03.jpg

SDK Platoforms settings. Check appropriately and click the Apply button

説明_03_1.jpg

SDK Tools settings. Check appropriately and click the Apply button

説明_04_1.jpg

SDK Update Sites settings. Check appropriately and click the Apply button

説明_05_1.jpg

This completes the settings.

Create a new project

Click New Project.

説明_06.jpg

Click Next

説明_07.jpg

Click Next

説明_08.jpg

Select ** Empty Activity ** and click Next

説明_09.jpg

Click Finish

説明_10.jpg

The project has been created.

説明_11.jpg

end.

The meaning of each file

When you expand the project on the left side, the following files will be displayed.

説明_12.jpg

The description of the main files is as follows. This is all I know now. You can add pages as needed.

説明_12_1.jpg

MainActivity.java Page controller (1 file per page) Write the initialization settings and settings for each event here. Basically, it seems to be written on Honyara. For details, please go to "android studio event settings" etc.

説明_12.jpg

activity_main.xml Screen file I will write the screen settings here. You can place buttons etc. by dragging and dropping like VB (VBA). Assign an individual ID for each page to each part and set the operation.

説明_13.jpg

Project execution

Click the green triangle button.

説明_14_1.jpg

A screen for selecting the smartphone to be executed is displayed. The upper part of the list is the actual smartphone column, and the lower part is the virtual smartphone column. If you connect your smartphone to your computer via USB and make build settings on the smartphone side, it will be displayed in the actual device column. ~~ Please find the build setting method appropriately. ~~ If nothing is displayed, click the Create New Virtual Device button to install the virtual smartphone. Select an appropriate model and press the OK button.

説明_15.jpg

Installation of virtual smartphone

Select your smartphone and click Next.

説明_16.jpg

Project execution continued

Project in progress

説明_17.jpg

It takes a lot of time.

説明_18.jpg

Execution completed. Hello World is displayed.

説明_19.jpg

End of project

Click the red square button.

説明_20_1.jpg

The project has been closed.

説明_21.jpg

That's Hello World. ~~ Don't say "code it!" ~~

Supplement: When an execution error occurs

It seems that it may be executed if you try the following. ・ Open File> Settings> Build, Execution, Deployment> Instant Run ・ Uncheck Enable Instant Run to hot swap code

説明_22.jpg

Event processing

Beginners try using android studio Part 2 (event processing)

Recommended Posts

Beginners try using android studio Part 1 (Hello World)
Beginners try using android studio Part 2 (event processing)
Until Android Studio beginners display "Hello World" on HUAWEI nova 2
Try using Talend Part 1
Defeating Android Studio Part 3-6
Defeating Android Studio Part 1 & Part 2
[Introduction] Display Android Studio Hello World on the emulator
Java beginners read Hello World
Try Hello World using plain Java on a Docker container
Android OS (7.1.2) build and Hello World
Make an executable jar using Android Studio
Try using the service on Android Oreo
[For beginners] Introducing the procedure to Hello, World in C/C ++ language using Visual Studio Code on Ubuntu
Try using the Emotion API from Android
Try using Firebase Cloud Functions on Android (Java)
(Android) Try to display static text using DataBinding
Android Studio development for the first time (for beginners)
Display "Hello World" in the browser using Java
Display "Hello World" in the browser using Java
Try communication using gRPC on Android + Java server
Try to display hello world with spring + gradle
Try using Maven
Try using powermock-mockito2-2.0.2
Try using GraalVM
Try using jmockit 1.48
Try using sql-migrate
Read "Hello world"
Java, Hello, world!
Try using SwiftLint
Try using Log4j 2.0
Java Hello World
Binary tree memorandum for beginners (Part 3 Realization using class)
Try image classification using TensorFlow Lite on Android (JAVA)