Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Link to Market from inside another app

I am building many apps for Android and wish to have a menu button in the apps that basically opens a list of my other apps in the Android Market.

Is there a way to create an intent and have the Android market pop up with a search (of my company) in the market so users can buy other apps?

ian

like image 693
Ian Vink Avatar asked Aug 09 '10 17:08

Ian Vink


People also ask

How do I redirect to another app?

You need to raise a intent, try like this: Uri mUri = Uri. parse("market://details?id=" + packageName); Intent mIntent = new Intent(Intent. ACTION_VIEW, mUri); startActivity(marketIntent);

How do I communicate between two apps on Android?

Android inter-process communication At the simplest level, there are two different ways for apps to interact on Android: via intents, passing data from one application to another; and through services, where one application provides functionality for others to use.

Can an Android app open another app?

To take the user from one activity to another, your app must use an Intent to define your app's "intent" to do something. When you pass an Intent to the system with a method such as startActivity() , the system uses the Intent to identify and start the appropriate app component.


2 Answers

Even better to use "market://details" instead of "market://search":

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.android.example"));
startActivity(intent);

Then it opens directly the details page of the app. With search it shows a single search result and the user has to do an additional click to get to the detail page.

like image 117
uwe Avatar answered Oct 20 '22 18:10

uwe


Yes, there is a documented Intent syntax for that (http://market.android.com/search?q=pub:<Developer Name> or market://search?q=pub:<Developer Name>).

like image 37
CommonsWare Avatar answered Oct 20 '22 17:10

CommonsWare