Can android application overwrite the volume down/up key's behavior?

by striverwang » Fri, 13 Mar 2009 01:43:13 GMT


Sponsored Links
 hi, all:
I want to development a application, which want to use volume down, up
key to do something I need.
For example, when the user click the volume up button, a dialog pop-
up.
Can I do that ?


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



Other Threads

1. Android SDK in Ubuntu 8.04 and Samsung galaxy

Hallo,
i have problem to use adb in ubuntu8.04 with Samsung Galaxy
i used lsusb and had something like this

Bus 004 Device 004: ID 04e8:6640 Samsung Electronics Co., Ltd
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         2 Abstract (modem)
  bDeviceProtocol         0 None
  bMaxPacketSize0        64
  idVendor           0x04e8 Samsung Electronics Co., Ltd
  idProduct          0x6640
  bcdDevice            1.00
  iManufacturer           3 Qualcomm Incorporated
  iProduct                2 Samsung Android USB Device
  iSerial                 1 I7500p5g564zU7V
  bNumConfigurations      1

After that i created the file /etc/udev/rules.d/51-android.rules with
the content:
SUBSYSTEM=="usb",SYSFS{idVendor}=="04e8",MODE="0666" .

i also changed permission for 51-android-rules with:

This is the content of my /etc/udev/rules.d

lrwxrwxrwx 1 root root    22 2009-06-02 16:29 025_logitechmouse.rules -
-rw-r--r-- 1 root root   400 2008-04-11 14:21 05-options.rules
-rw-r--r-- 1 root root   191 2008-04-11 14:21 05-udev-early.rules
-rw-r--r-- 1 root root  3215 2008-04-11 14:21 20-names.rules
-rw-r--r-- 1 root root   119 2008-04-11 14:21 30-cdrom_id.rules
-rw-r--r-- 1 root root   814 2008-04-11 14:21 40-basic-
permissions.rules
-rw-r--r-- 1 root root  3109 2008-04-11 14:21 40-permissions.rules
-rw-r--r-- 1 root root    30 2008-02-26 19:25 45-fuse.rules
-rw-r--r-- 1 root root 34568 2008-04-10 18:24 45-libmtp7.rules
-rw-r--r-- 1 root root    55 2009-07-13 20:12 50-android.rules~
-rw-r--r-- 1 root root  2656 2008-03-18 00:26 50-libpisock9.rules
-rw-r--r-- 1 root root  6661 2008-03-30 07:42 50-xserver-xorg-input-
wacom.rules
-rwxr-xr-x 1 root root    53 2009-07-13 20:53 51-android.rules
-rw-r--r-- 1 root root   980 2008-04-15 18:44 55-hpmud.rules
-rw-r--r-- 1 root root  1431 2008-04-11 14:21 60-persistent-
input.rules
-rw-r--r-- 1 root root  3468 2008-04-11 14:21 60-persistent-
storage.rules
-rw-r--r-- 1 root root  1222 2008-04-11 14:21 60-persistent-storage-
tape.rules
-rw-r--r-- 1 root root   649 2008-04-11 14:21 60-symlinks.rules
-rw-r--r-- 1 root root   411 2008-04-11 14:21 61-persistent-storage-
edd.rules
-rw-r--r-- 1 root root   777 2009-05-27 23:01 70-persistent-cd.rules
-rw-r--r-- 1 root root   559 2009-05-27 22:35 70-persistent-net.rules
-rw-r--r-- 1 root root   390 2008-04-11 14:21 75-cd-aliases-
generator.rules
-rw-r--r-- 1 root root  2251 2008-04-11 14:21 75-persistent-net-
generator.rules
-rw-r--r-- 1 root root   563 2008-04-11 14:21 80-programs.rules
-rw-r--r-- 1 root root   171 2008-02-27 14:22 85-alsa.rules
-rw-r--r-- 1 root root  1444 2008-03-28 00:25 85-brltty.rules
-rw-r--r-- 1 root root    84 2008-03-28 23:26 85-hdparm.rules
-rw-r--r-- 1 root root   723 2008-03-25 13:25 85-hplj10xx.rules
-rw-r--r-- 1 root root   126 2008-04-15 05:36 85-hwclock.rules
-rw-r--r-- 1 root root   708 2007-09-20 02:25 85-ifupdown.rules
-rw-r--r-- 1 root root   950 2007-10-23 19:03 85-pcmcia.rules
-rw-r--r-- 1 root root  3017 2008-04-11 14:21 90-modprobe.rules
-rw-r--r-- 1 root root    90 2008-04-21 22:15 95-hal.rules
-rw-r--r-- 1 root root   233 2008-04-11 14:21 95-udev-late.rules
-rw-r--r-- 1 root root  1224 2008-04-11 14:21 README


after that i excuted all these commands
    sudo /etc/init.d/udev restart
    sudo ./adb kill-server
    sudo ./adb devices

but the list of devices attached is empty . My SD-Card wasn't also
mounted.

Can anyone help me to get Samsung galaxy working with adb?

Thanks

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

2. HOWTO: change the xml keyboard AZERTY to QWERTZ ?

Hi everyone !

I want to change the localisation of my virtual keyboard.
Now, I've an AZERTY keyboard (it's the French localisation), but i
would prefer the Swiss-French localisation of the keyboard: QWERTZ
(like the Swiss-German Keyboard).

I just want to modifiy the order of some letter, not really remade a
complete localisation.
I've searched on the doc, and i've founded some information about the
XML file that contains the keys matches:
http://developer.android.com/reference/android/inputmethodservice/Keyboard.html
How can i found this file on my phone and modify it ?

Thanks for your help !

Leno

PS: it's funny, the emulator have the Swiss-French localization (but
not complete :-( )

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

3. android plugins....

4. DialerFilter

5. Official Google Android Developer Phone G1 (running in Canada) needs Cupcake!

6. Android Benchmark Suite

7. Improving Notepad code