Escolar Documentos
Profissional Documentos
Cultura Documentos
release of the Android alpha in November 5, 2007. The first commercial version,
Android 1.0, was released in September 2008. Android is continually developed
by Google and the Open Handset Alliance, and it has seen a number of updates to
its base operating system since the initial release.
Android provides a rich application framework that allows you to build innovative
apps and games for mobile devices in a Java language environment.
API (Application Program Interface) - is a set of routines, protocols, and tools for
building software applications. An API specifies how software components should
interact. Additionally, APIs are used when programming graphical user interface
(GUI) components.
Android 15 ICE_CREAM_SANDWICH_MR1
4.0.3, 4.0.4
Android 10 GINGERBREAD_MR1
2.3.4
Android
2.3.3
Android 9 GINGERBREAD
2.3.2
Android
2.3.1
Android 2.3
Android 6 ECLAIR_0_1
2.0.1
Android 2.0 5 ECLAIR
The Activity class defines the following call backs i.e. events. You don't need to
implement all the callbacks methods. However, it's important that you
understand each one and implement those that ensure your app behaves the way
users expect.
Callback & Description
onCreate() - This is the first callback and called when the activity is first created.
onStart() - This callback is called when the activity becomes visible to the user.
onResume() - This is called when the user starts interacting with the application.
onPause() - The paused activity does not receive user input and cannot execute
any code and called when the current activity is being paused and the previous
activity is being resumed.
onStop() - This callback is called when the activity is no longer visible.
onDestroy() - This callback is called before the activity is destroyed by the
system.
onRestart() - This callback is called when the activity restarts after stopping it.
Event Listeners
An event listener is an interface in the View class that contains a single callback
method. These methods will be called by the Android framework when the View
to which the listener has been registered is triggered by user interaction with the
item in the UI.
Event Listener & Description
OnClickListener() - This is called when the user either clicks or touches or focuses
upon any widget like button, text, image etc. You will use onClick() event handler
to handle such event.
AdapterView.OnItemClickListener() - Interface definition for a callback to be
invoked when an item in this AdapterView has been clicked.
Parameters
o Parent - AdapterView: The AdapterView where the click happened.
o View - View: The view within the AdapterView that was clicked (this
will be a view provided by the adapter)
o Position - int: The position of the view in the adapter.
o Id - long: The row id of the item that was clicked.
AdapterView.OnItemSelectedListener() - Callback method to be invoked when an
item in this view has been selected. This callback is invoked only when the newly
selected position is different from the previously selected position or if there was
no selected item.
Parameters
o Parent - AdapterView: The AdapterView where the click happened.
o View - View: The view within the AdapterView that was clicked (this
will be a view provided by the adapter)
o Position - int: The position of the view in the adapter.
o Id - long: The row id of the item that was clicked.