Open specific app inside Google Play Store via android app on button click

How to directly open any given app dashboard home page inside Play Store on programmatically.

In this tutorial we are opening specific android application directly from app on button click. To open any android app directly from our application we need to firstly copy the application whole URL from Google Play Store website which is displayed into address bar. So here is the complete step by step tutorial for Open specific app inside Google Play Store via android app on button click.

android-project-download-code-button

How to Open specific app inside Google Play Store via android app on button click.

Code for MainActivity.java file.

 package com.openspecificappgoogleplaystore_android_examples.com;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


public class MainActivity extends Activity {

 Button button;
 Intent intent ;
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 
 button = (Button)findViewById(R.id.button1);
 
 button.setOnClickListener(new View.OnClickListener() {
 
 @Override
 public void onClick(View v) {
 // TODO Auto-generated method stub
 
 intent = new Intent(android.content.Intent.ACTION_VIEW);
 
 //Copy App URL from Google Play Store.
 intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.youtube"));
 
 startActivity(intent);
 
 }
 });
 }
}

Code for activity_main.xml layout file.

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:paddingBottom="@dimen/activity_vertical_margin"
 android:paddingLeft="@dimen/activity_horizontal_margin"
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin"
 tools:context="com.openspecificappgoogleplaystore_android_examples.com.MainActivity" >

 <Button
 android:id="@+id/button1"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_centerHorizontal="true"
 android:layout_centerVertical="true"
 android:text="Click Here to Open YouTube inside Google play Store from your android app on button click." />

</RelativeLayout>

Screenshot:

Open specific app inside Google Play Store via android app on button click

 

open-app-2

 

open-app-3

Click here to download Open specific app inside Google Play Store via android app on button click project.

Leave a Reply

Your email address will not be published. Required fields are marked *