Back to project page BatteryTop.
The source code is released under:
GNU General Public License
If you think the Android project BatteryTop listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * BatteryTop: show detailed battery informations in a top-like format */*w ww . j a va 2 s . c o m*/ * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Copyright (C) 2011 Andrea Righi <andrea@betterlinux.com> */ package com.arighi.batterytop; import android.hardware.SensorManager; import android.app.Activity; import android.os.Bundle; import android.content.Intent; import android.content.IntentFilter; import android.widget.TextView; public class BatteryTop extends Activity { private BatteryInfo bi = null; private SensorInfo si = null; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); bi = new BatteryInfo((TextView)findViewById(R.id.battery)); IntentFilter mIntentFilter = new IntentFilter(); mIntentFilter.addAction(Intent.ACTION_BATTERY_CHANGED); registerReceiver(bi, mIntentFilter); si = new SensorInfo((SensorManager)getSystemService(SENSOR_SERVICE), (TextView)findViewById(R.id.sensor)); } protected void onResume() { super.onResume(); } protected void onStop() { super.onStop(); } }