Android Workshop 2013 Android SDK DR ABDUL RAHIM
Android Workshop 2013 Android SDK DR. ABDUL RAHIM BIN AHMAD College of IT UNITEN 21&22 September 2013
Android Facts • • World's most popular mobile platform Hundreds of millions of mobile devices > 190 countries around the world. Largest installed base mobile platform Growth — 1 million users additional users / day World-class platform for creating apps and games Open marketplace for instant distribution.
Android Growth
Android Installed Base Linux community Very open > 300 hardware, software, and carrier partners > 1. 5 billion apps/month from Google Play. single application model across hundreds of millions of users - from phones to tablets and beyond • tools for creating apps that adapts the UI to look its best on each device • • •
Android Application Development • Create single app binary - optimized for phone and tablet. – declare UI in XML resources • One set for parts of the UI that are common to all form factors • The other sets for optimzations specific to phones or tablets. – At runtime applies correct resource sets based on screen size, density, locale etc • Development assited by Android Developer Tools – full Java IDE – Features for developing, debugging, and packaging Android apps. – Can develop on any Android device – Can create virtual devices that emulate hardware.
Android Application Distribution • Through Google Play – An open marketplace • Developer in control of how to sell – publish whenever they want – as often as they want – to the customers they want. • Google Play helps build visibility and engagement across apps developed.
How to Setup ADT Bundle • Go to http: //developer. android. com. • Download – – – developer SDK API documentation design guidelines information about the current device landscape information about how to distribute and sell • Three steps there after. – Design – Develop – Distribute
Design • Before writing code: – design the user interface that fit Android user experience. – focus on how a user will interact with the app. – sleek, simple, powerful, and tailored • Follow design guidelines.
Develop • Use tools to turn app ideas into apps. • Use Android's framework – That provides the APIs to build apps that take full advantage of device hardware, connected accessory devices, the Internet, software features, and more. • Learn about the app framework and developer tools using the develop documentation.
Distribute • App is completed when: – It supports a variety of screen sizes and densities – It was tested on the Android emulator – It was also tested on real devices. • Marketing strategy: – monetization strategy – which types of devices the app supports. • Get started with this process following the distribute section
Android SDK • Contains: – API libraries – Developer tools necessary to build, test, and debug • What to download – ADT Bundle that includes • • • Eclipse + ADT plugin Android SDK Tools Android Platform-tools The latest Android platform The latest Android system image for the emulator – A new Android development environment - Android Studio (based on Intelli. J IDEA)
How to Setup ADT Bundle • Download file: – adt-bundle-windows-x 86 -20130729. zip • Unpack the file and save it to an appropriate directory location. – Should contain: • Directory <eclipse> • Directory < sdk > • File SDK Manager. exe – Caution: Do not change anything in this location. • Open the /eclipse/ directory and launch eclipse.
Optional – ANDROID STUDIO • • • A new Android development environment (ver 0. 2. x) based on Intelli. J IDEA. Similar to Eclipse with the ADT Plugin. Provides integrated Android developer tools for development and debugging. Same capabilities as Intelli. J IDEA. Additional features: Gradle-based build support. Android-specific refactoring Lint tools Pro. Guard and app-signing. Template-based wizards for common Android designs and components. – Rich layout editor that (drag-and-drop, preview layouts on multiple screen configurations etc). – – – • Currently available as early access preview. – Some features incomplete or not implemented – May encounter bugs
ANDROID SDK • Consists of modular packages • Packages can be downloaded separately using the Android SDK Manager. – Upon update of an Android platform. – Upon release of new version of Android platform.
Available Packages File Locations SDK Tools <sdk>/tools/ SDK Platform-tools <sdk>/platform-tools/ Documentation <sdk>/docs/ SDK Platform <sdk>/platforms/<android-version>/ System Images <sdk>/platforms/<android-version>/ Sources for Android SDK <sdk>/sources/ Samples for SDK <sdk>/platforms/<android-version>/samples/ Google APIs <sdk>/add-ons/ Android Support <sdk>/extras/android/support/ Google Play Billing <sdk>/extras/google/ Google Play Licensing <sdk>/extras/google/
Available Packages Descriptions SDK Tools for debugging and testing and other utilities required for development SDK Platform-tools Platform-dependent tools for developing and debugging Documentation An offline copy of the latest documentation for the Android platform APIs. SDK Platform One SDK Platform for each version of Android must be specified in target build. Includes an android. jar file with Android library. System Images A platform version offers one or more different system images (ARM or x 86). Required to run the emulators. Sources for Android SDK A copy of the Android platform source code (for stepping through the code in debugging). Samples for SDK Sample apps on a variety of platforms. Google APIs A Google SDK add-on that provides both a platform and system image for the emulator Android Support A static library you can include in your app sources in order to use powerful APIs that aren't available in the standard platform. Google Play Billing Static libraries and samples to integrate billing services in app with Google Play Licensing Static libraries and samples to perform license verification for app in distribution at Google Play.
SDK Manager • Launch the SDK Manager in 2 ways: – From Eclipse (with ADT), select Window > Android SDK Manager. – On Windows, double-click the SDK Manager. exe file at the root of the Android SDK directory. • Select which packages to download by toggling the checkboxes on the left, then click Install to install the selected packages.
SDK Manager
Overall Apps development • Developing apps can be done using: – Eclipse IDE (preferred) • Directly invoke the tools while developing. • Access tools via ADT plugin. • Use tools via Command line. – Other IDE or text editor: • Use tools via Command line. • Invoke the tools with scripts. • The less streamlined way to develop – sometimes have to call command line tools manually – but can access same number of features as in Eclipse
The Four Steps SETUP DEVELOPMENT DEBUGGING AND TESTING PUBLISHING
The Four Steps • Setup – Install and setup IDEs – Create Android Virtual Devices (AVDs) or emulators – Connect Hardware Devices (mobile phone) • Design/Develop – Create source code and resources files • Debug and Test – – Build. apk package Install and run on emulator (or real device) Debug using debugger provided by Eclipse Test using SDK testing tools • Publish – Configure and build for release – Distribute to users
Emulators • Also called Android Virtual Device (AVD) • A configuration that models actual device by defining hardware and software options • How to create an emulator? – Use AVD Manager • launched from Eclipse by clicking Window > AVD Manager. • Launched from command line by calling android tool with the avdoptions, from the <sdk>/tools/ directory. – Create on the command line by passing the android tool options.
Thank You…
- Slides: 23