Application Fundamentals

Quickview

  • Mindroid applications are composed of one or more services
  • Each service performs a different role in the overall application behavior, and each one can be activated individually by other services
  • The manifest file must declare all services in the application and should also declare all application requirements

In this document

  1. Application Components
    1. Activating components
  2. The Manifest File
    1. Declaring components

Mindroid applications are written in the Java programming language using the Java language specification v1.4.

The Mindroid SDK tools compile the code into an Mindroid package, an archive file with an .jar suffix. All the code in a single .jar file is considered to be one application and is the file that Mindroid use to install the application.

Application Components

Application components are the essential building blocks of an Mindorid application.

There is currenlty only one type of application component, the service.

Services
A service is a component that runs in the background to perform long-running operations or to perform work for remote lightweight processes.

A service is implemented as a subclass of Service and you can learn more about it in the Services developer guide.

Activating Components

Services are activated by an asynchronous message called an intent. Intents bind individual components to each other at runtime (you can think of them as the messengers that request an action from other components), whether the component belongs to your application or another.

An intent is created with an Intent object, which defines a message to activate a specific component.

There are separate methods for activating a service:

For more information about using intents, see the Intents document. More information about activating specific servies is also provided in the following document: Services.

The Manifest File

Before the Mindroid system can start an application component, the system must know that the component exists by reading the application's MindroidManifest.xml file (the "manifest" file). Your application must declare all its components in this file, which must be at the root of the application project directory.

Declaring components

The primary task of the manifest is to inform the system about the application's components. For example, a manifest file can declare a service as follows:

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application ... >
        <service mindroid:name="com.example.project.ExampleService"
                 mindroid:autostart="true" ... >
        </service>
        ...
    </application>
</manifest>

You must declare all application components this way:

Servies that you include in your source but do not declare in the manifest are not visible to the system and, consequently, can never run.

For more about how to structure the manifest file for your application, see the The MindroidManifest.xml File documentation.