Friday 31st May, 2013
3:30pm to 4:45pm
Android developers often lament the inability for Android to natively discover and launch application extensions via plug-ins. The native Java ServiceLoader class is now included in the Android SDK, but it isn’t nearly as effective as it is under Java Standard Edition. Java class-loader solutions often introduce more problems than they solve, and in practice, Android’s class-loader separation ensures that object instances created in one Activity or Service aren’t visible inside of another Activity or Service.
All is not lost, however. Android provides all the requisite pieces for truly powerful plug-in architectures: Intents, Services and Content Providers. The Content Provider fulfills the role of the plug-in registrar. Services, even when deployed in separate applications, represent the plug-ins available for discovery. Finally, the Intents provide the inter-process communication mechanism that lets all of these disparate pieces work together.
You will leave the class with an understanding and sample code that demonstrates how to create a simple Content Provider implementation that serves as a plug-in registrar. Techniques for declaratively classifying different types of plug-ins (services) and dynamically registering new plug-ins will also be covered in-depth. Application and service metadata discovery using the Android PackageManager class will also be covered. The class will wrap up with a mini-primer on the Android IBinder interface specifically in the context of cross-process method invocations.
You are encouraged to have a primitive understanding of how Android Intents are used. No prior experience with either Services or Content Providers is assumed.
Sign in to add slides, notes or videos to this session