Creating home plugins You know how to write small pieces of code, and you want to extend the Appsi home screen with something you'd like to have in there?
You are in luck today!
All new are home screen plugins. The home screen is a new page in Appsi that you can use to add something you like. Examples are custom toggle buttons, custom buttons that start or open something specific, missed call count, unread message count or your own profile photo. You could also create a weather plugin, upcoming appointment plugin, or anything that fits in one of the defined fields. And in case you ask nicely, I might also add a field of the type you'd like to use.
Appsi and the plugins include a few as well, and an example project is available on github. You can download the Home Plugins sample project from Google play to test it yourself. For the most up to date information, always refer to the Github project.
How hard is it?All you need is a jar file with the service you'll need to extend (right here). You'll need to declare this service in the AndroidManifest.xml of your project and set the proper intent filter. That's all!
Show me the codeYou can dive into the code right here. Here's some highlights of the code.
These are the two key functions to implement. The first call, updateBundleForField, is called when Appsi wants new values for a field. All you need to do is fill the bundle with the proper values. There are five types of fields:
You use these to register your plugin in Appsi. It gives Appsi some basic information and tells it it's dependencies. Then when the method updateBundleForFields is called, you need to use the builder to update the field values. These values include:
For a full overview see checkout the sample project on Github. By Nick Martens |