How do you effectively develop, debug, and test an android app that is based on Bluetooth.
I have been googling and searing stack overflow for the answer to this question and I am not getting a clear answer.
I understand that the emulators do not support Bluetooth. I also know of various guides explaining the functions, classes, and such, and I know people have mentioned that setting up a Bluetooth emulator is possible with Virtualbox. I even came across some old projects like BT-Sim that seemed like a way to create fake BT signals (though if my android emulator doesn't support BT, it doesn't help too much)
But no solid guide on how to get this going. It just likes a few scattered puzzle peaces that need to be stitched together. It makes me wonder how app developers reliably make BT enabled apps?
Are there any guides that dissect how to do this process? I imagine the steps to accomplish are:
Create a custom emulator on Virtualbox that can simulate Bluetooth?
Get the AVD Manager to talk to this emulator so my compiled Android code will work with it
Run a Bluetooth simulator to send BT signals over a port in your computer
(I don't really know how to do either of those 3 though!)
My overall goal is as follows:
Create an app that will collect data from a Bluetooth transmitter
But first, create a simulator on my computer that can talk to my android emulator as if it were the real thing
I'll be honest, I do find it odd that the Google folks don't allow Bluetooth emulation on their AVD. I understand not allowing real telephone calls, but I don't see how Bluetooth can be abused like that.
Anyway, any help in setting up Bluetooth would be greatly appreciated and hopefully help many others out there!
NOTE: I am using the standard Eclipse + Android SDK setup with AVD to do my Android development. Planning to use API 10. However, if I need to use a different set up, I am fine. As long as it comes with a step by step guide! That would be very nice.
Old question, but it's still unanswered. If you have a physical device, that seems easiest way to go. If, like me, you don't have a device it's still possible to develop with bluetooth and android.
Download an android x86 iso, load it into virtualbox with bridged network setting and install it.
Plug in your bluetooth dongle and select the device from the 'usb' menu, alternatively you can set a device filter in the vm's settings page.
Now just use adb and connect to it, you can find the ip by going to console (alt+f1) and typing netcfg or ifconfig eth0. You may also need to type adbd on the android console - I do, but I don't see many people mention it so seems it's not always needed.
It still works with eclipse, and is much faster than the emulator. Even when I'm not doing bluetooth dev I use the vm rather than the emulator.
Related
Greeting QiSDK Pepper robot community !
We know that there is an option to make Pepper QiSDK Android to reboot with full sensor check (long reboot), but we have forgotten how to make that happen and can't find instructions.
Please help :)
The Qi SDK relies on the Android SDK, and the latter does not provide a programmatic way to reboot the device. So the short answer is that you cannot.
But with a bit of creativity and a bunch of know-how, who knows...
Though it is not documented, the API for NAO 2.8 usually works for Pepper 2.9. So you can use libqi to connect, authenticate, and call ALSystem.reboot. Note that you will be able to authenticate only if you know the password of the robot, i.e. if you own the robot.
I had other bad ideas to reboot the tablet, but as discussed in the comments, this is not relevant since you want to reboot the robot and have it do the full check-up. I keep them here for the record:
I found this page about "Device Control" that mentions rebooting a device remotely. But it comes as part of a broader framework that seems deprecated, so I doubt it works.
You could have access to the tablet via WiFi and run adb reboot remotely. But leaving the remote debugging enabled is not a good idea in terms of security.
You can certainly access such system-level methods if you root the tablet. But this is a staggering security hazard.
So ill do my best to explain. I'm wondering how easy (or hard) it would be to make an android app that talks/sends and receives data from a PC or mac, even more so with flash.
so for example, I first make a flash application on my PC / Mac, lets say it has a MovieClip of a square on the stage. That is all for that part. Next I make and android app that consists of one button. when I press that button (on the android app, on the phone) the square on the flash desktop application moves to the right or left by ten pixels.
so ultimately the mobile app is controlling the desktop flash application.
Iv searched and searched but I'm unsure of what keywords to really use to find what im looking for.
Can anybody shed some light on how difficult this is(if its possible), or any documentation / tutorials on this subject?
The Bluetooth standard includes a profile called Bluetooth HID. If you write (or download!) an Android app that implements this profile, then connect your Android device to your PC, it basically becomes a Bluetooth mouse or keyboard. It would require no programming on the PC side, as both Windows and Mac support Bluetooth peripherals.
Implementing a network protocol on the device side is usually really low-level stuff. If your programming experience is only in flash, you'll probably find this tough going (you would likely learn a lot!). Luckily, there's the Android HID library. I don't know how good it is (I just found it for this answer), but it looks done, so it would save you from having to do the most difficult parts.
You can use adb to accomplish this, which is how many of the tethering apps get around carrier restrictions. Here are some sources:
Adblib is a "library to communicate with android devices with TCP over USB without requiring the Android SDK":
http://code.google.com/p/adblib/
Thread about Adb over USB:
http://groups.google.com/forum/?fromgroups=#!topic/android-developers/JsDTBimHpOA
adb itself:
http://developer.android.com/tools/help/adb.html
Here are some other links to some other Android USB topics:
http://developer.android.com/tools/adk/index.html
http://developer.android.com/guide/topics/connectivity/usb/host.html
http://developer.android.com/guide/topics/connectivity/usb/accessory.html
http://developer.android.com/reference/android/hardware/usb/UsbInterface.html
http://developer.android.com/sdk/win-usb.html
I am looking for a way of displaying an analog video stream on an android phone. On a pc/mac/etc you can achieve this using a cheap usb analog-digital converter such as a grabby: http://www.terratec.net/en/products/Grabby_82248.html, and then view on VLC, for example.
Would such a thing work (in theory) on android if the proper drivers were available? (ie. are there any hardware issues which make this impossible?)
Does anyone know if such a device with android drivers is available?
Ultimately I want to make an app which interfaces with the grabby (or similar device) and allows the user to view video on the android and capture and send short clips.
First of all the Android device needs to support USB Host. This limits your userbase significantly.
Then there is the problem with power. Some USB Host devices will be incompatible simply because an Android phone will not be able to push enough power through to port to get it running properly.
I'm not sure about the drivers, but I'm 99% sure it won't work "out of the box".
You should certainly take a look at THIS project. It is pretty similar to what you are trying to do. Maybe you should consider getting in touch with that person.
EDIT:
Based on what it took to get that DVB-T dongle running in the project i mentioned above the chances of creating an app that everyone will be able to simply download and use are EXTREMELY slim. Getting that dongle running required using a modified kernel and special scripts. Of course I could be wrong. You can continue the research yourself or wait for someone with more experience than me to reply.
I am writing an Android 2.1 application that needs to get data from a USB device. The USB device is an embedded system i created. The embedded system has no OS. Also, the android device does not send any data to the embedded system.
How should i go about this, I'm guessing i will need to make a high-level driver to communicate from USB to the application. But, i have never made a Linux driver before.
If creating a high-level driver is the best way to do this, can someone give me some references so i have somewhere to start.
If there are other ways to accomplish this i would also like to hear about it
-Thanks
The Android Open Accessory Development Kit is where you should start looking. Like many of other Google's documents, the tutorial is reasonably complete and should provide you with a good starting point
Good Luck!
I think you will need to recompile Android kernel to add usb device support.
It can be an option if you are working on some dedicated project and only one Android phone should be supported. If you want to support all kinds of Android phones, I can suggest to implement USB host in your embedded system( if it is possible), thus your Android phone can be connected using ADB protocol.
It's pretty clear that the current emulator does not provide Bluetooth support. While there appears to be a third-party emulator available that might work it seems to come with warnings about bugs that tend to suggest that I might be better off spending my energies elsewhere. Does anyone know of progress, and perhaps even a target, for getting Bluetooth support built into the device emulator in the Android SDK Tools?
There is a workaround available though that lets you utilize your computers bluetooth and still have the benefits of debugging on the spot, so to say.
You can install a virtual machine android and have it use your onboard bluetooth. There is a readily installed image for this available, just google it. You can then have adb connect to this device as you would with any other real or virtual device, it is also described if you look it up on the net. I hope this helps.
Still, build in bluetooth support is something I would love the emulator to get enhanced by.