Question? Leave a message!




AN INTRODUCTION TO ANDROID DEVELOPMENT

AN INTRODUCTION TO ANDROID DEVELOPMENT 17
AN INTRODUCTION TO ANDROID DEVELOPMENT CS231M Alejandro TroccoliOutline Overview of the Android Operating System Development tools Deploying application packages Stepbystep application developmentThe Android ecosystem An open source platform for mobile, embedded and wearable devices Google is the principle maintainer Other companies contribute to the system. Each device manufacturer can customize Android to suite their needsAndroid architecture User applications Use Java framework and, optionally, native code. Android framework Java classes under com.android Native framework layer User mode C, C++ code – compiled to native platform or 32bit compatibility mode on 64 bits. Linux Kernel (GPL license) C code – compiled to native platform (x86, arm, mips)Android versioning Plaform version 5.0 Lollipop 4.4 KitKat Framework API level SDK compatibility Each platform version has an API level NDK API level API level for native headers Distribution http://developer.android.com/about/dashboards/index.htmlBrowsing the Android Source Source at: https://android.googlesource.com/ Porting instructions (for system developers) https://source.android.com/devices/index.htmlReference to the framework APIs com.android classes http://developer.android.com/reference/packages.htmlOutline Overview of the Android Operating System Development tools Deploying application packages Stepbystep application developmentTools for application development Android SDK Provides the Java framework classes Compiles to java bytecode Class framework is updated with every OS release Android NDK C/C++ toolchain for compiling to machine code Android platform tools adb (android debug bridge) : runs and debugs apps from your dev machine Android developer tools Eclipse plugin for Android Android studio (doesn’t yet fully support all NDK features)Setup options Tegra Android Development pack Install components manually Use a Linux virtual machine with the tools preinstalled.Tegra Android Development PackTegra Android Development Pack Register for an account at: https://developer.nvidia.com/user/register Signup for Gameworks Registered Developer ProgramNVIDIA Shield Tablet Click 7 times to enable developer optionsOutline Overview of the Android Operating System Development tools Deploying application packages Stepbystep application developmentApplication packages .apk files: compressed files class byte code resources( icons, sounds, etc). Binary native files All .apks are signed Default development key is created by SDK. When updating an application, signature are checked.Installing an application From application distribution markets Google Play Amazon AppStore From your local computer using adbEnabling android debug bridge (adb)Useful adb commandsOutline Overview of the Android Operating System Development tools Deploying application packages Stepbystep application developmentHello Android In Eclipse File New Android Application ProjectHello AndroidHello AndroidImport an project from existing codeAndroidManifest.xml Package Name / version Required SDK and target SDK Application/Activities PermissionsAndroid Activity Provides user interaction http://developer.android.com/reference/android/app/Activity.html Callbacks for lifecycle management onCreate() onResume() onPause() An application can have multiple activities.. Needs one launcher activity…HelloAndroidActivityHelloAndroidActivity Use onCreate() to create UI.Launch Add Activity to AndroidManifest.xml:Launch (take 2)Launch with debuggerLaunch (take 3)Views Can be composed in a tree hierarchy. The root View is the argument to setContentViewCreating a layoutAccessing layout elements from Activtiy Use findViewById R.id.name corresponds to the name given in the xml fileEvent listeners (and logging, too)Logcat Window Show View Other Android LogcatCreating a log fileWriting to the log fileLong running task Long running tasks on the main thread can block the UI App looks unresponsiveUse a separate Thread insteadUse Handlers to update UIAdd a Progress dialogSummary
sharer
Presentations
Free
Document Information
Category:
Presentations
User Name:
CharlieNixon
User Type:
Researcher
Country:
United Kingdom
Uploaded Date:
13-07-2017