Introduction to android development Dr. Razi Iqbal firstname.lastname@example.org
What is Android? • Its an OS for mobile phones • It is a modified form of Linux • It runs on Linux Kernel 2.6 • Bought by Google in 2005 • Android is open source • Source Code is available at http://source.android.com/ • Different hardware vendors can build their devices and run Android on them
Android Features • Storage • SQLite • Connectivity • GSM • CDMA • LTE • Wi-Fi • WiMax • Messaging • Multitouch • Multitasking
Android Architecture • Linux Kernel • Android runs on Linux Kernel 2.6. • A Kernel is collection of programs that helps in interaction of software and hardware. These programs are called drivers. • Android because of its foundation on Linux Kernel contains all the basic functionality of Linux e.g. Memory Management. • A device with certain hardware should have a proper driver in the Linux Kernel to work properly • Bluetooth will not work until the driver is available for that hardware.
Android Architecture • Libraries • Android contains some core libraries which help build different other libraries. • Some of the most important libraries are • Media Framework • Contains all the codecs for media • WebKit • It is a browser engine that runs HTML content • SQLite • Handles storage of data
Android Architecture • Android Runtime • Dalvik Virtual Machine • It is a virtual machine like JVM. • It does not run .class file, instead it runs .dex files • These files are created from .class files at compilation time. • Multiple instances of DVM can run simultaneously. • Core Libraries • It contains different libraries from Java SE and Java ME
Android Architecture • Application Framework • As a developer we directly interact with this layer. • This layer contains libraries which provide basic functionality for android like call, messaging and resource management etc. • Some of them are • Activity Manager • It takes care of the activity life cycle • Location Manager • It handles the location
Android Architecture • Applications • Based on all the previously mentioned layers, our applications will be available at Applications Layer. • Almost all the applications are handled at this layer. • Default apps also fall in this category • Some of the default apps are • Phone • Messaging • Mail
Android Smart Phones Galaxy S II Motorola Atrix 4G, HTC EVO 4G
Android Tablets Asus Eee Pad Transformer TF101 Samsung Galaxy Tab 10.1
Android EBook Readers Amazon’s Kindle Fire Barnes and Noble’s NOOK Color
Android Based TV Scandinavia Android TV
Mashup Compatibility Combination of two or more service to create an App. • Geolocation + Social networking • Geolocation + Gaming • Camera + Geolocation • Contacts + Maps
Components of Android Programming Activities • Android Application are composed of Activities • Each Application will have at least one Activity • Activities are like container • Code • User Interface • Its like Form for Windows in Vb.net Activity Hello World !
Components of Android Programming Intents Intent = Action + Data • It can be transition between two activities • It can be launching an app from one app • It’s a message to Android System to tell app will do something
Components of Android Programming Cursorless Control • Unlike PCs, no cursor on screen • Fingers are used to perform Screen Actions • Multitouch gestures • Zooming • Dragging • Long Press right click
Components of Android Programming Views and Widgets • View is a rectangular area on screen for drawing • Menu • Context Menu • Widgets are advanced UI Controls • Buttons • Checkboxes • DatePickers etc.
Components of Android Programming Background Service • Service is a program that doesn’t need to have a UI • A background service runs in the background • Antivirus application in windows is a background service • Alarm app runs in background for mobile phones
Google APIs • Android can do more than Calls and Messages • It can help in navigating • It can help in showing a friend on map
Android in Cloud • Information can be stored in Cloud • Information can be retrieved from Cloud
Requirements Any PC running • Windows • Min. Windows Xp • Mac OS X • Min. 10.5.8 • Linux • Ubuntu Linux • Eclipse • Min. 3.6.2 • JDK • Min JDK 6