Simple gauge view like speedmeter in android?

I want to have a simple gauge view where i will define the start value and the end value and have a pointer to show given variable value.

enter image description here

  • how to check open file without lsof
  • Android: drawable resolutions
  • Bad window token, you cannot show a dialog before an Activity is created or after it's hidden
  • android: two issues using Tablerow+TextView in Tablelayout
  • how to set choice mode single for listview with images
  • Layout like Cards in android
  • So i can show a given value like speedmeter. For example if my the value of a textView is 1300, then next to the textview i want to have this custom meter view animation like this!

    It is possible? Any existing example code?

    Related posts:

    IntelliJ and Android Gradle dependencies - unable to find module
    xlarge vs sw720dp screen size confusion
    Android: Bluetooth failed to get port number
    zz_moto_actionbar_bkg.xml resource error on Droid
    How to simulate audio input to Microphone using .wav file
    How to get HTML source code from url in android?
  • Android MediaCodec AAC encoder
  • Building FFMPEG with librtmp for android
  • Android, Saving and loading a bitmap in cache from different activities
  • Android keyboard next button issue on EditText
  • What are the consequences if we try to attach a Native Thread permanently to the DVM (JVM)?
  • XmlPullParser - Parse nested tag
  • 4 Solutions collect form web for “Simple gauge view like speedmeter in android?”

    Another one i found at Evelina Vrabie's blog, used it and worked perfect!

    Look at Evelina Vrabie's GitHub.
    It has a gauge library and some samples to interact with.

    Big thanks to the owner Evelina Vrabie!

    enter image description here

    However it is not working on XHDPI/Few versions of android devices (above 4). Problem is the text in gauge view.

    For anyone looking for simple gauge view I made a library that you can clone and use/modify for your needs.


    enter image description here

    All other gauges you recommended have bugs and don’t run fine on Kitkat and Lollipop. Also there is no Android Studio and gradle friendly library here.

    Here’s git repo for the more recent one updated for Lollipop you can use with Gradle:

    enter image description here

    After you include library in your project add gaugelibrary to xml layout of your activity:


    This will show static gauge without needle. To instantiate needle with random animation you need to do that in activity class file. See how it’s done here:

    package io.sule.testapplication;
    import android.os.Bundle;
    import android.os.CountDownTimer;
    import android.view.Menu;
    import android.view.MenuItem;
    import java.util.Random;
    import io.sule.gaugelibrary.GaugeView;
    public class MainActivity extends Activity {
       private GaugeView mGaugeView;
       private final Random RAND = new Random();
       protected void onCreate(Bundle savedInstanceState) {
          mGaugeView = (GaugeView) findViewById(;
       private final CountDownTimer mTimer = new CountDownTimer(30000, 1000) {
          public void onTick(final long millisUntilFinished) {
          public void onFinish() {}

    This will instantiate needle and make it animate moving to random values.

    I don’t know whether the late answer is going to help or not. I also came to the same situation where i want to use a gauge to visualize data, since gauge is not given as widget in android, as a enthusiast i went for libraries like above which can be found through various links in the Internet, although it was quite helpful(thanks to the wonderful authors of it..) i find myself difficult to visualize the during certain situations, so another solution what i have done is for my app is i integreated the JavaScript gauges into my android application.
    You can do that by the following steps

    1. Create an asset folder in our project-look this link and you will see how to create an asset folder if someone don’t knows about it.
    2. Next one is you have design an html page on how your page sholud look like, for eg- header,no.of guages etc… and place it in the folder asset.
    3. There are many sites which provide the guages like This is one site or you can browse other sites and take whatever you feel cool…!!
      take it all including .js files and place it in the asset folder.
    4. Android provides a class for handling webiview called “WebViewClient” you can browse more to know more about it in internet
    5. This is sample code for viewing the webview content..

      web = (WebView) findViewById(;
      progressBar = (ProgressBar) findViewById(;

      web.setWebViewClient(new myWebClient());
         Runnable() {
                      public void run() {

    The above for loading the html & javscript.

     public class myWebClient extends WebViewClient
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            // TODO Auto-generated method stub
            super.onPageStarted(view, url, favicon);
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            // TODO Auto-generated method stub
            return true;
        public void onPageFinished(WebView view, String url) {
            // TODO Auto-generated method stub
            super.onPageFinished(view, url);

    This the webview class

    1. You can also send data from activity to html page.. Refer This link

    Kindly read through all, corrections are welcomed..!!

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.