Android Programming
eBook - ePub

Android Programming

Pushing the Limits

Erik Hellman

Condividi libro
  1. English
  2. ePUB (disponibile sull'app)
  3. Disponibile su iOS e Android
eBook - ePub

Android Programming

Pushing the Limits

Erik Hellman

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Unleash the power of the Android OS and build the kinds of brilliant, innovative apps users love to use

If you already know your way around the Android OS and can build a simple Android app in under an hour, this book is for you. If you're itching to see just how far you can push it and discover what Android is really capable of, it's for you. And if you're ready to learn how to build advanced, intuitive, innovative apps that are a blast to use, this book is definitely for you.

From custom views and advanced multi-touch gestures, to integrating online web services and exploiting the latest geofencing and activity recognition features, ace Android developer, Erik Hellman, delivers expert tips, tricks and little-known techniques for pushing the Android envelope so you can:

  • Optimize your components for the smoothest user experience possible
  • Create your own custom Views
  • Push the boundaries of the Android SDK
  • Master Android Studio and Gradle
  • Make optimal use of the Android audio, video and graphics APIs
  • Program in Text-To-Speech and Speech Recognition
  • Make the most of the new Android maps and location API
  • Use Android connectivity technologies to communicate with remote devices
  • Perform background processing
  • Use Android cryptography APIs
  • Find and safely use hidden Android APIs
  • Cloud-enable your applications with Google Play Services
  • Distribute and sell your applications on Google Play Store

Learn how to unleash the power of Android and transform your apps from good to great in Android Programming: Pushing the Limits.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Android Programming è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Android Programming di Erik Hellman in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Open Source Programming. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Editore
Wiley
Anno
2013
ISBN
9781118717356
Part I
Building a Better Foundation
Chapter 1 Fine-Tuning Your Development Environment
Chapter 2 Efficient Java Code for Android
Chapter 1
Fine-Tuning Your Development Environment
Depending on what you’re developing, you have different choices when it comes to the tools you can use. Your requirements on the development environment differs if you’re writing an HTML5 application or if you’re developing a server-side application in Java. Some platforms offer more choice than others, and as I describe next, developing Android applications gives you a lot of choice for your development environment.
I begin this chapter with some more advanced internals of the Android SDK and how you can use them in your daily development and how they can assist you in improving the quality of your application. I continue by describing how to structure your code projects in an optimal way for reuse by using library projects. You also learn how to take version control to a new level by integrating Git with a code-review tool called Gerrit. As a developer, you will spend most of your time using the IDE tool. While the Eclipse IDE is still supported by Google, they are now pushing developers to use their new Android Studio IDE for all Android projects. So, I give an introduction to Android Studio as well as to the new build system called Gradle. Finally, I go through the developer settings that are available on Android devices.
Operating Systems for Android Development
This is probably the one topic you don’t have to worry about. Either you can pick the operating system on your computer used for development, or it is limited by the IT-policies of your employer. For most Android developers, any of the officially supported operating systems works fine. However, there are situations where the choice will matter.
Google supports Windows, Linux, and OS X for developing Android applications. Although Windows is officially supported by the Android SDK, you’ll have problems if you decide to do advanced development, especially when it comes to writing native applications or building your own custom ROM. The best choice is either Linux or OS X. If possible, try to have one of these as your primary operating system, and you’ll run into far fewer problems. Another reason for avoiding Windows on your Android development environment is that you won’t need to install new USB drivers for every Android device you work on.
Advanced Android SDK Tools
After you have your operating system and the required (and recommended) tools installed on your computer, you can focus on the Android SDK. You will find the download for your operating system and the latest installation instructions at http://developer.android.com/sdk. Android Studio comes with an SDK bundle that is completely managed from within the IDE, but if you prefer to have a standalone version you can download that as well.
Make sure that you always keep the SDK up to date and that you download the APIs for all the Android versions that you’re developing for. The easiest way to update your standalone Android SDK is to run the update tool from the command prompt:
$ android update sdk --no-ui
Inside the Android SDK folder, you will find a number of subfolders. From a tools perspective, only the platform-tools and tools folders are of interest for now. I will introduce some of these tools and explain how to use them, starting with the adb (Android Debug Bridge) tool. If you are frequently using the command line tools in the Android SDK I recommend that you add the path to these folders in your local PATH variable.
You can find the official documentation for most of the tools in the Android SDK at http://developer.android.com/tools/help/index.html.
The adb Tool
In the platform-tools folder, you will find the adb tool that is used to communicate with your device to install and start apps during development. In earlier versions of the Android SDK, this tool was found in the tools directory, but it has since been moved. Besides being used for installing, starting, and debugging applications from your IDE, the adb tool enables you to manually call many of the low-level operations on your Android device for debugging purposes. To list all the commands available, simply type adb help all in your terminal (Linux or Mac OS X) or command prompt (Windows).
Some common adb commands are
adb devices—List all connected Android devices and Emulators.
adb push <local> <remote>—Copy a file from your computer to a device (usually on the SD card).
adb pull <remote> <local>—Copy a file from the device to your computer.
adb and Multiple Devices
If you ever need to develop and debug an application for two or more devices simultaneously, such as for a multiplayer game or an instant-message application, adb needs an additional argument to know which device you want to address. You do so by adding –s <serial number> as the first parameter to adb. You can see the serial number for your connected devices by executing the adb devices command. To run the logcat command on a specific device, run the following:
$ adb devices
List of devices attached
0070015947d30e4b device
015d2856b8300a10 device
$ adb –s 015d2856b8300a10 logcat
When you have multiple devices connected or emulators started a dialog box will appear when you launch your application in your IDE.
Mastering Logcat Filtering
Logging is an important part of Android application development. Although using breakpoints and a debugger from your IDE is extremely powerful when you want to follow the execution flow and inspect the values and state of different variables, simply reading the output from logcat can sometimes be more efficient. Android logging is handled by the logcat function, which is usually integrated in your IDE but can also be called via the adb command.
Because Android outputs all system and application log messages to the same stream, it can become quite complicated to find the messages that relate to your ...

Indice dei contenuti