You are currently reading the Android Studio 1.x - Android 5 Edition of this book. Purchase the fully updated Android Studio 3.0 / Android 8 Edition of this publication in eBook ($24.99) or Print ($45.99) format Android Studio 3.0 Development Essentials - Android 8 Edition Print and eBook (ePub/PDF/Kindle) editions contain 82 chapters and over 810 pages 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. 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 best way to achieve this goal is to create an Android application and compile and run it. This chapter will cover the creation of a simple Android application project using Android Studio. 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. Creating a New Android Project The first step in the application development process is to create a new project within the Android Studio environment. ![]() Text String DefinitionBegin, therefore, by launching Android Studio so that the “Welcome to Android Studio” screen appears as illustrated in Figure 3-1: Figure 3-1 Once this window appears, Android Studio is ready for a new project to be created. To create the new project, simply click on the Start a new Android Studio project option to display the first screen of the New Project wizard as shown in Figure 3-2: Figure 3-2. Defining the Project and SDK Settings In the New Project window, set the Application name field to AndroidSample. 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. The Package Name is used to uniquely identify the application within the Android application ecosystem. It should be based on the reversed URL of your domain name followed by the name of the application. Text String ExcelModifying the Example Application At this point, Android Studio has created a minimal example application project and opened the main project. 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 Project tool window has a number of modes in which information can be displayed. By default, this panel will be in Android mode. This setting is controlled by the drop down menu at the top of the panel as highlighted in Figure 3-6. If the panel is not currently in Android mode, click on this menu and switch to Android mode: Figure 3-6 The example project created for us when we selected the option to create an activity consists of a user interface containing a label that will read “Hello World” when the application is executed. You are currently reading the Android Studio 1.x - Android 5 Edition of this book. Lots of chrome surrounding a simple list of tasks. I created TaskPaper as a simple text alternative to OmniFocus. Many people saw WriteRoom as a MS Word alternative, even though it was much, much, simpler. At the time 2005/2006 'Getting Things Done' apps were becoming popular, but they were pretty complicated. Folding text for pc. ![]() Purchase the fully updated Android Studio 3.0 / Android 8 Edition of this publication in eBook ($24.99) or Print ($45.99) format Android Studio 3.0 Development Essentials - Android 8 Edition Print and eBook (ePub/PDF/Kindle) editions contain 82 chapters and over 810 pages The next step in this tutorial is to modify the user interface of our application so that it displays a larger text view object with a different message to the one provided for us by Android Studio. The user interface design for our activity is stored in a file named activity_android_sample.xml which, in turn, is located under app -> res -> layout in the project file hierarchy. Using the Project panel, locate this file as illustrated in Figure 3-7: Figure 3-7 Once located, double click on the file to load it into the User Interface Designer tool which will appear in the center panel of the Android Studio main window: Figure 3-8 In the toolbar across the top of the layout editor panel is a menu that is currently set to Nexus 4 which is reflected in the visual representation of the device within the Designer panel. A wide range of other device options are available for selection by clicking on this menu. To change the orientation of the device representation between landscape and portrait simply use the drop down menu immediately to the right of the device selection menu showing the icon. As can be seen in the device screen, the layout already includes a label that displays a Hello World! Running down the left hand side of the panel is a palette containing different categories of user interface components that may be used to construct a user interface, such as buttons, labels and text fields.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |