How to get battery temperature updated in every 10 seconds in android
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3997289/get-temperature-of-battery-on-android">Get temperature of battery on android</a>  </p>
</blockquote>



<p>I am new to android, making an app which shows the battery temperature of the android updated in every 10 seconds...please help me out</p>

<pre><code>      public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
       // setContentView(R.layout.activity_blue_tooth);


        LinearLayout big = new LinearLayout(this);
        big.setOrientation(LinearLayout.VERTICAL);



    LinearLayout small[]= new LinearLayout[5];

    for(int i=0; i&lt;5; i++)
    { 
        small[i]= new LinearLayout(this);
    small[i].setOrientation(LinearLayout.HORIZONTAL);
    LinearLayout.LayoutParams linearparams1 = new LinearLayout.LayoutParams(
            LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.MATCH_PARENT);

     temp = new TextView(this);
     small[i].addView(temp);


       volt= new TextView(this);
      small[i].addView(volt); 

        big.addView(small[i]);
    }
        setContentView(big);

        this.registerReceiver(this.mBatInfoReceiver, 
        new IntentFilter(Intent.ACTION_BATTERY_CHANGED));

      }

      private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver(){


        @Override
        public void onReceive(Context arg0, Intent intent) {
          // TODO Auto-generated method stub
            int temperature = intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0);
            int voltage= intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE,0);
            temp.setText("Temperature="+String.valueOf(temperature) + "%");
          volt.setText("   " +"Voltage="+String.valueOf(voltage) + "%");
        }
      };
</code></pre>

<p>I am getting battery temperature and voltage but I'm unable to update this for every 10 seconds</p>
