How Android apps automatically jump to the application Market details page _android

Source: Internet
Author: User
Tags pack

Objective

It is well known that in the development of Android applications, there may be demand, such as: when the promotion to the application market to download applications, jump to the application market to their own application scoring, jump to the application of the market to update their own applications.

So how do you jump to the application market?

The possible way to jump is everyone knows, the method is as follows:

public static void Gotomarket (context context, String PackageName) {
  uri uri = uri.parse ("market://details?id=" + pack Agename);
  Intent gotomarket = new Intent (Intent.action_view, URI);
  try {
    context.startactivity (gotomarket);
  } catch (Activitynotfoundexception e) {
    e.printstacktrace ();
  }
}

This method supports the application of Bao, 360 mobile phone assistants, pea pods, millet shops and other mainstream application market, when the mobile phone has more than one application market, the pop-up menu allows users to choose which market to switch to. So, the question is, if this is the end, how can there be this article?

On the red meter Note2 found that the call this method by default is directly to the millet market, that if the millet mobile phone, want to jump to the application of Bao or other application of the market how to do it, the method is naturally some, as follows:

public static void Gotomarket (context context, String PackageName) {
  uri uri = uri.parse ("market://details?id=" + pack Agename);
  Intent gotomarket = new Intent (Intent.action_view, URI);
  try {
    gotomarket.setclassname ("Com.tencent.android.qqdownloader", "com.tencent.pangu.link.LinkProxyActivity") );
    Context.startactivity (Gotomarket);
  } catch (Activitynotfoundexception e) {
    e.printstacktrace ();
  }
}

Looks like the first method is no different, yes, only need to call the goToMarket.setClassName() method, set the specified application to deal with this intent event, so you can jump on the millet mobile phone application Treasure Application Details page, and, the last method if the mobile phone with multiple application market, Pop-up menu allows users to choose, if you have determined to jump to which application market, you can also use this method, direct jump, omit the middle user to select the link.

But the idea of the above approach does not seem to be effective for all application markets, which day the product manager proposed to jump to Samsung's application market, after all, Samsung mobile phone in the domestic market share or a few, and then use the above method, found that Meng force, Samsung Market unexpectedly does not support this way, no wonder Samsung mobile phone in the domestic markets are losing.

However, the author's efforts to finally find the following methods:

public static void Gotosamsungappsmarket (context context, String PackageName) {
  uri uri = Uri.parse ("http:// Www.samsungapps.com/appquery/appDetail.as?appId= "+ packagename);
  Intent gotomarket = new Intent ();
  Gotomarket.setclassname ("Com.sec.android.app.samsungapps", "Com.sec.android.app.samsungapps.Main");
  Gotomarket.setdata (URI);
  try {
    context.startactivity (gotomarket);
  } catch (Activitynotfoundexception e) {
    e.printstacktrace ();
  }
}

However, later found in the music video on the phone, the application of the market is also not supported by the goToMarket() method, so also specialized research on the jump music as the application of the market method, the following methods:

void Gotoletvstoredetail (Context context, String PackageName) {
    Intent Intent = new Intent ();
    Intent.setclassname ("Com.letv.app.appstore", "com.letv.app.appstore.appmodule.details.DetailsActivity");
    Intent.setaction ("com.letv.app.appstore.appdetailactivity");
    Intent.putextra ("PackageName", PackageName);
    Context.startactivity (intent);
  }

Summarize

Well, that's all the content of this article. The above methods hope to help people in need. If you have any questions, you can exchange messages.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.