I’m not sure if this is the right place to ask this question as this is my first question, but I have the following scenario and I need advice and guidance. Or, if this is the wrong place to ask this question, where should I post it?
I want to create a Java Bluetooth proxy application that will sit in the middle of an Android app and a bluetooth IoT device. I want this Java application to see all the traffic that is being exchanged between the app and the IoT device. I have found similar applications called btproxy and btlejuice, but I want to implement it within Java and I want it to be really simple. I have looked into Bluecove but I'm not having much luck. I’m guessing I will need 2 different machines or VM’s so I can use 2 different bluetooth adapters.
Basically, when you connect the Android app to the computer/VM, the data will be logged and it will be sent to the IoT device. The IoT device will then process it, and send its data back to the Android app via the computer/VM. I’m guessing this relies heavily on the UUID of the app and the device?
Is this possible to achieve, if so, have I got the right topology for this scenario and what would be the best Java API to use and is there any code that will help?
Related
I have been searching the net for some sort of explantation on how I would get started on coding this but I haven't found anything. I know about ports and streams and basic networking stuff in java but I just can't seem to find any resources describing how this can be translating to android. I looked through the android api (https://developer.android.com/training/connect-devices-wirelessly/) but I actually don't understand any of what is written on there.
Back to the question though. The app would simply do this basic function:
two or more people connected to the same network open the app
when opened , the app automatically scans for all the phones connected to the same network that have this app open
the app would then display the name of each phone with that app open connected to the same network on the screen(in activity main) as a simple array (the name of the phone would just be the bluetooth name a guess)
This might be too complex of a question to answer so If there are any resources such as videos, api, etc. , that describe this process that would be great
NsdManager will fulfill all your requirement. You have to first register the service on the network through NsdManager using IP and port. Then Discover and resolve that service from another end.
https://developer.android.com/reference/android/net/nsd/NsdManager
https://android.googlesource.com/platform/development/+/master/samples/training/NsdChat/src/com/example/android/nsdchat/NsdHelper.java
Hi guys could any one help me a little bit, I'm making an android app, for cabs request, but I need a way to send to the driver app, an alert where he accepts the invitation to pick up the client, if he choose the accept button, and alert pops up on the client app telling him that the driver is on the way :) Thanks, I think i need for Threads to me always watching for these client notifications.
You can use Socket programming. This is an example where it shows how to communicate between two android phones.Example shown in emulators
http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/
This question depends on a few factors. Whether there is a server to control the communication mechanism or not. Whether the devices are close to each other. Whether there is a network oriented method like SMS allowed to be placed and so on. To minimally answer this, the following could be the easiest way to communicate between two Android devices.
If the devices are close to each other, use Bluetooth
If the devices have a server to connect in between, use an Android service to take the connections things to the background
If there is an SMS/Call based connection between the devices, use Intents and Content providers to further deal with the data.
I want to make one desktop application for our college so that it can be use in the way so that when we want to send update about the college fest it can be directly reached to all the person who have the desktop application in java.
For android we have the GCM concept. Is there any method for the desktop application also?
I do not want to use polling here .... So please tell me any suitable method how to do this?
Not without running a server of your own. GCM is a particular service that Google runs free of charge to encourage developers to use the Android platform, and it works by having every Android device make a TCP connection to Google and keep it open all the time waiting for incoming messages. You'd have to have your own similar server.
You could use a JMS publish/subscribe topic, but in this case, it is almost certainly a better idea to let the client poll for updates in JSON or RSS format. Is there a specific reason you don't want to poll?
I am working on one android app. I want to connect my local PC to ANDROID device using Wi-Fi(Local).
just like this APP.
I am new to network programming.
Anyone help me to do this some architecture or example or code.
You could use the Server-Client architecture. Depending on what you want to do you could either set up a server in the phone and have a client on the computer that will connect to the phone. Or the other way around, server on the computer and let the phone connect to it.
Here is another thread that have some example code (there is a lot of other examples and tutorials):
Android - Server Socket
There's no way around this except by hard work. You are expected to read the documentation and work through the examples. There are heaps of tutorials on Programming on Android on the 'Net. Use them.
I have an application that was written in Java and runs on the users machine. I now want to build an application on the iPhone which will communicate with my java app.
Can somebody point me in the right direction on how I can send and receive TCP packets with the iPhone, I want to of course be able to do that using wifi and 3G.
Thanks,
You use the NSStream classes. I've found it pretty easy to use.
See the SimpleNetworkStreams for an example.
One problem I found is that the iphone sdk does not include the NSStream method getStreamsToHost:port:inputStream:outputStream: which is what Mac OS examples use to open a NStream connection but there are lots of places that show you how to create your own like here.