Changes

Jump to: navigation, search
no edit summary
== Creating the Example Project in Android Studio ==
Launch Android Studio and select the New Project… Start a new Android Studio project option from the quick start list in the welcome screen. If any existing projects are already open, close them first using the File -> Close menu option.
In the new project configuration dialog, entering enter JavaLayout into the Application name field and ebookfrenzy.com as the Company Domain setting before clicking on the Next button.
On the form factors screen, enable the Phone and Tablet option and set the minimum SDK setting to API 8: Android 2.2 (Froyo). Continue to proceed through the screens, requesting the creation of a blank activity named JavaLayoutActivity with a corresponding layout named activity_java_layoutand with the menu resource name set to menu_java_layout.
Once the project has been created, the JavaLayoutActivity.java file should automatically load into the editing panel. As we have come to expect, Android Studio has created a template activity and overridden the onCreate() method, providing an ideal location for Java code to be added to create a user interface.
Once the above additions have been made, compile and run the application (either on a physical device or an emulator). Once launched, the visible result will be a button containing no text appearing in the top left hand corner of the RelativeLayout view as shown in Figure 17-1:
[[Image:android_studio_java_buttonandroid_studio_java_button2.png]]
Figure 17-1
[[Image:example_android_java_layout2example_android_java_layout3.png]]
Figure 17-2
[[Image:android_java_layout_example_runningandroid_java_layout_example_running2.png]]
Figure 17-3

Navigation menu