Can I simulate the key event on the emulator?

by Steven Ho » Mon, 03 Nov 2008 14:20:41 GMT


Sponsored Links
 Hi all,
    I want to simulate the key press function. Is there any way to do it? the 
keys like dialing , hangup or number bottons. Hope your reply. Thanks!
Steven Ho
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Is Samsung Galaxy Tab NOT a large screen from application developer's point of view?

Hi,

I have layout issues in my application on Samsung Galaxy Tab. It has a
7" TFT display with 1024x600 resolution.

Galaxy Tab prefers images in "res/drawable-hdpi" to the ones in "res/
drawable". That is understandable.
However resources in "res/layout" are used instead of the ones in "res/
layout-large". Does it have a logical explanation? Or what am I doing
wrong? What is a large screen for Android?

Manifest contains
<supports-screens
  android:smallScreens="true"
  android:normalScreens="true"
  android:largeScreens="true"
  android:anyDensity="true" />
<uses-sdk
  android:minSdkVersion="4"
  android:targetSdkVersion="7" />

Thanks in advance

Argon

-- 

2. External Storage File Creation Problem

Hi Everyone,

I'm new to android development, the following is the code that am
using to create a small text file on the external storage. but the
problem is its saying can't read nd can't write.. Can any one help me
out.. please

Note : bollo() is a method with has a toast to display on the screen
dont confuse with that method.

boolean mExternalStorageAvailable = false;
                boolean mExternalStorageWriteable = false;
                String state = Environment.getExternalStorageState();

                if (Environment.MEDIA_MOUNTED.equals(state)) {
                    // We can read and write the media
                    mExternalStorageAvailable = mExternalStorageWriteable = 
true;
                   bollo("Storage is mounted and ready to use");

                    try {
                        File root = Environment.getExternalStorageDirectory);
                        if (root.canWrite()) {
                        File myFile = new File(root, "test.txt");
                        FileWriter myFileWriter = new FileWriter(myFile);
                        BufferedWriter out = new BufferedWriter(myFileWriter);
                        out.write("Hello Android Community");
                        out.close();
                        }
                        else
                        {
                                bollo("media not writable");
                                if(root.canRead())
                                {
                                        bollo(root.getPath());
                                }
                                else
                                {
                                        bollo("media not readable");
                                }
                        }
                        } catch (IOException e) {
                        Log.e("EXT", "Error writing file: " + e.getMessage());
                        bollo("Error");
                        }


                } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
                    // We can only read the media
                    mExternalStorageAvailable = true;
                    mExternalStorageWriteable = false;
                    Toast.makeText(this, "Storage is mounted and ready to use 
but
not writable", Toast.LENGTH_LONG).show();
                } else {
                    // Something else is wrong. It may be one of many other 
states,
but all we need
                    //  to know is we can neither read nor write
                    mExternalStorageAvailable = mExternalStorageWriteable = 
false;
                    Toast.makeText(this, "Storage is not mounted and not ready 
to
use", Toast.LENGTH_LONG).show();
                }

-- 

3. multiple images in a one single image

4. getting sensor information from native code (C or C++)

5. How to send data from android application to UART

6. KeyCharacterMap problem and Bluetooth Headset

7. Is the database SQLite available on all android devices and versions ?