Android Hook

by Sansiro » Fri, 17 Jul 2009 01:53:47 GMT


Sponsored Links
 In Windows Mobile, I have a hook function to get the System's mouse
event,KB event and screen change.
Can I have this function too in Android?
Because I want to get the screen shot of Android, But the method
providered in DDMS is too inefficient

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



Other Threads

1. pre-portability number being returned from telephony manager

I tried to search around a bit but this is all I could find...

2. Threads in Android

Hi,

You can use threads but all the views, and all the views related APIs,
must be invoked from the main thread (also called UI thread.) To do
this from a background thread, you need to use a Handler. A Handler is
an object that will post messages back to the UI thread for you. You
can also use the various post() method from the View class as they
will use a Handler automatically. In your case, you could do something
like this:

private Handler mHandler;

protected void onCreate(Bundle saved) {
   mHandler = new Handler();
}

// In your Thread
public void run() {
   // ...
  mHandler.post(new Runnable() {
    public void run() { popup.dismiss(); }
  });
}

You can also look at the class called UserTask from the
apps-for-android project:
http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/UserTask.java

It makes threading/UI interactions even easier.






-- 
Romain Guy
www.curious-creature.org

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

3. Contacts Performance

4. About the stats bug in Market

5. import error for aidl

6. Fwd: Send DTMF

7. Intent extras modified