Contains tools and files necessary to build Android applications
Possible to build applications with only the SDK and its command line tools
Recommended to use an IDE (Integrated Development Environment)
Many, if not all, tools require Java to run
Android SDK Manager
Download further components and update the existing tools
Android Virtual Device Manager
Create virtual phones with different screen sizes and other features
Run a virtual phone created with the Virtual Device Manager
Show and investigate the insides of a running phone, physical or virtual
Android SDK Manager 9
Download and update components of the SDK
Menu/button in development environment (Eclipse or Android Studio)
Run "android sdk" from the command line inside the tools directory of the SDK
On Windows, you can also start "SDK Manager.exe"
A specific version of the Android operating system for building and running apps
A specific version of the Android operating system including Google specific APIs (maps)
ARM EABI v7a System Image
A binary for running virtual phones in the emulator, emulating the ARM processor (slow)
Intel x86 Atom System Image
A binary for running virtual phones in the emulator using native Intel processor (faster). For this to work you also need to install the Intel x86 Emulation Accelerator.
Google Play Services
Not used in the course, but contains a lot of extra APIs not available in the operating system
Intel x86 Emulation Accelerator (HAXM)
Android Virtual Device Manager 10
Tool in the SDK to create virtual devices and then launch them inside the Android Emulator
Menu/button in the development environment (Eclipse or Android Studio)
Run "android avd" from the command line inside the tools directory of the SDK
Create new virtual devices
Choose an Android version for the phone
Choose an image (ARM or possibly x86 emulation)
Choose memory and other features
Start a virtual device in the Android Emulator
Android Emulator 11
Very close to a real device
Slow to start. Ok to use (hopefully). Keep it open!
Specify "Hardware keyboard" to type using your computer keyboard
Physical buttons on a physical device will be extra buttons in the Android Emulator window
Can be scaled/resized when running on computers with smaller screens
Each running emulator has a local tcp port number for control/communication
adb is a command line tool to communicate with the emulator
Multiple running emulators can "call" each other using the port number
Common errors 12
Syntax errors in layout xml file
Typing wrong element or attribute names in the xml file is common and are usually not discovered until starting your application. Note that most names are case sensitive. Also note that most attributes is prefixed with "android:". The exception thrown is seldom helpful.
Wrong onClick method
If the value of the "android:onClick" attribute does not match the method in your Java class, this is not discovered until the application runs. The name much match exactly, including case, but the method must also be "public void" and take a View as its single argument.
Forgetting to request a permission
Some operations like performing a network request requires a permission to be specified in your AndroidManifest.xml file. Without it, an exception will be thrown the first time network communication is attempted.
Forgetting to declare extra Activities
If your app has more than one Activity, it is common to forget that besides creating a layout xml and an Java source code file you also need to declare it in AndroidManifest.xml.
Faster Android Emulator 13
Android Emulator is slow
Because it is as close to a physical device as is possible. A full compile of the Android platform for ARM processors. Since it needs to emulate the ARM processor, it will always be slow.
Not always a bad thing. The advantage is that the speed of emulator will not fool you with regards to how fast your code will run on physical devices.
Use a x86 image instead
A full compile of the Android platform, but for Intel x86 processors
This will be faster since it means that no ARM processor emulation is necessary
Requires installation of "Intel x86 Emulator Accelerator (HAXM)"
Install it from the Android SDK Manager (under Extras). Requires administrative access on your computer.
Then install "Intel x86 Atom System Image" for the Android version
And create a virtual device that uses the "Interl x86..." image instead
Deciding on an Android version 14
One single application
Can run on many different Android versions
Can check and adjust itself to take advantage of newer features on newer versions
Multiple versions of the application
Build separate applications with different "Minimum Required" versions
Some/much shared code
Two versions should cover most of the needs for version separation
If there is a specific feature your application requires in order to function
If there are features that will enhance your application, but isn't essential