You will need to find out the package name and then ask if it's installed or not on the device, for the intents, you can get them by checking the unfiltered logs.
thanks, I know the package name , how do I check the intent extras, the log show:
04-09 15:10:39.373 I/ActivityManager( 1324): Starting: Intent { act=com.amazon.mp3.action.EXTERNAL_EVENT cmp=com.amazon.mp3/.activity.IntentProxyActivity (has extras) } from pid 8285
and no more data , never the extra (unless the app log it itself) right ?
Dim i As Intent
i.Initialize("", "")
i.SetComponent("com.amazon.mp3.activity.IntentProxyActivity")
i.Action = "com.amazon.mp3.action.EXTERNAL_EVENT"
i.PutExtra("com.amazon.mp3.extra.EXTERNAL_EVENT_TYPE", "com.amazon.mp3.type.SEARCH")
i.putExtra("com.amazon.mp3.extra.SEARCH_TYPE", 1) '0 = Song, 1 = album
i.PutExtra("com.amazon.mp3.extra.SEARCH_STRING", "The Beatles")
StartActivity(i)
Sometimes the Amazon app is a little slow to pick up the results, but I see the query in the search box and also the results. I'm using the exact same code I posted.
NJDude, thanks, it is working now, all I had to do is resent my phone, which is strange cause I have not seen any error in the logs (unfiltered) I would expect some kind of error if the activity manager failed to run the amazonmp3 app,
I need to play with it more to see if this is stable or not.
According to Android documentation it should throw a NameNotFoundException. Seems like it behaves differently.
You can use this code:
B4X:
Sub CheckPackage(p As String) As Boolean
Try
Dim pm As PackageManager
Dim i As Intent = pm.GetApplicationIntent(p)
Return i.IsInitialized
Catch
Return False
End Try
End Sub