-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Kaluana is a component-based model built upon Android platform.
To use it, download the Eclipse project and run it on the Android emulator.
The main application must be defined on AndroidManifest.xml file, pointing the main activity to the class that represents the application, like this:
<activity android:label="@string/app_name" android:name=".PingPongApp">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
A component is represented by a Java class that offers services and receptacles. All receptacles must have an associated setter method.
A component is written like this:
@Component
public class PingComponent extends kaluana.impl.Component {
@Service
IPingService ping;
@Receptacle
IPongService pong;
public void setPong(IPongService pong) {
this.pong = pong;
}
}
Components are published using their containers interface name, that must be explicitally created on AndroidManifest.xml, associated to the component’s name, like this example:
<service android:name="kaluana.examples.pingpong.PingComponentContainer">
<intent-filter>
<action android:name="kaluana.examples.pingpong.PingComponent"></action>
</intent-filter>
</service>
Also, the main activity of the component’s package must explicitally call the method ComponentManager.registerComponent() for each package’s component.
All services may be explicitally associated to ther interface names in AndroidManifest.xml, like this:
<service android:name="kaluana.examples.pingpong.PingService">
<intent-filter>
<action android:name="kaluana.examples.pingpong.IPingService"></action>
</intent-filter>
</service>
This example can be found in package kaluana.examples.
The application now can find components by their names, connect and start them, as showed on the examples available on package kaluana.app.