Ang.: Getting the battery current and voltage values for the Android Phone

by Daniel Petersson » Tue, 16 Mar 2010 20:33:22 GMT


Sponsored Links
 Hi,

449 mA is the max current for USB charging connected to a PC. If you read
the value when charging with a wall plug you will get a higher value
(probably around 700 mA but it is depending on the charger and the PMIC).

/D

Den 15 mar 2010 15.55, "Chris Stratton" <cs07...@gmail.com> skrev:

It might be a current estimate, but since it was reported to be
nonzero only with external power it sounds more like charge current
than drain.  Would be interesting if it turns out different with the
wall charger vs. usb.

Android being open source Chintan should be able to track down the
source of the number by perusing the sources.

Its probably possible to make an instrumented dummy battery for
research purposes, though it would requure figuring out the interface.




<android-kernel%252bunsubscr...@googlegroups.com<android-kernel%25252bunsubscr...@googlegroups.com>

> > > > website:



Ang.: Getting the battery current and voltage values for the Android Phone

by Chintan » Thu, 18 Mar 2010 04:56:06 GMT


 Ok, I am also able to read 449 mA for charging via USB.
Just wondering how is the phone able to measure the charging current
and not able to measure the discharge current.

For now I am planning to connect an external resistor and measure the
discharge current. I think that's the way to only way to get the
current values.

Thanks for your inputs.

On Mar 16, 4:13pm, Daniel Petersson



> > > > > website:


Sponsored Links


Other Threads

1. when switch to 32 bit graphics icons go black

Hi Im working on MIPS Froyo port, and we had 16bit Framebuffer
working, and now I switched to 32bit RGBA format, and all Icons and
some GUI elements are completely black.

Homescreen background, browser content, jpg images are looking good.

Any ideas?

-- 

2. wried UI issue..

I am facing weird UI behavior issue.
When I set *listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);*
onListItemClick behave incorrectly... Let me know if I am missing
anything here.

When I comment following line
    listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

This UI works fine as expected but following part of code doesn't work
    long[] idsList = getListView().getCheckedItemIds();
    Log.i(TAG,"number of rows selected"+idsList.length);

Expected UI change is when i click on one list item it should toggle
its checked state, which does not happen it toggles other list item..
Strange!!!!



File:Listbox.java

package checkbox.list.com;
import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.CheckedTextView;
import android.widget.ListView;
import android.provider.ContactsContract.CommonDataKinds.Phone;


public class listbox extends ListActivity {
private static final String TAG = "listbox";
Cursor mCursor = null;
ListView listView = null;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    listView = getListView();
    LoadList();
    //listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
}

@Override
protected void onListItemClick(ListView l, View v, int position, long
id) {
    int pos = l.getPositionForView(v);
    Log.i(TAG,"pos of view"+pos);
    CheckedTextView txtview = (CheckedTextView)
v.findViewById(android.R.id.text1);
    txtview.toggle();
    long[] idsList = getListView().getCheckedItemIds();
    Log.i(TAG,"number of rows selected"+idsList.length);
}

private void LoadList() {
    mCursor = this.getContentResolver().query(Phone.CONTENT_URI, null,
null, null, null);
    startManagingCursor(mCursor);

    String [] from=new String []{Phone.DISPLAY_NAME,Phone.TYPE};
    int [] to=new int [] {android.R.id.text1, android.R.id.text2};
    MyCursorAdapter sca=new
MyCursorAdapter(this,R.layout.fetchrow,mCursor,from,to);
    setListAdapter(sca);
}
}

File:MyCursorAdapter.java

package checkbox.list.com;
import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckedTextView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;

public class MyCursorAdapter extends SimpleCursorAdapter {
    protected static final String TAG = "MyCursorAdapter";
    private Cursor mCursor;
    private String []strFromCols;
    private int []toView;

    public MyCursorAdapter(Context context, int layout, Cursor c,
            String[] from, int[] to) {
        super(context, layout, c, from, to);
        mCursor = c;
        strFromCols = from;
        toView = to;
    }
    public View getView(int pos, View inView, ViewGroup parent) {
        View v =  super.getView(pos,inView,parent);
        mCursor.moveToPosition(pos);

        final CheckedTextView chkTxt = (CheckedTextView)
v.findViewById(toView[0]);
        String name=
mCursor.getString(mCursor.getColumnIndex(strFromCols[0]));
        chkTxt.setText(name);
//      chkTxt.setOnClickListener(new OnClickListener() {
//
//          @Override
//          public void onClick(View v) {
//              chkTxt.toggle();
//          }
//      });
        TextView txtPhone = (TextView) v.findViewById(toView[1]);
        String phone =
mCursor.getString(mCursor.getColumnIndex(strFromCols[1]));
        txtPhone.setText(phone);
        return (v);
    }
}

File: 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"
    android:gravity="top">
<ListView
    android:id="@id/android:list"
    android:layout_width="fill_parent"
    android:numColumns="1"
    android:stretchMode="columnWidth"
    android:gravity="top"
    android:layout_height="wrap_content"
android:layout_gravity="bottom|top"/>

<Button
    android:text="delete"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
   />
</LinearLayout>

File:fetchrow.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/
android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:gravity="center_vertical"
    android:checkMark="?android:attr/listChoiceIndicatorMultiple"
    android:paddingLeft="6dip"
    android:paddingRight="6dip"


/>

    <TextView android:id="@android:id/text2"
        android:textSize="16sp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:focusable="false"/>


</LinearLayout>

-- 

3. problem with in-app billing

4. Qualcomm Demos MSM8660 1.5GHz Dual-Core

5. Prefix in devices.c

6. java.io.EOFException

7. Tanya : app android di playbook.