how detect an external usb keyboard - Android Software Development

Hi,
my device is an Archos 7 home tablet based on Android 1.5. I connect
an external usb keyboard by means of a microusb host adapter.
I am developing a virtual keyboard for disabled users and I am writing
a scan mode for this input method; the virtual keyboard should be
detect a keypress from the external keyboard. How can I do it?
I am trying to create a onkeylistener, but it does not work.
Best regards,
Pinguinodaddy

I'm pretty sure you cant use a keyboard. Android doesnt have usb host support.

No, I sure that Android 1.5 has the usb host support. If I connect an external usb keyboard by means of a microusb adapter, this keyboard works perfectly.
I am having some problems when I try to detect an external keypress from my apps. How can I resolve the issue?
Best regards.

pinguinodaddy said:
No, I sure that Android 1.5 has the usb host support. If I connect an external usb keyboard by means of a microusb adapter, this keyboard works perfectly.
I am having some problems when I try to detect an external keypress from my apps. How can I resolve the issue?
Best regards.
Click to expand...
Click to collapse
Hello
Would you please try
getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS
Click to expand...
Click to collapse
Hope this works

Related

[INFO] USB host works with female to female USB gender changer

I bought a USB female to female adapter to plug on the end of the charging cord, some things work, some things don't.
List of devices that work:
HTC Hero - Mass Storage mode (works 2 out of 5 tries aprox.)
Logitech G9 - Works, although only default buttons (left, right, scroll, middle) seem to work
SanDisk Cruzer 4GB USB Stick - Works
Generic Logitech wired keyboard - Works, although not all keys do.
List of devices that DON'T work:
Logitech Wireless Keyboard K250
USB external DAC
Generic Logitech USB mouse
I hope it can read usb flash drive too !!! already bought my female-to-female adapter too
I just tried hooking up my HTC hero with mass storage enabled and it seems to be hit and miss? It recognizes it 2 out of 5 times or so.
How about finding and wiring USB from the 40 pin connector
It is a given the 40 pin connector has USB. Does anyone have pinout / mating connector info?
Sweet, can you check external HDD? Powered 3.5 and portable 2.5in if possible?
buri73 said:
Sweet, can you check external HDD? Powered 3.5 and portable 2.5in if possible?
Click to expand...
Click to collapse
Don't have any on hand at the moment, I will possibly have access to an ext HDD tomorrow though and will check it then if I can.
That's great news. I did like having USB host on my GTab.
i'm assuming it's all fat32. it would be nice if ntfs worked out the box.
madsquabbles said:
i'm assuming it's all fat32. it would be nice if ntfs worked out the box.
Click to expand...
Click to collapse
NTFS SHOULD be supported, but yes mine are all FAT32/FATex/ext4
i will have to try again, i built a gender changer, tried it with one mouse, and it did not work so i assumed it would not work for anything, i'll have to try some thumb drives or something.
T3rry1 said:
i will have to try again, i built a gender changer, tried it with one mouse, and it did not work so i assumed it would not work for anything, i'll have to try some thumb drives or something.
Click to expand...
Click to collapse
it seems really picky, it recognized my G9 mouse but not a generic logitech one.
Just speculating, but I would guess that it isn't up to spec. So devices that have looser requirements will work (say it can take 4V instead of requiring 5V), but devices with stricter requirements fail.
did you try a all-in-one type card reader?
or connect digital camera to it?
T3rry1 said:
i will have to try again, i built a gender changer, tried it with one mouse, and it did not work so i assumed it would not work for anything, i'll have to try some thumb drives or something.
Click to expand...
Click to collapse
Isn't that because USB mouse support is not in Honeycomb yet?
FrayAdjacent said:
Isn't that because USB mouse support is not in Honeycomb yet?
Click to expand...
Click to collapse
No, Usb mouse is supported by HC. You can use one with the dock. This is more likely a power thing. The port's main use is power in and data, not power out. It may have strange limits.
cyberguest said:
did you try a all-in-one type card reader?
or connect digital camera to it?
Click to expand...
Click to collapse
don't have any of those, sorry.
Picked up a USB female to female plug today, and proceeded to plug in various drives, mice, Phoness etc, but no sign of anything happening at all. Is there something else I'm missing here? Cheers.
Can anyone with an SD/card reader see if it's recognized?
I'm going on vacation soon and would love to back up my photos to the TF.
Thought about this 2 days ago and bought one yesterday. Tried to plug in my Inspire 4G, external USB HDD and USB jumpdrive. None of them worked.
Merlin_AZ said:
Can anyone with an SD/card reader see if it's recognized?
I'm going on vacation soon and would love to back up my photos to the TF.
Click to expand...
Click to collapse
I tried a multi card reader and it didn't work. I didn't try a card reader that reads only SD (don't have one) but I doubt that it's gonna work given everything else I tried didn't (usb mouse, usb flash drives, Nikon DSLR)

Using mice and USB keyboards on Note

The GNote has the ability to act as a USB host, which allows one to attach a flash drive directly to the Note as external storage.
Can we expect devs on the forum to develop USB drivers so we might use other peripherals such as keyboards and mice on the GNote?
I come from a Notion Ink Adam tablet which runs Froyo and was able to work with plug and play USB keyboards and mice.
Would be a very nice feature to hafe on the GNote.
Sent from my GT-N7000 using Tapatalk
I don't have the NOTE yet, but on my present device I can attach a USB Keyboard directly to it and it works. I don't need any driver.
Did you test it before opening this thread?
Please confirm
Remark: And same for mouse!
My USB keyboard works fine
Tried several mice and one worked, most didn't (not sure the model name of the one that did, it as a Logitech, will be back in the store later this week and confirm).
http://www.youtube.com/watch?v=QYlfuNIGQsw bluetooth mouse works too
Yep BT keyboard mouse work also, amongst other things:
using usb mouse on note.
so you guys are saying that one can use a usb mouse on the note. i guess first you need an adapator or an usb mouse with a micro plug, then just plug and go.
I tested out my razer orochi BT mouse and it worked fine. Don't have any use for it yet until I get a small BT keyboard I can use.
Hi Pere,
To be honest. I read a review which stated that in practice with the OTG USB adapter only flashdrives and externally powered hard drives seemed to work and that the drivers for keyboards and mice would be needed for them to work.
This did not stop me from ordering the adapter, which still has to be delivered. Will obviously test myself once it arrives.
Would be delighted if one can plug in any USB keyboard.
Thanks for clearing it up.
Pere said:
I don't have the NOTE yet, but on my present device I can attach a USB Keyboard directly to it and it works. I don't need any driver.
Did you test it before opening this thread?
Please confirm
Remark: And same for mouse!
Click to expand...
Click to collapse
Sent from my GT-N7000 using Tapatalk
litening said:
Hi Pere,
To be honest. I read a review which stated that in practice with the OTG USB adapter only flashdrives and externally powered hard drives seemed to work and that the drivers for keyboards and mice would be needed for them to work.
This did not stop me from ordering the adapter, which still has to be delivered. Will obviously test myself once it arrives.
Would be delighted if one can plug in any USB keyboard.
Thanks for clearing it up.
Sent from my GT-N7000 using Tapatalk
Click to expand...
Click to collapse
That's the GSMarena review and they are quite incorrect. My USB keyboard works perfectly, as did the USB mouse I tried instore. You will of course need a USB OTG adapter.
NZtechfreak said:
Yep BT keyboard mouse work also, amongst other things:
Click to expand...
Click to collapse
Anyone know what that gaming controller is called and where to get from thx.
NZtechfreak said:
That's the GSMarena review and they are quite incorrect. My USB keyboard works perfectly, as did the USB mouse I tried instore. You will of course need a USB OTG adapter.
Click to expand...
Click to collapse
Nice!! Thank you.
Two more questions, one of them for people using not standard English keyboard ( French, Spanish and so on...) does the keys layout meet with the written characters? I mean: symbols as ;/"? are in different keys? or does they match with the written ones?
The second question or test: Can we use a Host USB to connect together both keyboard and mouse simultaneously to the note!?
Who will be the first in test?
Thanks in advance
Good question! I would like if one could answer that as well.
I guess it would require a OTG usb cable + USB hub. Does the Note support for a USB hube? I mean, would the USB host in the Note allow that?
Also, if it works with an USB hub, then I guess you would be able to both output screen to hdmi, charge and use USB keyboard/mouse at the same time?
An Italian coleague has already answered the USB hub question with this video: And yes, we can!
Regarding the simultaneous connection of mouse, keyboard and HDMI would be great but I'm afraid that there are technical reasons to doubt that it's possible...
What about the special signs question? Any idea?
NZtechfreak said:
Yep BT keyboard mouse work also, amongst other things:
Click to expand...
Click to collapse
I am super curious about what showed after 4:00 is that windows or some theme looks like windows?
If Note can operate windows that would be wonderful!
NZtechfreak said:
You will of course need a USB OTG adapter.
Click to expand...
Click to collapse
Could somebody explain what exactly is a 'USB OTG Cable' ?
Is it just a cable with a male micro usb plug at one end, and female std. USB plug at the other end ?
Or it needs some magic electronic add-on inside ?
Thanx in advance
All PS\2 keyboards and mouses works great too.
http://forum.xda-developers.com/showthread.php?t=1440077
If you use a USB keyboard, does that mean you can't connect it to a monitor as well? You need a bluetooth keyboard to do NZtechfreak's setup, correct?

[Q] micro usb port hosting

Basically, I just want to know if you can use a keyboard with it that has a micro USB plug. Thanks in advance if you can help me out.
I believe the manual says it supports USB input devices. Mouse and keyboard should work fine.
Nospin said:
I believe the manual says it supports USB input devices. Mouse and keyboard should work fine.
Click to expand...
Click to collapse
Great! Thank you for the speedy answer.
Yes you definitly can
Nexus 7 Manual said:
You can connect a keyboard, mouse, or even a joystick or other input device to your tablet via USB or Bluetooth and use it just as you would with a PC.
You may need an adapter to connect the keyboard or other device to your tablet's USB port. To connect more than one USB Device at the same time, usa a powered USB hub to reduce the drain on your tablet's battery.
Click to expand...
Click to collapse
Can heartily recommend the Apple Keyboard actually, it pairs up nicely to my Galaxy Tab. That plus a BT mouse and I'm gtg for support issues if I'm out and about. USB connectivity would be good, but the BT solution for keyboards opens up a fair few decent choices. Not tried other keyboards, but the Apple one works as it's so thin to slip in a light bag.

[Q] How do you connect a bluetooth keyboard with a usb to a nexus 10?

Hi
I want to be able to also connect my bluetooth keyboard with USB to my nexus 10 device.
My device is rooted and I have an OTG cable.
When I connect the bluetooth keyboard to my nexus 10 from micro-usb --> USB --> micro-USB my device recognizes the USB connection but not the type of connection (no driver). So it doesn't see that it's a keyboard. I was wondering whether one of you smart IT people knows how to make my Nexus recognize a bluetooth keyboard, it does recognize a normal usb keyboard.
I already googled it (and searched on this forum) but I couldn't find a solution.
Thank you in advance for your attention and time.
If you are wondering why --> it's because I think a bluetooth keyboard will drain more battery than a usb keyboard.
Tangonaf said:
Hi
I want to be able to also connect my bluetooth keyboard with USB to my nexus 10 device.
My device is rooted and I have an OTG cable.
When I connect the bluetooth keyboard to my nexus 10 from micro-usb --> USB --> micro-USB my device recognizes the USB connection but not the type of connection (no driver). So it doesn't see that it's a keyboard. I was wondering whether one of you smart IT people knows how to make my Nexus recognize a bluetooth keyboard, it does recognize a normal usb keyboard.
I already googled it (and searched on this forum) but I couldn't find a solution.
Thank you in advance for your attention and time.
If you are wondering why --> it's because I think a bluetooth keyboard will drain more battery than a usb keyboard.
Click to expand...
Click to collapse
Are you sure the keyboard works as a USB keyboard when connected? Usually the USB port on bluetooth keyboards is only for charging which might be why you haven't had any luck...
chaosdefinesorder said:
Are you sure the keyboard works as a USB keyboard when connected? Usually the USB port on bluetooth keyboards is only for charging which might be why you haven't had any luck...
Click to expand...
Click to collapse
Oh I guess it only connects to the accu then
Thank you
Tangonaf said:
Oh I guess it only connects to the accu then
Thank you
Click to expand...
Click to collapse
one way to check this would be to plug the USB cable into a PC and see if the keyboard works there or not?

Connecting External keyboard to Lenovo A3000

Hi Guys,
Did anyone tried connecting external USB keyboard to Lenovo S3000 or do we have an option to connect a an external keyboard here..If yes which is the best keyboard to get
Cheers,
Sam
mbsam2003 said:
Hi Guys,
Did anyone tried connecting external USB keyboard to Lenovo S3000 or do we have an option to connect a an external keyboard here..If yes which is the best keyboard to get
Cheers,
Sam
Click to expand...
Click to collapse
Practically, any keyboard that does not require any special drivers will work. I used a USB mouse recently and it worked fine. I think it will work with almost every consumer use keyboard. I'd have tested it with my wireless keyboard if I hadn't broken my USB OTG cable.

Categories

Resources