我正在开发一个应用程序,我想在其中调用另一个应用程序 apk,但我没有该应用程序的代码,所以我不知道包名和类名。我搜索了很多,但找不到任何有效的东西. 有谁知道如何做到这一点?
问问题
6924 次
1 回答
3
It is perfectly possible. You don't need to know its "source code", you need to do a bit of research on the app and you're probably going to find its package's name.
You can:
- a) Try to de-pack the .apk which is extremely tedious (or was last time I tried)
- b) Write a very simple app that will list all of your installed apps (by package name)
- c) Some custom and even stock firmwares even have that option baked in when you go to Apps/Installed/All or something similar to that.
Once you have the package name. For example, com.adobe.reader for...well...Adobe Reader, then you can launch the app really simply by using an Intent.
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
startActivity(LaunchIntent);
For a similar, but maybe clearer for you view of things, you can check out this link:
于 2012-11-21T08:37:48.130 回答