Calling up external apps

Monkey Targets Forums/Android/Calling up external apps

Leon Brown(Posted 2012) [#1]
Has anyone ever used Monkey to call up external apps? I'd like to write a menu type app that allows the user to select other apps that are installed. There would be no need for other OS features - just to load specific programs from the list.


golomp(Posted 2012) [#2]
You can create a folder with a long press finger
and put inside all apps you want to launch.


Leon Brown(Posted 2012) [#3]
Thanks for the tip, but I mean via Monkey code ;-).


AdamRedwoods(Posted 2012) [#4]
You can do it in GLFW with Execute(cmd), but I'm not sure about Android since it's much different.

Native code would be like this:
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
startActivity(LaunchIntent);


and you can inject this into monkey (android target only) by this:
[monkeycode]
#If TARGET="android"
Extern

Function LaunchIntent() = "Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(~qcom.package.address~q); startActivity(LaunchIntent); //"

End
#Endif
[/monkeycode]

but you may need to have access to the PackageManager, which is beyond my current knowledge.


golomp(Posted 2012) [#5]
ok, sorry Leon