开发者

Find out the class name of an apk

I am developing a开发者_JAVA百科n app that should be able to launch another app installed on the phone. Currently, I am successful with launching facebook as the ActivityPackage and ActivityClass is known. I want to launch other apps such as twitter, gplus, gtalk, gmail etc. How do I find out the corresponding Class Names? Finding out the package name is easy with packagemanager, but I dont find the class name with the same method.


I am developing an app that should be able to launch another app installed on the phone.

You can query PackageManager for activities that are designed to be launched. Here is a sample project demonstrating this.

Currently, I am successful with launching facebook as the ActivityPackage and ActivityClass is known.

Don't do this.

You see, you should realize that Facebook can update their app at any time, changing around the activities as Facebook chooses. You should realize that, when Facebook does this, any code that depended on the original undocumented, unsupported Intent structure (e.g., classes) will break. You should realize that a broken app will cause users to give the app poor ratings and comments on the Market, etc.

I want to launch other apps such as twitter, gplus, gtalk, gmail etc. How do I find out the corresponding Class Names?

Don't do this. Please use the activities declared as belonging in the launcher, per the aforementioned sample project.


I'm assuming you're not trying to do this at runtime...

android-apktool can expand the manifests of the the packages you're interested in. That will tell you what activities are available and what intent filters are applied.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