Writing an application that is intended to use the QuickPost interface, it is elementary to determine that Historify is installed and the Bridge is enabled on the user’s device. If Historify is not present in the current environment, it is unnecessary to call the QuickPost function or even display the UI elements used for QuickPosting. To make it easier for app developers, the new function canQuickPost() has been added to the client library. What it does, is a simple API call to determine that there is a Service able to handle the QUICK_POST Intent:
Intent intent = new Intent();
intent.setAction(Actions.ACTION_QUICK_POST);
List<ResolveInfo> info = context.getPackageManager().queryIntentServices(intent, PackageManager.MATCH_DEFAULT_ONLY);
intent.setAction(Actions.ACTION_QUICK_POST);
List<ResolveInfo> info = context.getPackageManager().queryIntentServices(intent, PackageManager.MATCH_DEFAULT_ONLY);
LendMe showcases how to use this new function to find out that QuickPosting is possible. The application is able to change its functionality and to show/hide UI elements accordingly.
No comments:
Post a Comment