Does android support USB host?

by mike.hist...@gmail.com » Tue, 28 Apr 2009 11:29:32 GMT


Sponsored Links
 Dear all:
We have a task of making pc cam useable when it plug into a device
which runs android. So we have some questions as below:
1. Does android support USB host?
2. If so, does android include driver for video class device?
3. If so, does android offer SDK for video class device?

Thanks a lot.
--~--~---------~--~----~------------~-------~--~----~

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



Other Threads

1. List View multiple choice slow to update

I am having trouble with a list aspect of my app. Essentially, it has
a multiple choice listview(simple_list_item_multiple_choice) on the
right and a text view on the left.

When an item of the list view is checked off, I want to add it to the
text view or remove it if it gets unchecked. This almost works except
that the updates on what is checked seems to be one click behind.

I.E. check something off the first time and nothing happens. Uncheck
it or check something else and the first thing appears. Check below
the list choices (but still in the list view) and it updates.

I was not able to get setOnItemSelectedListener to respond as all, so
I am using onTouchListener:

private void loadContacts(){

        String[] contacts = new String[] {People.NAME};
        final String[] cols = new String[] {
                Contacts.People.NAME,
                Contacts.People._ID,
                Contacts.People.NUMBER
              };

        final Cursor C = getContentResolver().query
(People.CONTENT_URI, cols, null, null, null);
        startManagingCursor(C);

        lv = (ListView)findViewById(R.id.contact_list);
        ListAdapter mAdapter = new SimpleCursorAdapter(this,
                android.R.layout.simple_list_item_multiple_choice,
                C,
                cols,
                new int[] {android.R.id.text1} );
        lv.setAdapter(mAdapter);

        tv = (TextView)findViewById(R.id.contact_text);

        lv.setOnTouchListener(new OnTouchListener() {
            public boolean onTouch(View v, MotionEvent event) {
                chosen = lv.getCheckedItemPositions();
                updateAttendance(chosen, C);
                //C.moveToPosition(lv.getCheckedItemPosition());
                //tv.append(C.getString(0));
                tv.invalidate();
                return false;
            }
        });
        //lv.setItemsCanFocus(false);
        lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

        lv.invalidate();
    }

    private void updateAttendance(SparseBooleanArray array, Cursor c)
{
        tv.setText("Chosen Ones:\n");

        boolean inLoop = c.moveToFirst();
        while(inLoop) {
            if(array.get(c.getPosition() ) ) {
                tv.append(c.getString(0) + "\n");
            }
            inLoop = c.moveToNext();
        }
    }



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

2. onToucheEvent badly handles ItemizedOverlay

Hi All,

I have the following exception that occurs I don't really know in
which circumstances.

I'm just trying to add an overlay to may viewMap, and I don't have
anything special in my classes. The most strange thing is that it
worked for a while, then it broken again when I changed my image!!!

07-06 14:32:12.338: WARN/dalvikvm(799): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
07-06 14:32:12.358: ERROR/AndroidRuntime(799): Uncaught handler:
thread main exiting due to uncaught exception
07-06 14:32:12.408: ERROR/AndroidRuntime(799):
java.lang.NullPointerException
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.google.android.maps.ItemizedOverlay.getItemsAtLocation
(ItemizedOverlay.java:617)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.google.android.maps.ItemizedOverlay.getItemAtLocation
(ItemizedOverlay.java:586)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:
443)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:346)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.view.GestureDetector.onTouchEvent(GestureDetector.java:503)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.google.android.maps.MapView.onTouchEvent(MapView.java:623)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.view.View.dispatchTouchEvent(View.java:3368)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:831)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1707)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent
(PhoneWindow.java:1197)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.app.Activity.dispatchTouchEvent(Activity.java:1993)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1525)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.os.Handler.dispatchMessage(Handler.java:99)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.os.Looper.loop(Looper.java:123)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
android.app.ActivityThread.main(ActivityThread.java:3948)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
java.lang.reflect.Method.invokeNative(Native Method)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
java.lang.reflect.Method.invoke(Method.java:521)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
07-06 14:32:12.408: ERROR/AndroidRuntime(799):     at
dalvik.system.NativeStart.main(Native Method)


Any help is really welcome (I've attempted to take a look the sources,
but it seams so complicated to get them...)

Regards,
Zied
--~--~---------~--~----~------------~-------~--~----~

3. How to add margin through java code

4. Browser add on.

5. Image with a Button, or text with ImageButton

6. HttpURLConnection setFixedLengthStreamingMode & setChunkedStreamingMode

7. Maximum Number of Connections