I know I have seen a way of calling an Intent, and if it doesn't exist the function will redirect to market for download the application that has the intent.
Right now I check if the Intent exists but I don't know how to point the user to the resource to download.
Thanks in advance
An Intent is a messaging object you can use to request an action from another app component. Although intents facilitate communication between components in several ways, there are three fundamental use cases: Starting an activity. An Activity represents a single screen in an app.
Swipe up from the bottom of your screen to the top. If you get All Apps , tap it. Tap the app that you want to open.
Using intents, you can adjust your app's user experience or ask other apps to perform common actions: taking photos, sending emails and SMS messages, and even displaying locations on maps and playing media. This course teaches you all you need to know to take advantage of this core piece of Android functionality.
When you construct an intent, you must specify the action you want the intent to perform. Android uses the action ACTION_SEND to send data from one activity to another, even across process boundaries. You need to specify the data and its type.
To check if some Intent is available:
String intentToCheck = "com.google.SCAN"; //can be any other intent
final PackageManager packageManager = getPackageManager();
final Intent intent = new Intent(intentToCheck);
List list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
final boolean isAvailable = list.size() > 0;
To open Google Market via Intent:
Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:com.google.scan"));
startActivity(marketIntent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With