Introduction
To get a rating you will use "getRating()".
The "getRating()" method returns the rating as a float.
Step 1
Create a project like this:
Step 2
Create an XML file with the following.
In this XML file, you will use a Button, RatingBar and TextView. The rating will show the rating as a toast Notification.

- <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:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- android:paddingBottom="@dimen/activity_vertical_margin"
- tools:context=".MainActivity"
- android:background="#524ff0">
- <TextView
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:text="RATINGBAR"
- android:textColor="#000000"
- android:textStyle="bold"
- android:textSize="25dp"
- android:layout_centerHorizontal="true"/>
- <Button
- android:layout_width="150dp"
- android:layout_height="70dp"
- android:text="Button"
- android:id="@+id/button"
- android:textSize="30dp"
- android:layout_centerInParent="true"
- />
- <RatingBar
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="50dp"
- android:id="@+id/ratingBar"
- android:layout_centerHorizontal="true">
- </RatingBar>
- </RelativeLayout>


sahil bhatiaPosted Apr 11, 2016, 10:32 AM
hello sir but how to this rating link to google play store my app