Simple HC-05 Bluetooth Communication with Android App - java

Im trying to build up an app for a simple HC-05 bluetooth comm. All i need my activity to do is to find the HC05 module, connect to it, send an int+char and then stay put for a while until the process on the HC05 module ends. When this happens, the app will listen for a end string and show on screen the process is done. I need the comm to be both ways. I dont know where to start, im pretty new at this. Ive seen plenty of methods using getPairedDevices() but i want this to be short and simple like a point on point connection using a wire. Also those methods are like no discovery and listing at all. For those to work i would have to first pair the phone to the HC05. Its no scalable.
I would really appreciate some advice please.
Thanks

Related

How to control a rc toy with Android app

I have a rc drone. I want to create an Android app to control it but I do not know where to begin and how. I browsed the internet and found only one useful tutorial but it required use of Adruino and was through Bluetooth but I want to create my own Android app and not use Adruino or Raspberry Pi. Please help
First you need to connect via bluetooth (If you have no documentation of your RC drone it will be had to figure out the commands etc).
Maybe you can find a bluetooth sniffer program on the www to record what is going on when using the original hardware.
But I think its not worth the effort. To figure all this out will most likely take a lot of time and might not lead to success at all. So I recommend: next time by a drone where the communication protocol is documented or better a SDK is provided with it.
First, you have to figure out, if this drone uses Wifi or Bluetooth for control, or, some custom- build wireless device. If it use custom adapter, working on another frequency, you won't be able to do anything from software, only reverse- engineer control schematics.

Android Test Platform Generator using java

So I have received a task to develop a prototype software for testing the software/hardware component of android. Example: By using the software I can send a command from my PC to my android to change the color of screen display without interacting with the devices(touch,shake or other possible gestures). I would like to know how do I actually start. The whole idea is actually messed up in my mind. Because after a few days of research I haven't found any topic related to what I am going to do. I am still fresh with java so please go easy on me :) Any help is much appreciated.
hi this is very much feasible. First you need is a web service that connects your software to your phone. When you give command on your software, the command should go trigger the web service which in turn should send a push notification to the phone to execute your command. You will be needed to create a some sort of listener and push notification system on your phone(Hint GCM may work). Also you will need to add permissions to your app that is listening to the notifications. Does that make any sense to you?

Android Application Bluetooth Connection Phone-PC

I am trying to develop my Android application which would connect via bluetooth with PC computer and would be able to send data both ways. Like, sending string from Android application to PC and receiving the string on the screen and the other way aswell.
I am on my way to create the application on Android but I was wondering what would be the best way of resolving problem with PC: How would I send and receive the data? Firstly, I thought that I would need separate program but maybe there is some other way?
Could use ANY help on that subject.
There are a lot of solutions for this problem.
Here is the one of possible solutions which could you use as a start point (https://github.com/xamarin/monodroid-samples/tree/master/BluetoothChat).
Here is quick tutorial Simple Android and Java Bluetooth application (http://luugiathuy.com/2011/02/android-java-bluetooth/)
Hope that helps.

How to autoconnect to a bluetooth device when its near programmatically in android?

I am writing an app that creates RFCOMM socket with another device (not necessarily an android), and send some data over it. Right now I can connect and transfer data over the socket, but I also want to be able to stop when the device is far and auto start transfer when the device is near again. How do I know if the device is near again? Any pointers will be greatly appreciated. :)
I'm not aware of a nice, easy Java interface to it. You can connect using the NDK and call the hci_read_rssi() function (you need to write a native java call to this). This requires you to have already connected to the device. It will give you a signal strength reading which is relative to your distance, you will need to tweak this of course.
Many Bluetooth devices will allow you to program their operational mode (ref http://www.sparkfun.com/datasheets/Wireless/Bluetooth/rn-bluetooth-um.pdf). In this mode you can set the device to automatically connect without the need for pairing which could be what you're after. Of course you are limited by the actual device you need to work with.
Good luck!

Discover mobile devices using wifi

I'm doing some work for my theses in networking, and have stumbled into a little problem. One of the first steps in the work I must do consists on having a computer working as an AP (I am using hostapd for this) and with it, detect all the devices in the room which currently have wifi turned on (do not need to be associated with any AP).
I have found a thread that pretty much asks the same ( discover mobil devices using wifi ), and I understand the answers that were given, but they don't give any hint as to how this can be done. The post ends saying that the person was able to do this using Kismet, however I can only seem to use Kismet to discover clients already associated with an AP.
Can someone point me in the right direction here please? If not using Kismet, then maybe suggest a different tool that works with Ubuntu.
Ps. I will need to run a continuous scan of the "room" to find any new devices and then send this information to an event manager written in Java.
I guess you could have a WiFi card, in monitor mode, scanning every channel for beacons. On Linux, aircrack-ng is the tool suite you are looking for. airodump-ng is the tool that shows you a list of devices present around your location. It is designed to display first the hotspots with the potentials clients, but also shows all the devices that are connected to an AP or trying to probe to an AP.
However, you won't be able to scan devices having their WiFi connection turned down. I'm not sure about devices not associated to an AP, my guess is you will be able to detect them if they send beacons one way or another (for example, to detect WiFi hotspots).
If you need this in Java, you can write a wrapper to airodump-ng, or you can launch airodump-ng as a service outputing to a file and read this file from a Java app.
No concrete answer I'm afraid, but I hope these will help you figure a way to solve your problem.

Categories