1 / 30

Android

Android. L. Grewe. What is Android. An open source platform for mobile, embedded and wearable devices Google is the principle contributor HW device manufacturer can customize Android to suite their needs Android is not an operating system Android is build on top of Linux Kernel

delbertj
Download Presentation

Android

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android L. Grewe

  2. What is Android • An open source platform for mobile, embedded and wearable devices • Google is the principle contributor • HW device manufacturer can customize Android to suite their needs • Android is not an operating system • Android is build on top of Linux Kernel • Android is not equivalent to Linux Kernel • Android is an open source • Android devices sales largest worldwide

  3. Android and Java • Android does not use the standard JVM • Android own its own JVM (Dalvik) • Android Dalvik vs standard JVM • register-based vs stack-based • more efficient and compact implementation • different set of java libraries than standard java libraries

  4. Android and Java • cannot run standard Java bytecode on Android. • provides a tool "dx" which allows to convert Java Class files into "dex" (Dalvik Executable) files. • Android applications are packed into an .apk (Android Package) file by the APK Packager • signs your APK using either the debug or release keystore. • This is all done for you with the main Android Studio IDE Debug version (app intend only for testing) , signs with the Defualt debug keystore auto created by Android Studio Release version  signs your app with the release keystore. To create a release keystore, read about SIGNING APP IN ANDROID STUDIO

  5. Android FrameWork Stack

  6. Android Versions • API evolves over time • Devices typically after some time are Out of Date –do not allow updates to new Android version –force buying of new hardware (like Apple)

  7. Android Application can use 3rd party resources… • Android applications • google maps • facebook  • twitter • ...MORE

  8. AndroidSDK • Tools • Docs • Platforms • Android XX • Data • Skins • Images • Samples • Add-ons • Google API

  9. Android Framework • ActivityManager • Content providers • Resource manager • Location Manager • Notification Manager • ...MORE

  10. Android Process and Thread • Linux process per application • Runs under its own userid which is generated automatically by Android system during deployment • Hence application isolated from other applications • One thread per process • UI Thread • manage Looper message

  11. Android Application Components: Android application =collection of loosely coupled components • Activity (and fragments) • Views • Service • Intents and Broadcast receiver (Intents reciever) • Content provider Application = LOOSELY coupled components

  12. Activity • presentation layer , e.g. a screen which the user sees. • application can have several activities and it can be switched between them during runtime of the application. • Also, fragments –like mini-activies grouped together to create an activity

  13. The building block of the user interface. The Android analogue for the window or dialog in a desktop application. Activity • a single, focused thing that the user can do • takes care of creating a window for user • presentation to the user  • full-screen windows • floating windows • embedding inside of another activity • Lifecycle events will invoke the methods of Activity: • void onCreate(Bundle savedInstanceState)  • void onStart()   • void onRestart()   • void onResume()   • void onPause()   • void onStop()   • void onDestroy()

  14. Android Activity LifeCycle

  15. Views NOTE: this is really contained in Activity or Fragmentsand those not really a separate “component” of app • The User interface of an Activities is build with widgets classes which inherent from "android.view.View". • The layout of the views is managed by "android.view.ViewGroups".

  16. Services • perform background tasks without providing an UI. • Usefull when your app must communicate with backend systems and not make your user wait for it to finish • Useful when you app has to do a lot of long calculations and don’t want your user to wail • can notify the user via the notification framework in Android. • An example --- Pandora App –a music app that can run in background and still play music

  17. Service •  perform a longer-running operationwhile not interacting with the user • can be started and stopped • doesn't have UI • run by activities • implicit Service (binding service) • explicit Service (start service) • lifecycle • void onCreate()   • void onStart(Intent intent)   • void onDestroy() • Examples: • checking for updates to an RSS feed • playing back music even if the controlling activity is no longer operating.

  18. Content Provider • store and retrieve data and make it accessible to all applications • to share data across applications • Android contains a SQLite DB which can serve as data provider • You can use pre-existing content-providers or you could create an app that itself is a content provider for other applications to use. • Think about how some apps use your contact list ---this contact list is a content provider that is built-in/existing already for you to use in your application.

  19. Intents • an abstract description of an operation to be performed • action • data • Explicit Intents (specified a component) • Implicit Intents  This may be a new idea for you --- it is a asynchronous way of telling the Android System you want to do something We will learn more later about what this means

  20. Intents • Intents are system (asynchronous) messages, running around the inside of the device, notifying applications of various events, • hardware state changes (e.g., an SD card was inserted), • incoming data (e.g., an SMS message arrived), • application events (e.g., your activity was launched from the device's main menu). • are asynchronous messages which allow the application to request functionality from other services or activities. An application can call directly a service or activity (explicit intent) or ask the Android system for registered services and applications for an intent (implicit intents). For example the application could ask via an intent for a contact application. Application register themself to an intent via an IntentFilter. Intents are a powerful concept as they allow to create loosely coupled applications.

  21. Intents – Explicit, Implicit • An application can call directly a service or activity (explicit intent) • An application can ask the Android system for registered services and applications for an intent (implicit intents). You willNOT understandthis YET—we havea lecture and willdo some coding LATER

  22. Intents - Example • the application could ask via an intent for a contact application. • Application register themself to an intent via an IntentFilter. • Intents are a powerful concept as they allow to create loosely coupled applications.

  23. How to create Intents • You can receive and respond to intents by • intent filters specification • intent/broadcast receivers • You can create your own intents to • launch other activities, • let you know when specific situations arise (e.g., raise an intent when the user gets within 100 meters of a specified location)

  24. Android Broadcast Receiver (Intents receiver) • receive intents sent by sendBroadcast() • two type of broadcasts • Normal broadcast • Ordered broadcast • An application can register as a broadcast receiver for certain events and can be started if such an event occurs.

  25. HOW do we making an Android App???? • Use current Development tools

  26. Development Tools • Use Android Studio • WITH Android SDK

  27. Development Tools • SDK Manager • SDK tools, platforms, and other components into packages for easy access and management • for downloading platforms, Google APIs, etc., – • AVD(Android Virtual Devices) Manager • provides a GUI in which you can create and manage AVDs, which are required by the Android • Emulator • Dalvik Debug Monitor Server

  28. Delivering your application • .apk files: compressed files class byte code resources( icons, sounds, etc). • All .apks are signed • Default development key is created by SDK. When updating an application, signature are checked.

  29. Installing an application • Basically will be putting the application’s apk on your hardware • Option 1: from Google play store or similar • Option 2: we will learn how to deploy your app directly from AndroidStudio to your hardware for testing • Option 3: to Install to local computer • (on command line –assuming in directory where apk is located) adb install whateverName.apk

  30. future • We will learn more about what all of these main components of an Android Application are slowly ---so you will understand through the creation of apps themselves. • We will begin with creating a very simple application

More Related