Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to open android application if installed and go to android market if not install

Tags:

android

I would like to make android button and able to launch other application if already installed and go to android market if not yet installed.

How to do this?

Regards, Virak

like image 599
SopheakVirak Avatar asked Jul 23 '12 10:07

SopheakVirak


People also ask

How can I run Android apps without installing?

With Google Play Instant, people can use an app or game without installing it first. Increase engagement with your Android app or gain more installs by surfacing your instant app across the Play Store and Google Play Games app.

How do I open installed apps on Android?

Swipe up from the bottom of your screen to the top. If you get All Apps , tap it. Tap the app that you want to open.

Can you run an app without installing it?

Android Instant Apps allows you to access the cloud-based version of an app without accessing the Play Store to install it manually. Therefore, you can use an app beforehand instead of installing it and then try it out.


1 Answers

use below code

String packageName = "app_package_name";
Intent intent = getPackageManager().getLaunchIntentForPackage(packageName);

if(intent == null) {
   intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+packageName));
}
  startActivity(intent);
like image 153
Vivek Kumar Srivastava Avatar answered Sep 21 '22 15:09

Vivek Kumar Srivastava