How to use the key event to emulate the acceleration sensor to let the screen change orientation.

by rjy...@gmail.com » Thu, 07 Jan 2010 14:57:15 GMT


Sponsored Links
 Hi
   My hardward has not a acceleration sensor, But I need test screen
change orientation function. So I need emulate this function use the
key. How can I do.
  I seach a lot of infomation from internet, Some proposal is send the
KEY_ROTATE(Key code is 99) to /dev/input/event0,  But no effect.
Thanks.

---------------------------------
RongJun Ying



Other Threads

1. How to create Multiple instances of an Activity From a Service?

I was wondering is it possible to create multiple instances of a
single Activity in Android?

I currently start my own inCall screen for a Voip Test by using the
following code: (Used in a Service)

---

             public void initInCallScreen(String pName, String phoneNumber,
int contactID, boolean
                        callDirection, int lineID){

                //starts in callScreen dialog
        final Intent myIntent = new Intent(context,
CallDialogActivity.class);
        myIntent.putExtra("NAME", pName);
        myIntent.putExtra("NUMBER", phoneNumber);
        myIntent.putExtra("ID", contactID);
        myIntent.putExtra("CALLTYPE", callDirection); //True =
Incoming, False = Outgoing
        myIntent.putExtra("LINEID", lineID);
        myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(myIntent);

---

This allows me to start the Activity fine.

However when I call it for a second it just returns to the Activity
already created rather than creating a new Activity and placing it on
the stack.

I would like to be able to create the activity multiple times so that
I have two or 3 Activities on the stack and the user can switch
between them, using Home, Back buttons etc...

Is this possible and if so what am I doing wrong?

-- 

2. Launch the WebBrowser with an intent (containing url) and then close it automatically?





I guess you can do whatever it is task killer apps do to kill a specific
task / process, but that's probably a massive hack.

Better option, I'd think, would be to control this by showing a WebView
instead of launching the browser, with which you can do whatever you want.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 

3. TO CHANGE YOUR LIFE BY A SECOND :

4. onclick open new view

5. Emulator keeps slowing down after a couple of deployments/Run as Android Application in Eclipse

6. Android Application design?

7. Official IMDB App!