How does one get the current energy consumption rate of the phone? Are there any Android energy profilers?

by Brent » Tue, 14 Apr 2009 13:04:42 GMT


Sponsored Links
 It is useful to know how much energy different features (i.e. GPS,
accelerometer, screen) of the Android phone are consuming, but I have
not been able to find an energy profiling application for Android
phones (something similar to what Nokia makes; see
 http://www.forum.nokia.com/info/sw.nokia.com/id/324866e9-0460-4fa4-ac53-01f0c392d40f/Nokia_Energy_Profiler.html ),
which would allow me to see the current energy consumption without
resorting to using an oscilloscope. Does anyone know of such a utility
or how I could get the current energy consumption programatically
using the Android API?

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Creating a child to SurfaceView in main.xml

Hi

I am trying to create a child to my SurfaceView in main.xml. My child
extends View. However the SurfaceView and my PanoramaView is inside a
ViewSwitcher and I am starting to believe that this is causing the
errors I get.

Here is my main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <ViewSwitcher android:id="@+id/switcher"
        android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                >
                <android.view.SurfaceView 
xmlns:android="http://schemas.android.com/
apk/res/android"
                        android:id="@+id/cam_preview"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent">
                        <com.scalado.reference.panorama.PanoramaTracker
xmlns:android="http://schemas.android.com/apk/res/android"
                        android:id="@+id/tracker"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"/>
                </android.view.SurfaceView>
                <com.scalado.reference.panorama.PanoramaViewer 
xmlns:android="http://
schemas.android.com/apk/res/android"
                        android:id="@+id/viewer"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                />
        </ViewSwitcher>
</LinearLayout>

Without the PanoramaTracker view everything works fine. But now I
would like to add some overlays to my SurfaceView.

I get the following error.

W/ActivityManager(  591): Launch timeout has expired, giving up wake
lock!
W/ActivityManager(  591): Activity idle timeout for HistoryRecord
{435c52c8 {com.scalado.reference.panorama/
com.scalado.reference.panorama.PanoramaDriver}}
D/AndroidRuntime( 2074): Shutting down VM
W/dalvikvm( 2074): threadid=3: thread exiting with uncaught exception
(group=0x4000fe70)
E/AndroidRuntime( 2074): Uncaught handler: thread main exiting due to
uncaught exception
D/dalvikvm(  633): GC freed 647 objects / 35832 bytes in 322ms
E/AndroidRuntime( 2074): java.lang.RuntimeException: Unable to start
activity ComponentInfo{com.scalado.reference.panorama/
com.scalado.reference.panorama.Panora
maDriver}: java.lang.ClassCastException: android.view.SurfaceView
E/AndroidRuntime( 2074):        at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2268)
E/AndroidRuntime( 2074):        at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
E/AndroidRuntime( 2074):        at android.app.ActivityThread.access
$1800(ActivityThread.java:112)
E/AndroidRuntime( 2074):        at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1692)
E/AndroidRuntime( 2074):        at android.os.Handler.dispatchMessage
(Handler.java:99)
E/AndroidRuntime( 2074):        at android.os.Looper.loop(Looper.java:
123)
E/AndroidRuntime( 2074):        at android.app.ActivityThread.main
(ActivityThread.java:3948)
E/AndroidRuntime( 2074):        at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2074):        at java.lang.reflect.Method.invoke
(Method.java:521)
E/AndroidRuntime( 2074):        at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime( 2074):        at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
E/AndroidRuntime( 2074):        at dalvik.system.NativeStart.main
(Native Method)
E/AndroidRuntime( 2074): Caused by: java.lang.ClassCastException:
android.view.SurfaceView
E/AndroidRuntime( 2074):        at android.view.LayoutInflater.rInflate
(LayoutInflater.java:618)
E/AndroidRuntime( 2074):        at android.view.LayoutInflater.rInflate
(LayoutInflater.java:620)
E/AndroidRuntime( 2074):        at android.view.LayoutInflater.rInflate
(LayoutInflater.java:620)
E/AndroidRuntime( 2074):        at android.view.LayoutInflater.inflate
(LayoutInflater.java:407)
E/AndroidRuntime( 2074):        at android.view.LayoutInflater.inflate
(LayoutInflater.java:320)
E/AndroidRuntime( 2074):        at android.view.LayoutInflater.inflate
(LayoutInflater.java:276)
E/AndroidRuntime( 2074):        at
com.android.internal.policy.impl.PhoneWindow.setContentView
(PhoneWindow.java:309)
E/AndroidRuntime( 2074):        at android.app.Activity.setContentView
(Activity.java:1626)
E/AndroidRuntime( 2074):        at
com.scalado.reference.panorama.PanoramaDriver.onCreate
(PanoramaDriver.java:75)
E/AndroidRuntime( 2074):        at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
E/AndroidRuntime( 2074):        at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
E/AndroidRuntime( 2074):        ... 11 more

My members are:
public class PanoramaDriver extends Activity {
        private ViewSwitcher switcher=null;
        private SurfaceView cam_preview=null;
        private PanoramaViewer viewer=null;
        private PanoramaTracker tracker=null;
        private SurfaceHolder cam_previewHolder=null;
        private Camera camera=null;

My onCreate looks like:
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    this.switcher=(ViewSwitcher)findViewById(R.id.switcher);
    this.cam_preview=(SurfaceView)findViewById(R.id.cam_preview)
    this.cam_previewHolder=cam_preview.getHolder()
    this.cam_previewHolder.addCallback(camPreviewSurfaceCallback);
    this.cam_previewHolder.setType
(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
    this.tracker=(PanoramaTracker)findViewById(R.id.tracker);
    this.viewer=(PanoramaViewer)findViewById(R.id.viewer);
}

Why can't I inflate this layout?

--~--~---------~--~----~------------~-------~--~----~

2. codec

H263,H264AVC & MPEG-4 SP codecs are compltetly ported to Android.
In Android1.5 API , H264 AVC is only Encoder whereas its a encoder &
decoder.
H263 supports only few file formats in Android. Where I can get exact
data of all these things

--~--~---------~--~----~------------~-------~--~----~

3. Android SDK in Ubuntu 8.04 and Samsung galaxy

4. HOWTO: change the xml keyboard AZERTY to QWERTZ ?

5. android plugins....

6. DialerFilter

7. Official Google Android Developer Phone G1 (running in Canada) needs Cupcake!