The following are some common redirection scenarios for your reference.
Redirecting to the AppGallery Home Page
Use the action method from Intent to implement the function.
action: com.huawei.appmarket.intent.action.MainA
Example:
public void launchAGHomePage() {
Intent intent = new Intent("com.huawei.appmarket.intent.action.MainActivity");
startActivity(intent);
}
Redirecting to an App's Details Page on AppGallery
Use the action method from Intent to implement the function.
Method 1: by app ID
action:com.huawei.appmarket.appmarket.intent.action.AppDetail. withid
setPackage("com.huawei.appmarket");
name: "appId", value: "C100170981"
Method 2: by package name
action: com.huawei.appmarket.intent.action.AppDetail
setPackage("com.huawei.appmarket");
name: "APP_PACKAGENAME", value: "com.huawei.browser"
Note: Compared with method 2, method 1 includes additional appmarket and withid parameters from the action method.
- Launching All App Stores Installed on a Device to Redirect Users to an App's Details Page in an App Store via MARKET
Pass the link whose scheme is market://. Android supports the standard MARKET protocol, to ensure that all app stores can be launched on Android devices. The methods are as follows:
Method 1: market://details?id=pkgName // for all stores
Method 2: appmarket://details?id=pkgName // only for AppGallery
Method 3: market://com.huawei.appmarket.applink?appId=App ID" // only for AppGallery
Note: Method 1 is a standard method for Android devices, and is applicable to all app stores, such as Google Play and Tecent Appstore.
For more detail,pls kindly check this link.