How could I write a code which can tell me that android market is installed on your android phone?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are two ways. You can use the already mentioned
getPackageManager()andgetApplicationInfo()(if the package is not found, aPacketManager.NameNotFoundExceptionwill be thrown – see here). Android Market’s package name iscom.android.vending.However, you can also create a dummy intent for searching the market and check how it is handled. If the resulting list has at least one entry, you can be sure that Android Market is installed: