Thanks NJ.
The example you indicated gives a good idea what needs to be done however I am unsure how to get it right using the reflection-library:
I changed it slightly to fit my needs :
Sub Activity_Create(FirstTime As Boolean)
Dim in As Intent
In.Initialize(In.ACTION_VIEW, "http://www.pocketjourney.com/downloads/pj/video/famous.3gp")
In.SetType("video/*")
Log(FindDefaultApp(in))
End Sub
Sub FindDefaultApp(In As Intent) As String
Dim r As Reflector
r.Target = r.GetContext
Dim pm As Object
pm = r.RunMethod("getPackageManager")
r.Target = pm
Dim mInfo As Object
mInfo = r.RunMethod4("resolveActivity", Array As Object(In, 0), _
Array As String("android.content.Intent", "java.lang.int"))
If mInfo = Null Then Return "" 'no activity found
r.Target = mInfo
r.Target = r.GetField("activityInfo")
r.Target = r.GetField("applicationInfo")
Return r.GetField("packageName")
End Sub
but all it returns is the word "Android"
I tried it using the example in the other post i.e.
Dim in As Intent
in.Initialize(in.ACTION_VIEW, "http://www.google.com")
Log(FindDefaultApp(in))
and expected to get various browsers such as as Chrome and others but it only returned one (default). Reading the documentation, it seems like
resolveActivity only returns the default app in case of multiple choices. Therefore I am unsure if said code will work for me since I need to get all package-names of compatible apps.
It should be said that I don't know much about the inner workings of intents and so forth so I might be wrong.
:sign0163: