Introduction
In this article, I am going to illustrate how a developer can link their app with the Google Play Store so that a user can navigate there to rate the applications by clicking on a particular button or image.
Google provides several application programming interfaces to perform this operation. I am going to explain two aspects - 1. How you can navigate your user to the Play Store when the user's device has Google Play Store installed; 2. when the user device doesn't have Google Play Store (Virtual Device - Emulator).
Step 1
Create a new Android Studio Project as below.
Step 2

Give the name of the project location and package name of your project and then click on Next.

Step-3
Choose "Phone and Tablet" as the application category and set KitKat-API-19 as minimum SDK. Then, click on Next.

Step-3
Select Empty activity as the main activity of your project and click Next.

Step-4
One Kotlin file named MainActivity.kt and one Layout file named activity_main.xml will be created.
Creating Layout

Step-5
Add the following xml code to your activity_main.xml file.
- <?xml version="1.0" encoding="utf-8"?>
- <android.support.constraint.ConstraintLayout xmlns:android="https://schemas.android.com/apk/res/android"
- xmlns:app="https://schemas.android.com/apk/res-auto"
- xmlns:tools="https://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="manigautam.app.myplaystoreratingapp.MainActivity">
- <Button
- android:id="@+id/btnplaystore"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="@drawable/googleplayimage"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintLeft_toLeftOf="parent"
- app:layout_constraintRight_toRightOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- />
- </android.support.constraint.ConstraintLayout>






Join the conversation! Your thoughts help the community grow.