

By default, this panel will be in Android mode. The Project tool window has a number of modes in which information can be displayed. The newly created project and references to associated files are listed in the Project tool window located on the left hand side of the main project window. The activity will consist of a single user interface screen layout which, for the purposes of this example, should be named activity_android_sample as shown in Figure 3 5 and with a menu resource named menu_android_sample:įinally, click on Finish to initiate the project creation process. On the final screen (Figure 3 5) name the activity and title AndroidSampleActivity. With the Blank Activity option selected, click Next. The blank activity option creates a template user interface consisting of an app bar, menu, content area and a single floating action button. For the purposes of this example, however, simply select the option to create a Blank Activity. The Empty, Master/Detail Flow, Google Maps and Navigation Drawer options will be covered extensively in later chapters. A range of different activity types is available when developing Android applications. The next step is to define the type of initial activity that is to be created for the application. Since the project is not intended for Google TV, Android Auto or wearable devices, leave the remaining options disabled before clicking Next.

To help in the decision process, selecting an API level from the chart will display the features that are supported at that level. In general it should only be necessary to select a more recent SDK when that release contains a specific feature that is required for your application.


This outlines the various SDK versions and API levels available for use and the percentage of Android devices in the marketplace on which the application will run if that SDK is used as the minimum level. A useful chart (Figure 3 3) can be viewed by clicking on the Help me choose link. The higher the minimum SDK selection, the more the application will be restricted to newer Android devices. The reason for selecting an older SDK release is that this ensures that the finished application will be able to run on the widest possible range of Android devices. On the form factors screen, enable the Phone and Tablet option and set the minimum SDK setting to API 8: Android 2.2 (Froyo). The Project location setting will default to a location in the folder named AndroidStudioProjects located in your home directory and may be changed by clicking on the button to the right of the text field containing the current path setting.Ĭlick Next to proceed. If you do not have a domain name, you may also use for the purposes of testing, though this will need to be changed before an application can be published: For example, if your domain is and the application has been named AndroidSample, then the package name might be specified as follows: It should be based on the reversed URL of your domain name followed by the name of the application. The Package Name is used to uniquely identify the application within the Android application ecosystem. The application name is the name by which the application will be referenced and identified within Android Studio and is also the name that will be used when the completed application goes on sale in the Google Play store. In the New Project window, set the Application name field to AndroidSample. Report this ad Defining the Project and SDK Settings Once the project has been created, a later chapter will explore the use of the Android emulator environment to perform a test run of the application. This chapter will cover the creation of a simple Android application project using Android Studio. The best way to achieve this goal is to create an Android application and compile and run it. Before moving on to slightly more advanced topics, now is a good time to validate that all of the required development packages are installed and functioning correctly. The preceding chapters of this book have covered the steps necessary to configure an environment suitable for the development of Android applications using the Android Studio IDE. Purchase the fully updated Android Studio Dolphin Edition of this publication in eBook ($29.99) or Print ($49.99) formatĪndroid Studio Dolphin Essentials - Java Edition Print and eBook (PDF) editions contain 87 chapters and over 800 pages You are reading a sample chapter from the Android Studio 1.x / Android 6 Edition book.
