1 / 27

Android Overview

Android Overview. 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.

cshawver
Download Presentation

Android Overview

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 Overview

  2. 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

  3. Mobile Devices: Advantages • Always with the user • Typically have Internet access • Typically GPS enabled • Most have cameras & microphones • Many apps are free or low-cost

  4. Mobile Devices: Disadvantages • Limited screen size • Limited battery life • Limited processor speed • Limited and sometimes slow network access • Limited input: phone keypad, touch screen, stylus etc • Limited web browser functionality • Range of platforms & configurations across devices

  5. Why Mobile App Development? Why Android? • Transferring app to phone is trivial • Can distribute by putting it on the web • Android Market (now Google Play) for wider distribution

  6. What is Google 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

  7. Android Apps • Built using Java and new SDK libraries • No support for some Java libraries like Swing & AWT • Java code compiled into Dalvik byte code (.dex) • Optimized for mobile devices (better memory management, battery utilization, etc.) • Dalvik VM runs .dex files

  8. Applications • Written in Java (it’s possible to write native code) • Good separation (and corresponding security) from other applications: • Each application runs in its own process • Each process has its own separate VM • Each application is assigned a unique Linux user ID – by default files of that application are only visible to that application

  9. Android Architecture

  10. Activity Manager – Life Cycle / Navigation within and among applications • Content Provider – encapsulate data • Location Manager – aware of its physical location • Notification Manager – users informed about events • Package Manager – infn. about other appln. Pkgs • Resource Manager – lets appln accesses its resources

  11. Telephony Manager – to learn about device telephony services • View System – manages UI elements / events • Window Manager – perform Window related operations

  12. Free Type: for bitmap and vector font rendering • Libc : standard C System library • Mediaframework: supports many audio & Video formats / image files / playback & recording • OpenGL/ES: for 3D graphics libraries • SGL: 2D graphics engine – scalable graphics lib • SQLite: provides lightweight RDB engine • SSL: SSL based security for NW communication • Surface Manager: manages accesses to the display subsystem – 2D & 3D graphics layers

  13. Application Components • Activities – visual user interface focused on a single thing a user can do (presents UI) • Services – no visual interface – they run in the background User selects a song through an activity and a separate service is started • Broadcast Receivers – receive and react to broadcast announcements Battery life / timezone changed etc • Content Providers – allow data exchange between applications

  14. Activities • Basic component of most applications • Most applications have several activities that start each other as needed • Each is implemented as a subclass of the base Activity class

  15. Activities – The View • Each activity has a default window to draw in • The content of the window is a view or a group of views (derived from View or ViewGroup) • Example of views: buttons, text fields, scroll bars, menu items, check boxes, etc. • View(Group) made visible via Activity.setContentView() method.

  16. Services • Does not have a visual interface • Runs in the background indefinitely • Examples • Network Downloads • Playing Music • TCP/UDP Server • You can bind to an existing service and control its operation

  17. Broadcast Receivers • Receive and react to broadcast announcements • Extend the class BroadcastReceiver • Examples of broadcasts: • Low battery, power connected, shutdown, timezone changed, etc. • Other applications can initiate broadcasts

  18. Content Providers • Makes some of the application data available to other applications • It’s the only way to transfer data between applications in Android (no shared files, shared memory, pipes, etc.) • Extends the class ContentProvider; • Other applications use a ContentResolver object to access the data provided via a ContentProvider

  19. Intents • An intent is an Intent object with a message content. • Describe operations – send an email • Activities, services and broadcast receivers are started by intents. ContentProviders are started by ContentResolvers: • An activity is started by Context.startActivity(Intent intent) or Activity.startActivityForResult(Intent intent, int RequestCode) • A service is started by Context.startService(Intent service) • An application can initiate a broadcast by using an Intent in any of Context.sendBroadcast(Intent intent), Context.sendOrderedBroadcast(), and Context.sendStickyBroadcast()

  20. Android Manifest • Its main purpose in life is to declare the components to the system: <?xml version="1.0" encoding="utf-8"?><manifest . . . >    <application . . . >        <activity android:name="com.example.project.FreneticActivity"                  android:icon="@drawable/small_pic.png"                  android:label="@string/freneticLabel"                   . . .  >        </activity>        . . .    </application></manifest>

  21. Building and running • 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. Compiled resources (xml files) Android Debug Bridge

  22. Components

  23. Java This contains the .java source files for your project. By default, it includes an MainActivity.java source file having an activity class res/drawable-hdpi This is a directory for drawable objects that are designed for high-density screens res/layout This is a directory for files that define your app's user interface res/values This is a directory for other various XML files that contain a collection of resources, such as strings and colours definitions. AndroidManifest.xml This is the manifest file which describes the fundamental characteristics of the app and defines each of its components.

  24. MyProject/ app/ manifest/ AndroidManifest.xml java/ MyActivity.java res/ drawable/ icon.png layout/ activity_main.xml info.xml values/ strings.xml

More Related