Apache Felix is a cool OSGi implementation, and has been widely used in Java applications. To use Felix in Android applications, embedding Felix into Android can help you harness the component based development with ease.
Here is how to achieve this.
- Create an Android Project in Eclipse, with an empty activity called MainActivity
- In MainActivity.Java, add code launchFelix(); in the onCreate() function
Add function body for launchFelix() function
Here a LogEx is a function which not only shows the log in Eclipse, but also display info in a TextView:
To run this Android app, remember to add Felix.jar in the project:
Copy felix.jar from felix\bin –> \libs folder of the project.
Run the Android App, success!