Accessing USB-Port - Android Software/Hacking General [Developers Only]

Hi xda-developers,
I have a serious problem with accessing the usb-port with my unrooted htc desire.
I just want to connect a switch/circuit breaker to my cellphone via usb. And than I want to be able to react on the event if somebody pressed the switch. It's only this little event that I wan't to react on.
I searched the web and found two ways to achieve my goal:
1.) Get a Bluetooth device and interact with that.
2.) Root the Desire and make/solder a usb-to-serial cable
But seriously? A Bluetooth device just to recognize if somebody pressed a hardware button? And I want to share this project so if possible I would relinquish the need of a rooted device.
So now, after hours of web-searching and reading references, I ask you, the awesome xda-developers-community: Is there any easy way to access the usb-port from within my Android-App or the Android-Scripting-Engine?
Every hint is appreciated.
.:LordAlien:.

No one an idea? Or just a little hint where I could read furthermore related to access the usb-port?

It seems like you would need a bit more than root and a USB-to-Serial cable.
Maybe if you only need one hardware switch you could use the mic button input, or play a sound to the mic input? Or use a magnet and the magnetic sensors (electromagnet, or even a neodym magnet glued to your hardware button).

Thanks for your replay.
I already read about the usb-host-capabilites, but I thought if I only want to detect on little signal I would not need the whole usb-host stuff.
Thanks for the Idea with the magnetic thing, but if I really need another device to realize my switch I will stay with bluetooth.
/edit: I thought off buying a littel&cheap bluetooth mouse and interact on the click. Would it be possible? Can I actually connect a bluetooth mouse to my android mobile phone?

I don't think a Bluetooth mouse would work, at least not out of the box. Most Android devices don't fully support the Bluetooth HID or SPP profiles. It's missing software, not hardware. But I saw that the Dell Streak apparently supports keyboards and mice.
BlueInput only supports keyboards, it seems. It doesn't need root. So apparently it should be possible to do the same for mice, but I didn't find anybody doing it yet. But maybe you can ask the BlueInput people whether mice would also work, just without a visible pointer (because Android doesn't have a visible mouse pointer). That wouldn't matter to you, but it would be useless for normal mouse users, so perhaps they just don't advertize that BlueInput can talk to mice, too.
Or maybe you can find a cheap headset which is supported by Android. The answer button should work.
Oh look, with root it works apparently.

Yeah I think you are right again. I only thought of the volume buttons on a headset therefore I suggested a mouse.
Is there list of compatible bluetooth headset? Because I already have one a Jabra BT2015 which is not supported (at least I can't get it working).

Related

What does the following term mean regarding different keyboards

I am currently looking to buy a bluetooth keyboard with mouse but encountered some new terms I hardly understood. I was wondering if anyone would be kind enough to explain the differences.
I do understand and know how a BT keyboard and mouse work. No problem with that, but some keyboard only mentions: wireless keyboard, wireless laser keyboard, wireless optical keyboard, optical laser keyboard, etc...
OK, so they are all wireless, but that does mean they are all connected via Bluetooth? The words "optical" and "laser" threw me off. What do they mean? Should I assume if the word "wireless" is in the product description that they are referring to Bluetooth connectivity? But after reading the description, I did not encountered the word Bluetooth, so is there another way to be wireless other than BT (excluding IR of course)?
Forgive me for my ignorance, but I don't want to buy something and regret it later.
...
Most wireless keyboard+mouse combinations usually use RF transmitters, a small usb stick.
Bluetooth is not as common but a good alternative especially from this forum's viewpoint: you can use it to connect phone too You can either use computer's built-in BT or usb stick usually supplied with the set. Built-in BT is good solution with laptops.
Optical and laser refer to the mouse and the technology it uses to detect mouse movement. Normal consumer does not really see
any difference between these two but hardcore gamers might.
Hope this helps a bit

A2DP Connect - Multiple devices

Ok, perhaps this exists already and I'm just blind to it-
I'm trying to find a way to make initiating an A2DP connection between multiple headsets easier.
No, I don't mean at the same time- My goal is perfectly rational and rather simple: I have multiple A2DP receivers (headset, home stereo receiver, 2 car stereos), and I want a simple way to connect to them from the phone.
Normally, one has to click through a staggering number of screens to accomplish this.
Start-Settings-Communication-Bluetooth, select headset, press-and-hold for context menu, hit "Use as wireless stereo". This should be a much simpler process, especially since standard feature phones can do this in a few clicks.
I thought that perhaps A2DP Toggle was the answer, since it claims to be able to toggle A2DP/Speaker from the today screen.
The problem is, A2DPToggle only supports one headset.
In other words, it only reconnects to the last device it was used with. If I just used BT Stereo in my car, when I get my wireless headphones and hit the Toggle, it will sit trying to connect to my car instead of finding my heaphones.
Eventually it will give up and timeout.
What I want is an app that is easily accessible that will either A) display a selection of previously paired headsets that the user can pick from, or B)cycle through a list of headsets, trying to find one that is nearby and on (I understand that this may prove more complicated and less reliable than option A).
That being said, is there an app that does this, or something similar, already? If not, anyone want to help me develop one?
Moved to Q&A
why don't you suggest this option to the creator of A2DP Toggle.. maybe he'll add it.
I've tried already, mentioned it a while back and got a "maybe in the future" sort of response. I posted on his thread again a couple of days ago, and started this thread in case he's still not interested.
I'm honestly pretty surprised no one else was interested in this before me- am I the only person who has more than one a2dp receiver paired with his phone???
I don't use it at all.. but I can see why someone would
as it seems nothing like this exists.. maybe you can change the thread's subject to [REQ] to request an application.. maybe another developer would like to work on this.. tho.. sometimes people demand some money for it.

