|Tools for Mobile Linux|
|TmL Web Site|
|Regular Phone Meetings|
The TmL Device Framework
Purpose and Target audience
This tutorial provides an introduction to the main concepts related to the TmL Device Framework.
The target audience is anyone who wants to know more about the TmL Device Framework and/or wishes to use it.
The TmL Device Framework is a critical piece of the TmL development environment. It is responsible for providing an extensible platform to support mobile devices and their aggregate services. Therefore, the main purpose of the TmL Device Framework is to integrate devices and emulators on the IDE.
The main concepts that will be presented in this tutorial are the following:
- Device handler
- Mobile Device
- Service handler
- State Machine
The device handler is a class which instantiates the device in the TmL framework. Click [here] for the handler class template.
The Device Framework defines a set of actions called services and associates them to the device. To understand this, first you need to know what is a 'state' and how it relates to a service.
A state represents the status of a device, such as "started", "idle" and "stopped". To change from state to state, you need to define a service. Therefore, a service represents the transition between a pair of states. The same service can be used by more than one transition.
Regarding the implementation, a service is implemented as a plug-in. A service also provides implementations that are either general enough, such as the VNC Connection service, or that must be extended by specific plugins, like the Start Emulator service.
A mobile device represents an abstract description of a real device or a device emulator. It must be implemented as a plug-in that extends the device extension point defined by the Device Framework. The device object typically contains binary executables that emulate the mobile device or a collection of scripts that manage the connection between the host computer and the mobile device itself.
Before using a mobile device, you need to create an instance of it. Several instances of the same device must be created as long as they have non-conflicting properties. For instance, they must have different network addresses.
Every mobile device must support a set of services. This set is what defines the state machine that rules your mobile device.
The service handler contains the operations that must be performed on the device so that it performs the service itself. It is defined as a method in a class. [TBD:: Instructions on how to compose this class]
As mentioned earlier, a service connects a pair of states. A set of states and their respective transitions (represented as services) is what we call a state machine.
Therefore, the state machine defines basically how your mobile device works. It shows not only the possible states the mobile device can achieve, but also if such achievement has any prerequisites. So, a good way to think of the state machine is as a diagram where the states are represented as vertices and the services are directed edges. An edge pointing from one state to another means that the mobile device needs to be in the first state before changing to the second state, that is, the service represented in this transition requires the first state to be executed.