Execute an Android native program

psevet

Member
Licensed User
Longtime User
Hello,

I need to add a "calc" button that should display the internal calculator included in Android 2.1.

I have no clue as how to do this.

Can anyone help me ?

Thanks in advance.

Pierre
 

slydog43

Member
Licensed User
Longtime User
this may help.

Create an intent with action=MAIN and category=LAUNCHER
Get the PackageManager from the current context using context.getPackageManager
packageManager.queryIntentActivity(, 0) where intent has category=LAUNCHER, action=MAIN or packageManager.resolveActivity(, 0) to get the first activity with main/launcher
Get the ActivityInfo you're interested in
From the ActivityInfo, get the packageName and name
Finally, create another intent with with category=LAUNCHER, action=MAIN, componentName = new ComponentName(packageName, name) and setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
Finally, context.startActivity(newIntent)


I also found this


Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_MAIN, "")
Intent1.SetComponent("com.google.android.youtube/.HomeActivity")
StartActivity(Intent1)

I think if you find out the correct setCompent the 3rd line would change.


this should get you going in the right direction.
 
Upvote 0

psevet

Member
Licensed User
Longtime User
Thank you Slydog43 but I thought it would be much simplier to run another Android app.

Regards,

Pierre
 
Upvote 0
Top