An about dialog that is shared between apps.
OI About is based on the GtkAboutDialog and for the bigger part has the same fields and layout.
As an app developer you use it in the following way, in short:
- The user that installs your app also installs OI About or already has it because he installed it before (for another app).
- From your "about" menu option you start an activity with this specific intent action.
Intent intent = new Intent("org.openintents.action.SHOW_ABOUT_DIALOG");
The activity needs to be launched "forResult" with requestCode>=0 so that the package name is passed properly. Optionally, one can set the intent extra
The data to be displayed in the About dialog, specific to your app, like app name, app version, license, logo, ... are retrieved from your application's Manifest meta-data.
Optionally they can be specified using intent extras.
And that's it really! No (real) need to import a lib into your project or anything. One shared application that handles all the "abouts" for apps, with a rather simple (and expandable) intent interface.
- TestAboutApp: Source code for a small demo program that demonstrates OI About.
- OI About (AboutApp): Source code for OI About.
To code by example (recommended): OI About is a meta-example since it has a meta-about dialog about itself (and all the code to go with it). From About.java copy showAboutDialog() to your main activity. You can also copy some of the onCreateOptionsMenu(), OnOptionsItemSelected(), ... if you like. Then copy the first section of the Manifest. The Manifest has dependencies on some strings, arrays and other resources. You can either make OI About a dependency of your java project (so the constants hold), or you can replace the constants with the key/action strings themselves. You can copy the necessary elements from strings.xml, arrays.xml and other resources to your project and adapt them so they represent the information concerning your application. Also copy the ic_menu_info_details.png icon for any buttons/menus you create, or use android.R.drawable.ic_menu_info_details, and fix the imports of course. Not too hard, right?