1 / 15

Android and Project Structure

Android and Project Structure. Android. Android OS Built on Linux Kernel Phones Netbooks Readers Other???. Android. Dessert anyone? Android 1.X 1.5 – Cupcake (first stable/robust version) 1.6 – Donut (first ‘updatable’ version) Android 2.X 2.0 and 2.1 – Éclair

caia
Download Presentation

Android and Project Structure

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 and Project Structure

  2. Android • Android OS • Built on Linux Kernel • Phones • Netbooks • Readers • Other???

  3. Android • Dessert anyone? • Android 1.X • 1.5 – Cupcake (first stable/robust version) • 1.6 – Donut (first ‘updatable’ version) • Android 2.X • 2.0 and 2.1 – Éclair • Android 2.2 – Froyo • Android 2.3 – Gingerbread • Android 3.X - Honeycomb • Android 4.X • 4.0 – Ice Cream Sandwich • 4.1, 4.2, and 4.3 – Jelly Bean

  4. Android • Versioning • Higher version addressed many issues • Better audio/video • Better sensing • Use of GPS • Multiple profiles per device • Other

  5. Android • Android SDK (http://developer.android.com) • Windows, Linux, Mac • Utilizes the Java language • Different Libraries • Well-documented • http://developer.android.com/reference/packages.html • Freely downloaded

  6. Android • Dalvik Virtual Machine • Android’s equivalent of JVM • Optimized for low memory-management • Written by Dan Bornstein (named after a village where relatives lived) • AVD • Android Virtual Device • Phone Emulation • Communication between Android and AVD/phone • ADB (Android Debug Bridge) • Allows access and control over emulators • listing devices, installing applications, copy files to SD card, etc. • DDMS (Dalvik Debug Monitor Service) • Communications with ADB to provide control • Telephony • Location • Other

  7. Building Blocks of an Application • Activities • User interface screen • Each application can have multiple activities • Layout defined in .xml file • Functionality defined in .java file • Intents • Intention to perform a task • Explicitly stated in code • Launch an activity • Display a webpage • Broadcast a notification

  8. Building Blocks of an Application • Services • Task that runs in the background • Music Player • RSS reader that updates an activity when a site is updated • Content Providers • Bundles data so it can be shared among multiple applications

  9. Building Blocks of an Application • Resources • Images • Audio files • Constants • Stored in ‘res’ directory • Permissions • Must explicitly ask permission to perform tasks • Access web • Access GPS • Access Contacts

  10. Project identification • When creating a new project, the following must be provided • Project name • Displayed in Eclipse to differentiate projects • Application name • Activity name • The first screen displayed when the application is launched • Package name • edu.csci153.name

  11. Project components • Automatically created • AndroidManifest.xml • Referenced libraries • Important directories • gen (generated) • res (resources) • src (source)

  12. Project components • AndroidManifest.xml • Global settings • Permissions • Activities • Intents • Referenced libraries • android.jar – standard Android library • can add other user-defined libraries

  13. Project components • gen directory • Contains R.java • Automatically generated file • Contains pointers to: • widgets • files • folders • Never modified by programmer

  14. Project components • res directory • All file names within this folder (or subfolders) must be lowercase • Contains other folders • drawable • Contains image files • layout • Contains .xml layout files • Usually one for each activity • layout-land folder must be created for landscape-specific views • values • Contains string pointers that can be used throughout the code

  15. Project components • src directory • Contains the java source code • One .java file for each activity • .java file for source code and the corresponding .xml file for layout often have the same name

More Related