Table of Contents Chapter 5:Creating User Interfaces dito Supporting multiple screens 12414575 Changing the Ul theme Handling events Summary 84 Chapter 6:Tools 55 The SDK Manager The AVD Manager The Navigation Editor 62 Generating a Javadoc Version control systems Summary 5868 Chapter 7:Google Play Services How Google Play services work 69 Services available Adding Google Play services to Android Studio Google Maps Android API v2 rm for ogle Play In- Mepp Bi v3 saging 0113776 Chapter 8:Debugging RCo38nd6asbug9ng Debu Android De cetMonitor hreads Method profiling Heap 308688555666668890
Table of Contents [ ii ] Chapter 5: Creating User Interfaces 41 The graphical editor 42 The text-based editor 44 Creating a new layout 44 Adding components 45 Supporting multiple screens 47 Changing the UI theme 50 Handling events 51 Summary 54 Chapter 6: Tools 55 The SDK Manager 56 The AVD Manager 57 The Navigation Editor 62 Generating a Javadoc 65 Version control systems 66 Summary 68 Chapter 7: Google Play Services 69 How Google Play services work 69 Services available 70 Adding Google Play services to Android Studio 71 Google Maps Android API v2 74 Google+ Platform for Android 76 Google Play In-App Billing v3 77 Google Cloud Messaging 77 Summary 78 Chapter 8: Debugging 79 Running and debugging 79 Console 80 Debugger 81 LogCat 83 Memory Monitor 85 Android Device Monitor 85 Threads 86 Method profiling 86 Heap 88 Allocation Tracker 89 Network Statistics 90
Table of Contents File Explorer c Emulator Control System Information % Summary 91 Chapter 9:Preparing for Release 93 an APK file efore releasing your app Generating a signed APK Sun Appendix:Getting Help 99 Getting help from Android Studio Android online documentation Updates Summary 183 Index 105 【】
Table of Contents [ iii ] File Explorer 90 Emulator Control 90 System Information 90 Summary 91 Chapter 9: Preparing for Release 93 Understanding an APK file 93 Steps to take before releasing your app 95 Generating a signed APK 96 Summary 97 Appendix: Getting Help 99 Getting help from Android Studio 99 Android online documentation 100 Updates 102 Summary 103 Index 105
Preface Mobile applicati able not applicatio Android has that make p to devel such as its nd a Xcode,iOS presented itself as a more cer new IDE,Android Studio,makes this centralization finally available for Android developers,and makes this tool indispensable for a good Android developer. This book shows users how to develop and build Android applications with this new IDE.It is not only a"getting started"book but also a guide to advanced developers to build raplcaonsasterandmareprodctCcThioGhadYorelease will fo low m the basic features to the steps to ing pra examples What this book covers Chapter 1,Installing and Configuring Android Studio,describes the installation and basic configuration of Android Studio. Chapter2,Startinga Project,shows how to create a new project and the type of activities we can select. Chapter 3,Navigating a Project,explores the basic structure of a project in Android Studio. Chapter 4,Using the Code Editor,exposes the basic features of the code editor in order to get the best out of it
Preface Mobile applications have seen a huge increase in popularity in the last few years, and this interest is still growing among users. Mobile operating systems are available not only for smartphones but also for tablets, thus increasing the possible market quota for these applications. Android has characteristics that make it pleasant to developers, such as its open source nature and a certain level of community-driven development. Android has always been contesting with iOS (the Apple mobile system) in everything, and with Xcode, iOS presented itself as a more centralized development environment. The new IDE, Android Studio, makes this centralization finally available for Android developers, and makes this tool indispensable for a good Android developer. This book shows users how to develop and build Android applications with this new IDE. It is not only a "getting started" book but also a guide to advanced developers to build their applications faster and more productively. This book will follow a tutorial-like approach, from the basic features to the steps to build for release, including practical examples. What this book covers Chapter 1, Installing and Configuring Android Studio, describes the installation and basic configuration of Android Studio. Chapter 2, Starting a Project, shows how to create a new project and the type of activities we can select. Chapter 3, Navigating a Project, explores the basic structure of a project in Android Studio. Chapter 4, Using the Code Editor, exposes the basic features of the code editor in order to get the best out of it
Preface Chapter 5,Creating User Interfaces,focuses on the creation of the user interfaces using both the graphical view and the text-based view. Chapter 6,Tools,introduces the currently existing Google Play services and shows how to integrate them with a project in Android Studio. Chapter 7,Google Play Services,exposes some additional tools such as Android SDK tools,Javadoc,and version control integration. Chapter 8,Debugging,shows in detail how to debug an application in Android Studio and the provided information when debugging. Chapter9,Preparing for Release,describes how to prepare your application for its release. Appendix,Getting Help,teaches you how to get help using Android Studio and provides a list of online sites to learn more about the topics seen in this book. What you need for this book Who this book is for This book is not only a"getting started"book but also a guide for advanced want to Conventions In this book,you will find a number of styles of text that distinguish between different kinds of information.Here are some examples of these styles,and an explanation of their meaning. Code words in text,database table names,folder names,filenames,file extensions PedhmmRiAepdaonoatnoaop [21
Preface [ 2 ] Chapter 5, Creating User Interfaces, focuses on the creation of the user interfaces using both the graphical view and the text-based view. Chapter 6, Tools, introduces the currently existing Google Play services and shows how to integrate them with a project in Android Studio. Chapter 7, Google Play Services, exposes some additional tools such as Android SDK tools, Javadoc, and version control integration. Chapter 8, Debugging, shows in detail how to debug an application in Android Studio and the provided information when debugging. Chapter 9, Preparing for Release, describes how to prepare your application for its release. Appendix, Getting Help, teaches you how to get help using Android Studio and provides a list of online sites to learn more about the topics seen in this book. What you need for this book For this book, you need a Windows, Mac, or Linux system. You will also need to have Java installed in your system. Who this book is for This book is not only a "getting started" book but also a guide for advanced developers who have not used Android Studio to build their Android apps before. This book is great for developers who want to learn the key features of Android Studio and for developers who want to create their first app. It's assumed that you are familiar with the object-oriented programming paradigm and the Java programming language. It is also required to understand the main characteristics of the Android mobile system. Conventions In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning. Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The default installation directory is /Applications/Android\ Studio.app
Preface A block of code is set as follows: protected void onCreate(Bundle savedInstancestate) super.onCreate(savedInstancestate); setContentview(R.layout.activity main); When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold: protected void onCreate(Bundle savedInstancestate){ if (savedInstancestate I=null){ out ganTgompanwhe2e Select Blank Activity and click on Next." [& Warnings or important notes appear in a box like this [也 Tips and tricks appear like this Reader feedback Feedback from our readers is always welcome.Let us know what you think about devlohat he o CeClmeaoekeoectpw.condmcnian If there is a topic that you have expertise in and you are interested in either writing or contributing to a book,see our author guide at www.packtpub.com/authors. 【3]
Preface [ 3 ] A block of code is set as follows: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState != null) { System.out.println("savedInstanceState = " + savedInstanceState); } } New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: " Select Blank Activity and click on Next." Warnings or important notes appear in a box like this. Tips and tricks appear like this. Reader feedback Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail feedback@packtpub.com, and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors