Durv's Blog

My Mobile, Web & Game Design Blog

Chapter 02. Android App Fundamentals

Android App Fundamentals

Overview

Android Architecture

  • Runs on top of Linux 2.6
  • Dalvik virtual machine optimized for mobile devices
  • Integrated browser based on WebKit engine
  • Optimized Graphics with OpenGL ES
  • SQLite database for structured data Storage

Android Versions

Application Fundamentals

  • Applications are written in the Java programming language
  • Compiled into and Android package (.apk)
  • Each application runs on its own sandbox and Linux process
  • Applications consists of components, a manifest file
  • and resources

Components:

  • Activities
  • Services
  • Concept Providers
  • Broadcast Receivers

Activities

  • An activity represents a single screen with user interface
  • Most applications have multiple activities
  • When a new activity starts, it is pushed onto the back stack
  • User interface can be built on XML or in Java
  • Monitor lifespan through callback methods like onStart(), onPause(), etc

Services

  • Services perform long-running operations in the background
  • Does not contain a user interface
  • Useful for things like network operations, playing music, etc
  • Runs independently of the component that created it
  • Can be bound to by other applications, if allowed

Content Providers

  • Used to store and retrieve data and make it accessible to all applications
  • Are the only way to share data across applications
  • Exposes a public URI that uniquely identifies its data set
  • Data is exposed as simple table on a database model
  • Android Contains many providers for this like contacts, media, etc

Broadcast Receivers

  • A component that responds to system-wide broadcast announcements
  • Examples include when the screen is off, the battery is low, etc
  • Applications can also initiate their own broadcasts
  • Broadcast receivers contain no user interface
  • They can create status bar notifications to alert the user

Android Manifest file

  • Applications must have an AndroidManifest.xml file in its roots directory
  • Presents information about the application to the Android system
  • Describes the components used in the application
  • Declares the permissions required to run the application
  • Declares the minimum Android API level that the application requires

Project Structure

  • Project Name
  • Select Android minimum API level
  • Application Name
  • Package Name
  • Create Activity

Application Manifest

  • Manifest
  • Application
  • Permissions
  • Instrumentation
  • AndroidManifest.xml File

Activities

Explicit Intents

Implicit Intents

Resources

Permission

Debugging

Leave a comment

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 2 other subscribers
May 2024
S M T W T F S
 1234
567891011
12131415161718
19202122232425
262728293031