Odd request/question

so... I'm not sure if this is the right place to put this... I picked this thread because ultimately it will become an accessory for my g2, but if its in the wrong thread, please move thanks
anyway I have an idea, but I do not have/cant quite comprehend the programing skills, electronic hardware productions skills that I would like for this project of mine
here's a rough schematic (ok, very rough) of what I'm looking for
http://flickr.com/gp/kamontryst/U815H6
basically, I want to take the key less entry fob for my car, and essentially merge it with something (adk/Arduino), make an app to control my doors/ignition via wifi or bluetooth. I'm pretty sure this is possible, all it needs (according to my comprehension) is a few electronic switches to attach to the key fob main board, and have a chip that interprets the signals received by the phone... Am I correct in my assumptions? if so, how could I go about doing this in the simplest fashion?
i tried googleing, but alas, as this is not my forte, I do not really know where to start/what to look for
thanks for everything
That's actually not a bad idea, but I can't help but think there's too much potential for abuse (what's stopping people from changing their version of the app with smali/baksmali to hack into your car?).
blackknightavalon said:
That's actually not a bad idea, but I can't help but think there's too much potential for abuse (what's stopping people from changing their version of the app with smali/baksmali to hack into your car?).
Click to expand...
Click to collapse
that is true yes... but at the moment, I'm pretty sure id be the only one in my immediate area that would have the knowledge of/capability to control said device... I'm sure if something like this does go mainstream (i.e. Gm's new on-star app) then it can become secure... but for now? proof of concept works for me
Interesting but close to impossible. Most of these devices use coded radio waves to commubicate with the car, which the phone cant produce. So using it as a remote itself is out of the question.
But from what i could understand you want to use the remote through your mobile connecting eachother with BT? How is the remote gonna handle BT connections? Also connecting eachother and making the phone send commands to it means you have to decode each function for evey single car out there.
Sent from my HTC Vision using XDA App
dumraden said:
Interesting but close to impossible. Most of these devices use coded radio waves to commubicate with the car, which the phone cant produce. So using it as a remote itself is out of the question.
But from what i could understand you want to use the remote through your mobile connecting eachother with BT? How is the remote gonna handle BT connections? Also connecting eachother and making the phone send commands to it means you have to decode each function for evey single car out there.
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
I apologize for not being specific/clear... I want to build a device (basically a Bluetooth/WiFi receiver of some sort) that can interpret commands sent to it from an app from an emitter (my phone or other Bluetooth/WiFi device) that in turns controls a series of switches attached to the main board (would take some hardware modding) of the key less entry. so basically, I want a middleman device I can leave in the car attached to the key less remote. For my remote the contacts of the rubber buttons wear off extremely fast (3-5 months) and I feel this would be an elegant (if not over-complex) solution.
Key fobs are made with specific radio waves, when you get a new one, the car has to be reprogrammed to accept it, not the key fob. Last I checked, the fobs do not have any sort of jtag or input at all. This wouldn't be possible to the best of my knowledge. This is to prevent theft, and crossing of fobs. I believe they use rolling codes also.
I would check out how those remote controlled wifi drone planes work... im sure something like that would give anyone alot of needed info.
ok, here is a clearer schematic (i think)
So I want to basically solder several electronic switches to the remote key fob (the fob buttons can be controlled via rerouted switch)which in turn are controlled by an micro controller chip that interprets/relays signals received by an android phone over WiFi/Bluetooth with a custom made app (not necessarily put into the market)
what I need help with is building/programing the controller board that receives signal "a" (unlock doors) relays signal to switch "a" which would "press" the corresponding button on the key fob, etc.
I know that it is a complex hardware modification, and a very long round about way to just replace the rubber keypad/contacts for the key fob, but hey, I'm a geek and I like to make things complicated, just to make things easier
does that make better sense?
So this wouldn't touch the door locks yet, but it would be a start.
http://www.engadget.com/2010/01/20/the-diy-10-prepaid-cellphone-remote-car-starter/
basically, instead of an app, you can call the phone that you've wired into the ignition system. this would be your remote start. now, if you had a phone with a host app that could link with your main phone app to send the appropriate signals via the vibration motor circuit, could that help at all?
you would have to find the correct fuses and connections for the ignition and locks, but a cheap phone with wifi would be better than soldering or modifying your current fob, right?

[Q] Pairing Tablet as Bluetooth Receiver?

This topic is pasted all over the net and it doesn't seem to be getting much attention, however I think it should be brought to a better light.
The idea is simple: Enable your Android Phone or Tablet to become a bluetooth reciever(to replace a headset or bluetooth speakers) and broadcast audio to the device and broadcast microphone from the device.
This could be used in several different applications:
1. Using an Android Tablet as a Car Stereo Interface
(Connect Phone to Tablet Via Bluetooth and use it as a hands free speakerphone, or aux out to your stereo)
2. Multiple Android Phones
(Have a business and personal phone? Answer all your calls from one.)
3. Phone or Tablet as Bluetooth Speaker/Mic
(Skype, PS3, Xbox 360, TV, Google Voice)
I would use several of these options on a daily basis, and would most definitely pay good money for an app like this.
So my questions are:
1. Is this possible?
2. If it is, how hard would it be?
3. If it isn't that hard, why hasn't someone done it yet!?
Bump if you want this too!
Just wanted to bump this because we need to put our heads together here and get this done. I need this capability for number 1 on your list of potential uses. I also would pay good money for an app that enabled this. Phones and tablet are rooted and ready to modify whatever is needed. Ii've bumped a couple other threads today as well.
I would also pay for this!
I have been looking for this for a while. I use an old LG Eve in my car and my Captivate's Wifi connection for GPS but I would love to have it work for calls and music too.
I would pay as well.
bumping this just to say that I'm going to research the rules and process for starting a bounty. obviously the smart people we need to work on this need motivation lol
Sent from my GT-P6210 using XDA Premium HD app
Hi there,
just wanted to leave an incentive kind of post to say that I've also been looking for exactly the same thing.
My hunting on Google play just stopped after finding this post on XDA.
It's a kind of confirmation that there isn't a solution yet.
Since our rooted androids are more than capable of acting as a Bluetooth receiver, whether they may be based on new or older hardware, this seams like a very logical step in their lifecycle instead of getting forgotten in a drawer full of old and unused electronic waste.
Some doubts:
is a2dp required for this?
Is a2dp hardware related or simply a software feature?
Personally, I could live with a simple one way communication from a phone with mobile network (sender ) to the receiver. The used mic could still be the one on the sender side.
Wouldn't even need to have the receiver in a visible place as I would just connect a stereo cable from its headset output to an aux input on a hifi or a car stereo to hear music or acting as a hands-free system.
Hope this gets some real attention.
Cheers
In one year, nobody found a solution??
I can't beleive there is STILL no progress on this. Maybe I'll try asking a dev that has made similar apps the feasibility of this. There are so many practical uses for this that I cannot beleive no one has capitalized on it.
This would be a killer app if done right. Who here doesn't have an old phone laying around gathering dust? This could start off small; simply enabling the phone/tablet to be essentially a Bluetooth speaker, but then gain features and an interface using A2DP, which would evolve it into a killer way to make any car (with at least a tape deck) able to have full Bluetooth integration and control. I really hope someone can do this!
Bump
Bkb -> p -> PC (either wifi/blu/usb)
yeah so a spare bluetooth phone that connects between a keyboard and PC. Acting like a BT dongle. No way I'm spending 10 bucks for that. if an app...maybe a buck but would prefer free.
looking for this too. Wanting to turn this old phone into a bt audio receiver
Wow, endless searching and now this thread and still nothing :/ i need it for the first idea you listed, did you ever find something?
https://android.googlesource.com/pl.../java/android/bluetooth/BluetoothHeadset.java
Currently the Android Car Multimedia receives Bluetooth Stereo Audio from Phones (Andoird/Apple), how they do it?
Any news?
So many years and still nothing?
May be this is not the right way to do.
I know this is a crazy old subject but others have commented so I don't feel so bad.
I want to make my own android system for my car. I have everything I need for it (hardware/software-wise) except for this one thing.
A few years back there used to be an app called Tablet Talk, it's not exactly what we want but I'm still willing to settle for something like that. The way it works is phone->tablet->handsfree Bluetooth speaker. You could make and receive calls (including seeing the contact names/phone numbers on the tablet) from the tablet itself, then the audio/microphone goes to the handsfree device. Another added feature was when a call is happening the app stops all audio coming from the tablet until the call is done.
Like I said before, it's not perfect but at this point, I don't ever see it happening any other way. I found the app a few days ago, it doesn't exist on the app store anymore, unfortunately, I could get it to run. It just kept crashing.
If anyone knows of something then please let us know.
Years later, found just this thread: I want to do similar thing: Use a private phone (for my sake rooted with custom fw) as a hands-free bt device with an unrooted business phone (non-rooted and secure managed with company tool). I also don't want call forwarding or similar. Just do and answer calls, use phone book and call list via bluetooth like my car radio do for years.
Is there still no solution?

Emulate an Iphone USB interface to a car radio?

I recently purchased a car that has a USB interface for the radio. My wife's Iphone fully integrates with it, of course, and via the radio's interface but the Samsung only mounts as a connected drive.
I have read other thread where people were able to force their Samsung into car dock mode by modifying a USB cable. Is there anyway to just do that in software?
you misunderstand what car mode is.
Good luck! I switched back to my iPhone for this reason alone. I listen to a lot of podcasts and I couldn't get this to work via the USB interface and I don't have bluetooth on my head unit. I can't seem to get the newest update to see if that works either. Would love to know if someone has a solution that doesn't require making your own cable.
yo sleze..what model car if i may ask?
i made my own auxiliary input for my car(i know its not a big feat) with an old dsl filter a soldering gun and some resistors and capacitors.. i might be interested in creating a usb interface for my car and then maybe i can give you some insight .. big maybe
well you will never get the headunit to command the phone, android simply doesn't support anything like that. but you can get audio over USB which is triggered by shorting a couple pins through a resistor. ill have to look up that thread but there may already be a dongle or cable out there to do this. it may not be say "android carmode" but if you find the name of the USB standard that they use to trigger it you can find the appropriate cable or dongle.
isnt there a usb headset available that can stop/start music and next track functionality ..if so you could (in theory) make a usb interface that would allow the head unit or in my case steering wheel control to work similarly?
no it wont command the phone. the framework and apps don't have an interface for that. plus the headunit would need special drivers if the phone had that capability. the issue with android is too many manufacturers do things different so unless google comes out with that on a nexus and tells maunfacturers the way it needs to be implimented I don't see any hope.
there might be a way to echo the commands through adb if you have a computer in your car. but I guess you'd have to know how the music app works for that.
we All know apple has the accessories market down pretty good. even though some older accessories don't work with the newest hardware. that's the one thing apple is good for, a wide accessory market.
now if you have a Bluetooth controler and it uses the right protocol to work with thw samaung bluetooth stack then you might be able to map keys to certain functions with an app or simple configuration file editing. but as far as USB goes I don't think android is designed to host USB input devices. there is limited otg usb support on certain special galaxy s and nexus 1 and nexus s kernels but nothing native.
maybe some 3rd party root app could eventually be developed but I haven't heard of one yet.
besides all that, who knows if the head unit will know to go into audio over USB mode in the first place, even if you get the phone in that mode, will the headunit be looking for USB storage and an iPhone interface only? was it designed to accept USB audio other than an iPod interface?
well with my car BMW mad a usb interface for ipod/iphone.. i hate mac so scratch that.. i also have a usb interface(i can control radio/nav functions via carputer) that is designed to work with I-BUS (intelligent input bus) which is what some BMW's used for audio/nav integration. some newer models actually come with a usb input that was designed to work with most media players..so i thought maybe with some time/frustration/rum..i might be able to make it work..
mejori said:
well with my car BMW mad a usb interface for ipod/iphone.. i hate mac so scratch that.. i also have a usb interface(i can control radio/nav functions via carputer) that is designed to work with I-BUS (intelligent input bus) which is what some BMW's used for audio/nav integration. some newer models actually come with a usb input that was designed to work with most media players..so i thought maybe with some time/frustration/rum..i might be able to make it work..
Click to expand...
Click to collapse
It still to my understanding that on BMW iDrive system will have full integration with iOS. We had a 2010 5 series at home with all the bell and whistles on it, and even then it would only display song names. With my iPod we got full library options, podcast too. Android will only be able to be used as a mounted devices.
Sent from my SAMSUNG-SGH-I997 using xda premium
I used to have an iPhone and installed this kit http://usaspec.com/product.php?ProductID=18. After switching to android I just use a 2.5mm to RCA cable to plug in to the same unit. Not worried too much about integrating with car controls - I also use a phone mount. Does your head unit have any AUX IN connectivity? Maybe on the rear? If so just play audio through the headphone jack. There's always the lighter socket RF adapter option too, but audio quality with those things can be lame.
Samsung-SGH-I997 Infused 2.3.3
yeah the headphone amp on the infuse has pretty good fidelity too. the headphone Jack might not be as convenient as a single USB that also charges the phone but I'd you want to use the playlists and 3rd party apps like Pandora or Google music its the best way. audio over USB needs the dock or special cable to trigger but I don't know which headunits will support that.

Categories

Resources