Starting the Amazon Appstore app

cbanks

Active Member
Licensed User
Longtime User
What is the code to run the Amazon Appstore app from within my app? I've seen the following code to start the Android Market app:

Dim fURI As String
fURI = "market://details?id=com.app.ldsscriptures"
Dim Market As Intent
Market.Initialize(Market.ACTION_VIEW,fURI)
StartActivity (Market)
 

NJDude

Expert
Licensed User
Longtime User
Like this: (need the Phone library)
B4X:
Dim pm As PackageManager
Dim in As Intent 
   
in = pm.GetApplicationIntent("com.amazon.mShop.android")

If in.IsInitialized Then 
            
   StartActivity(in)
                     
Else
            
   Msgbox("App not installed", "")
                     
End If
 
Upvote 0

Jack Cole

Well-Known Member
Licensed User
Longtime User
Here is how I do it.

In process globals set the market (either Google or Amazon).

B4X:
        Dim marketplace As String
   marketplace="Amazon" 'use Amazon for Amazon, Google for Google
   'marketplace="Google"

Replace [packagename] below with the name of the package you want to load.

B4X:
Sub MarketBtn_Click
   Dim market As Intent
   Select widgetservice.marketplace
      Case "Amazon" : market.Initialize(market.ACTION_VIEW,"http://www.amazon.com/gp/mas/dl/android?p=[packagename]")
      Case "Google" : market.Initialize(market.ACTION_VIEW,"market://details?id=[packagename]") 'for android market
   End Select   
   StartActivity(market)   
End Sub

To display all your apps use the following. Replace [packagename] with your package name for Amazon below and replace [publisher name] with the name you set up for Google.

B4X:
Sub More_Click
   Dim market As Intent
   Select marketplace
      Case "Amazon" : uri="http://www.amazon.com/gp/mas/dl/android?p=[packagename]&showAll=1"
      Case "Google" : uri="market://search?q=pub:[publisher name]" 
   End Select
   market.Initialize(market.ACTION_VIEW,uri)
   StartActivity(market)   
End Sub
 
Upvote 0
Top