Android Overview Francesco Mercaldo, PhD Post-Doctoral researcher Corso di Sicurezza delle Reti e dei Sistemi Software Università degli Studi del Sannio (fmercaldo@unisannio.it) Things are not always what they seem; the first appearance deceives many; the intelligence of a few perceives what has been carefully hidden. Phaedrus
Why Mobile App Development? The fact that we can! Only a few years ago you had to be in the Motorola inner circle to do it! Mobile platform is the platform of the future Double-digit growth in world-wide smartphone ownership 3 Job market is hot Market for mobile software surges from $4.1 billion in 2009 to $17.5 billion by 2012 1 2010 Dice.com survey: 72% of recruiters looking for iphone app developers, 60% for Android 1 Dice.com: mobile app developers made $85,000 in 2010 and salaries expected to rise 2 1 http://www.businessweek.com/technology/content/oct2010/tc20101020_639668.htm 2 http://it-jobs.fins.com/articles/sb129606993144879991/mobile-app-developers-wanted-at-ad-agencies 3 http://www.gartner.com/it/page.jsp?id=1466313
A matter of fact 85% of the population owns a smartphone 96% of us use our phones to take photos 70% of mobile devices are used to take selfies.
The OS Market Share
Only a year ago Morgan Stanley
What is Android? Android is a software stack for mobile devices that includes an operating system, middleware and key applications. 6
What about Android? A software stack for mobile devices that includes An operating system Middleware Key Applications Uses Linux to provide core system services Security Memory management Process management Power management Hardware drivers
OHA (Open Handset Alliance) A business alliance consisting of 47 companies to develop open standards for mobile devices 8
OHA (Open Handset Alliance)
Phones HTC G1, Droid, Tattoo Motorola Droid (X) Suno S880 Samsung Galaxy Sony Ericsson 10
Tablets Velocity Micro Cruz Gome FlyTouch Acer betouch Dawa D7 Toshiba Android SmartBook Cisco Android Tablet 11
SmartWatch
ChromeCast
Android-Powered Microwave By Touch Revolution at CES 2010 http://www.pocket-lint.com/news/30712/android-powered-microwavecooking-google
Android Washing Machine
Brief History Ice cream Sandwich Android 4.0+
Distribution of Android Devices Distribution of Android operating systems used by Android phone owners in June 2014, by platform version http://www.statista.com/statistics/271774/share-of-android-platformson-mobile-devices-with-android-os/
Android HW support Android is a software platform for mobile devices based on the Linux operating system and developed by Google and the Open Handset Alliance OS: Linux kernel - version 2.6/3.x (from Android 4.0) Emulator: on Mac, Windows, Linux Hardware support: GSM Telephony Bluetooth, 3G and WiFi Camera, GPS, compass and accelerometer
Android Architecture More details at: http://developer.android.com/guide/basics/what-is-android.html
Linux Kernel Android relies on Linux version 2.6/3.x for core system services such as security, memory management, process management, network stack and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.
Runtime Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. The DalvikVM executes files in the Dalvik Executables (.dex) format which is optimized for minimal memory footprint. The VM is register-based and runs classes compiled by a Java language compiler that have been transformed into the.dex format by the included "dx" tool. The dalvik VM relies on the Linux kernel for underlying funcionality such as threading and low-level memory management.
Libraries Android includes a set of C/C++ libraries used by various components of the Android system. Surface Manager - manages access to the display subsystem and seamlessly composited 2D and 3D graphic layers from multiple application Media Libraries - support playback and recording of many popular audio and video formats, as well as static image file FreeType - bitmap and vector font rendering SQLite - a powerful and lightweight relationa database engine available to all applications
Application Framework Android will ship with a set of core applications including an email client, SMS program, calendar, maps, browser, contacts and other. All application are writter usgin Java. Underlying all application is a set of services and systems, including: A rich and extensible set of Views that can be used to build an application, including lists, grids, text boxes, buttons and even an embeddable web browser.
Mobile Devices: Advantages (as compared to fixed devices) Always with the user Typically have Internet access Typically GPS enabled Typically have accelerometer & compass Most have cameras & microphones Many apps are free or low-cost
Mobile Devices: Disadvantages Limited screen size Limited battery life Limited processor speed Limited and sometimes slow network access Limited or awkward input: soft keyboard, phone keypad, touch screen, or stylus Limited web browser functionality Range of platforms & configurations across devices
Mobile Applications What are they? Any application that runs on a mobile device Types Web apps: run in a web browser HTML, JavaScript, Flash, server-side components, etc. Native: compiled binaries for the device Often make use of web services
What Should Students Already Know? Java! inheritance, method overriding interfaces, casting exceptions debugging reading API documentation Eclipse easy to pick up quickly, though
Android Android is an open source operating system, created by Google specifically for use on mobile devices (cell phones and tablets) Can be programmed in C/C++ but most app development is done in Java (Java access to C Libraries via JNI (Java Native Interface)) Supports Bluetooth, Wi-Fi, and 3G and 4G networking
ios Apple s mobile OS for phones (iphone), tablets (ipad), handhelds (ipod), based on BSD Unix Application programming done in Objective C Supports Bluetooth, Wi-Fi, and 3G and 4G networking
Android Application Development Eclipse IDE Android SDK Android Emulator Android Mobile Device
ios Application Development XCODE IDE ios SDK ios Simulator ios Mobile Device
Android development Android Manifest Resource XML Java Source Generated Class Android Libraries Java Compiler.dex File Dalvik VM
ios development Xcode Objective C Source Interface Builder.xib file Objective C Compiler Simulator or Device Foundation Framework Cocoa Libraries
Development process for an Android app http://developer.android.com/guide/developing/index.html
Android Apps Built using Java and new SDK libraries No support for some Java libraries like Swing & AWT Oracle currently suing Google over use Java code compiled into Dalvik byte code (.dex) Optimized for mobile devices (better memory management, battery utilization, etc.) Dalvik VM runs.dex files
What makes an Android Application Activities Services Content Provider Intent Broadcast Receivers Notification
Activities vs Services
Intent and Broadcast Receiver
Content Providers
Notifications
Building and running Compiled resources (xml files) Android Debug Bridge ADB is a client server program that connects clients on developer machine to devices/emulators to facilitate development. An IDE like Eclipse handles this entire process for you. http://developer.android.com/guide/developing/building/index.html#detailed-build
Applications Are Boxed By default, each app is run in its own Linux process Process started when app s code needs to be executed Threads can be started to handle time-consuming operations Each process has its own Dalvik VM By default, each app is assigned unique Linux ID Permissions are set so app s files are only visible to that app
Android Architecture
Android Design Philosophy Applications should be: Fast Resource constraints: <200MB RAM, slow processor Responsive Apps must respond to user actions within 5 seconds Secure Apps declare permissions in manifest Seamless Usability is key, persist data, suspend services Android kills processes in background as needed
Apple vs. Google Open Handset Alliance 30+ technology companies Commitment to openness, shared vision, and concrete plans Compare with Mac/PC battles Similar (many PC manufacturers, one Apple) Different (Microsoft sells Windows, Google gives away Android)
Android resources
Any Questions?