As you go through these steps, you will encounter several terms that will be highlighted in italics. These terms will be explained in detail after you complete the exercise.
This example gets you started on your first Android app. You learn to use the Android studio IDE to create a standard Hello World app with the built-in templates. After you complete the exercise steps and see the resulting application running on either the emulator or on a real device, we will then dissect the application to understand some of the Android concepts.
This example gets you started on your first Android app. You learn to use the Android studio IDE to create a standard Hello World app with the built-in templates. After you complete the exercise steps and see the resulting application running on either the emulator or on a real device, we will then dissect the application to understand some of the Android concepts.
Assure that you have the Android Studio installed in your PC.
- Create a new Android Project: Start Android Studio. Once started, in the welcome window click Start a New Android Project.
Add caption - Configure the project: When the next window opens, type the information in as shown below.
- Select the target form factors: Select the platform to be the phone and tablet by checking the box, and select the minimum SDK level to be API 21 as shown below.
- Add an activity: Select the starting activity to be a blank activity. This will create an app from a template with a single activity and a standard screen layout displaying "Hello world!".
- Customize the activity: We can choose the name of the activity, layout file name, title and menu resourcename as shown below.
- See the Gradle build in operation: Android Studio needs to build the project. It uses the Gradle build systemfor this purpose. You will see the following screen for some time showing the progress of the build.
- See the completed project: You will see the following screen upon completion of the build.
- There it is - "Hello, World!" in Android! The next step, of course, is to see it running either in an emulator or on a mobile device.
Aucun commentaire:
Enregistrer un commentaire