Create Rate This App button in android programmatically

How to implement app rating given code so app user can give online rating to your app on Google Play Store.

Most of peoples download new application from Google Play Store based on their ratings, which can given by any existing user on play store. These rating were told the new users who wish to install that particular android app that this is app is good, average or bad. So in this tutorial we are simply writing the code to open our application dashboard on Google play store app so user can easily give us online rating. So here is the complete step by step tutorial for Create Rate This App button in android programmatically.

android-project-download-code-button

Note: Please download rating icon image from below and copy inside drawable-hdpi folder.

drawable hdpi folder

This is the rating bar image put inside drawable-hdpi folder.

rate

How to Create Rate This App button in android programmatically.

Code for MainActivity.java file.

 package com.ratethisapp_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.ImageView;


public class MainActivity extends Activity {

 ImageView imageview;
 Intent intent ;
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 
 imageview = (ImageView)findViewById(R.id.imageView1);
 
 imageview.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.ratethisapp_android_examples.com.MainActivity" >

 
 <ImageView
 android:id="@+id/imageView1"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_centerHorizontal="true"
 android:layout_centerVertical="true"
 android:src="@drawable/rate" />
 
 
</RelativeLayout>

Screenshot:

Create Rate This App button in android programmatically

 

open-app-3

Click here to download Create Rate This App button in android programmatically project with source code.

One Comment

  1. simple and excellent

Leave a Reply

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