x/mobile: Launch a android application with given package name [String] in go

31 views
Skip to first unread message

Jay Sharma

unread,
Aug 25, 2019, 9:13:16 AM8/25/19
to golang-nuts

Hello All,


Following is the function written in go:


func LaunchApplication(packageName string) {
 Query :
 how can I execute application with given packageName
}
 

Generated the java binding [.aar] using gomobile.
I want to include .aar generated in my android application and call LaunchApplication("com.package.name") from java layer to native go layer and go layer should run the application.



In java application, following is the way to run apk using package name:
Process process = Runtime.getRuntime().exec("am start -n com.package.name/com.package.name.ActivityName");


I tried the same in go using:
os.exec() function but it is giving error that "am not found in the $PATH"


Is there is any way to do that ?

Reply all
Reply to author
Forward
0 new messages