Android

38
Android Natalia Turrubiartes Ramírez José Efrén Muñoz Cabrera Oscar Hernández Barboza

Transcript of Android

Page 1: Android

Android

Natalia Turrubiartes Ramírez

José Efrén Muñoz Cabrera

Oscar Hernández Barboza

Page 2: Android

What is Android?

Android is a software stack for mobile devices that includes an operating system, middleware and key applications.

The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

Page 3: Android

Features Application framework enabling reuse and

replacement of components Dalvik virtual machine optimized for mobile

devices Integrated browser based on the open

source WebKit engine Optimized graphics powered by a custom 2D

graphics library; 3D graphics based on the OpenGL ES

SQLite for structured data storage

Page 4: Android

Features

Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)

GSM Telephony Bluetooth, EDGE, 3G, and WiFi  Camera, GPS, compass, and accelerometer  Rich development environment including a

device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE

Page 5: Android
Page 6: Android

Android versions

Page 7: Android

Android ArchitectureThe components of the Android operating system are:

Page 8: Android

Android Architecture

Applications

Android will ship with a set of core applications including an email client, SMS program, calendar, maps, browser, contacts, and others. All applications are written using the Java programming language.

Page 9: Android

Android Architecture

Application Framework

Developers have full access to the same framework APIs used by the core applications. The application architecture is designed to simplify the reuse of components; any application can publish its capabilities and any other application may then make use of those capabilities.

Page 10: Android

Android Architecture

Libraries

Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework. Some of the core libraries are:

System C library, Media Libraries, Surface Manager , LibWebCore, 3D libraries , FreeType and SQLite.

Page 11: Android

Android Architecture

Android Runtime

Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently.

Page 12: Android

Android Architecture

Linux Kernel

Android relies on Linux version 2.6 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.

Page 13: Android
Page 14: Android
Page 15: Android
Page 16: Android
Page 17: Android

Activity

An activity is a single, focused thing that the user can do. Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI with setContentView(View)

While activities are often presented to the user as full-screen windows, they can also be used in other ways: as floating windows or embedded inside of another activity.

Page 18: Android

There are two methods almost all subclasses of Activity will implement:

onCreate(Bundle) is where you initialize your activity.

onPause() is where you deal with the user leaving your activity. Most importantly, any changes made by the user should at this point be committed.

Activity

Page 19: Android

Activity LifecycleActivities in the system are managed as an activity stack. When a new activity is started, it is placed on the top of the stack and becomes the running activity -- the previous activity always remains below it in the stack, and will not come to the foreground again until the new activity exits.

An activity has essentially four states:

• If an activity in the foreground of the screen (at the top of the stack), it is active or running.

Page 20: Android

Activity Lifecycle

If an activity has lost focus but is still visible (that is, a new non-full-sized or transparent activity has focus on top of your activity), it is paused.

If an activity is completely obscured by another activity, it is stopped. 

If an activity is paused or stopped, the system can drop the activity from memory by either asking it to finish, or simply killing its process. When it is displayed again to the user, it must be completely restarted and restored to its previous state.

Page 21: Android

Activity Lifecycle

The following diagram shows the important state paths of an Activity. The square rectangles represent callback methods you can implement to perform operations when the Activity moves between states. The colored ovals are major states the Activity can be in.

Page 22: Android

Activity Lifecycle

Page 23: Android

Activity Lifecycle The entire lifecycle of an activity is defined by

the following Activity methods. All of these are hooks that you can override to do appropriate work when the activity changes state.

All activities will implement onCreate(Bundle) to do their initial setup; many will also implement onPause() to commit changes to data and otherwise prepare to stop interacting with the user. You should always call up to your superclass when implementing these methods.

Page 24: Android

Activity Lifecycle

Page 25: Android

Activity Lifecycle

onCreate()

Called when the activity is first created. This is where you should do all of your normal static set up: create views, bind data to lists, etc. This method also provides you with a Bundle containing the activity's previously frozen state, if there was one. Always followed by onStart().

Page 26: Android

Activity Lifecycle

onRestart()

Called after your activity has been stopped, prior to it being started again. Always followed by onStart().

Page 27: Android

Activity Lifecycle

onStart()

Called when the activity is becoming visible to the user. Followed by onResume() if the activity comes to the foreground,or onStop() if it becomes hidden.

Page 28: Android

Activity Lifecycle

onResume()

Called when the activity will start interacting with the user. At this point your activity is at the top of the activity stack, with user input going to it. Always followed by onPause().

Page 29: Android

Activity Lifecycle

onPause()

Called when the system is about to start resuming a previous activity. This is typically used to commit unsaved changes to persistent data, stop animations and other things that may be consuming CPU, etc. Implementations of this method must be very quick because the next activity will not be resumed until this method returns. Followed by either onResume() if the activity returns back to the front, oronStop() if it becomes invisible to the user.

Page 30: Android

Activity Lifecycle

onStop()

Called when the activity is no longer visible to the user, because another activity has been resumed and is covering this one. This may happen either because a new activity is being started, an existing one is being brought in front of this one, or this one is being destroyed. Followed by either onRestart() if this activity is coming back to interact with the user, or onDestroy() if this activity is going away.

Page 31: Android

Activity Lifecycle

onDestroy()

The final call you receive before your activity is destroyed. This can happen either because the activity is finishing (someone called finish() on it, or because the system is temporarily destroying this instance of the activity to save space. You can distinguish between these two scenarios with the isFinishing() method.

Page 32: Android

Example - Hello, World

Page 33: Android
Page 34: Android

Development process for an Android app

http://developer.android.com/guide/developing/index.html

Page 35: Android

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

Page 36: Android

Advantages 

• The ability for anyone to customize the Google Android platform

• The consumer will benefit from having a wide range of mobile applications to choose from since the monopoly will be broken by Google Android

• Men will be able to customize a mobile phones using Google Android platform like never before

There are a host of advantages that Google’s Android will derive from being an open source software. Some of the advantages include:

Page 37: Android

• Features like weather details, opening screen, live RSS feeds and even the icons on the opening screen will be able to be customized

• As a result of many mobile phones carrying Google Android, companies will come up with such innovative products like the location

• In addition the entertainment functionalities will be taken a notch higher by Google Android being able to offer online real time multiplayer games

Advantages 

Page 38: Android

References

http://developer.android.com/index.html

10 Types of Devices That Android Is Making Better http://www.androidauthority.com/android-everywhere-10-types-of-devices-that-android-is-making-better-57012/