Game Development Reference
In-Depth Information
Services : These are processes that work in the background and don't have a
visible UI. For example, a service might be responsible for polling a mail server
for new e-mails.
Content providers : These components make parts of your application data
available to other applications.
Intents : These are messages created by the system or applications themselves.
They are then passed on to any interested party. Intents might notify us of
system events such as the SD card being removed or the USB cable being
connected. Intents are also used by the system for starting components of our
application, such as activities. We can also fire our own intents to ask other
applications to perform an action, such as opening a photo gallery to display an
image or starting the Camera application to take a photo.
Broadcast receivers : These react to specific intents, and they might execute
an action, such as starting a specific activity or sending out another intent to
the system.
An Android application has no single point of entry, as we are used to having on a desktop
operating system (for example, in the form of Java's main() method). Instead, components of an
Android application are started up or asked to perform a certain action by specific intents.
What components comprise our application and to which intents these components react are
defined in the application's manifest file. The Android system uses this manifest file to get to
know what makes up our application, such as the default activity to display when the application
is started.
Note We are only concerned about activities in this topic, so we'll only discuss the relevant portions
of the manifest file for this type of component. If you want to make yourself dizzy, you can learn more
about the manifest file on the Android Developers site ( http://developer.android.com ) .
The manifest file serves many more purposes than just defining an application's components.
The following list summarizes the relevant parts of a manifest file in the context of game
development:
ï?®
The version of our application as displayed and used on Google Play
ï?®
The Android versions on which our application can run
ï?®
Hardware profiles our application requires (that is, multitouch, specific
screen resolutions, or support for OpenGL ES 2.0)
ï?®
Permissions for using specific components, such as for writing to the SD
card or accessing the networking stack
In the following subsections we will create a template manifest file that we can reuse, in a slightly
modified manner, in all the projects we'll develop throughout this topic. For this, we'll go through
all the relevant XML tags that we need to define our application.
 
Search WWH ::




Custom Search