0

Possible Duplicate:
How to get package name from anywhere?

In my project I have selected an application from installed applications in the phone and stored it as a string. But later in the project I need to launch that application for which I need d package name. Is it possible to get name of the package from application name?? Please help. Thanks in advance

0

1 Answer 1

1

The package is the only official identity of an application. If you using anything to be a persistent identity of an app, it should be that, not some something else. (You are not clear on what you are currently using, but if by "application name" you mean the label that is shown to the user for the application, that is most definitely not what you should be doing. All the user needs to do is change their locale and poof you are lost. Or install an update to the app that changes its name... like Google Music becoming Play Music.)

Sign up to request clarification or add additional context in comments.

2 Comments

Could you please tell me how I can store both application name(label) and the package name so that i can use it later? i need label to display it on the screen for the user and package name to launch it
You only need the package name. If you want the label, use developer.android.com/reference/android/content/pm/… and developer.android.com/reference/android/content/pm/… . You definitely don't want to store the label text, because it can change for all kinds of reasons -- an application update being installed, the user changing the locale, etc.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.