I know how to update my own programs, and I know how to open programs using the a predefined Uri (for sms or email for example)
I need to know how I can create an Intent to open MyTracks or any other application that I don't know what intents they listen to.
I got this info from DDMS, but I havn't been succesful in turning this to an Intent I can use. This is taken from when opening MyTracks manually.
Thanks for your help
05-06 11:22:24.945: INFO/ActivityManager(76): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks bnds=[243,338][317,417] }
05-06 11:22:25.005: INFO/ActivityManager(76): Start proc com.google.android.maps.mytracks for activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: pid=1176 uid=10063 gids={3003, 1015}
05-06 11:22:26.995: INFO/ActivityManager(76): Displayed activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: 1996 ms (total 1996 ms)
Try this code, Hope this will help you. If this package is available then this will open the app or else open the play store for downloads
For API level 3+, nothing more then one line of code:
Intent intent = context.getPackageManager().getLaunchIntentForPackage("name.of.package");
Return a CATEGORY_INFO launch Intent (apps with no launcher activity, wallpapers for example, often use this to provide some information about app) and, if no find it, returns the CATEGORY_LAUNCH of package, if exists.
Open application if it is exist, or open Play Store application for install it:
To Start another application activity from my application Activity. It is working fine for me.
Below code will work if the another application already installed in your phone otherwise it is not possible to redirect form one app to another app.So make sure your app launched or not
Using the solution from inversus, I expanded the snippet with a function, that will be called when the desired application is not installed at the moment. So it works like: Run application by package name. If not found, open Android market - Google play for this package.
And it is used like this:
Use this :