I'm trying connect a GoPro to an Android device with the USB port.
In theory, the GoPro creates a local network and I can send commands to send it orders. The problems seem like in Android 13 always send the commands by the Wifi network interface and I always get an error saying that do not exists that URL. I guess it is because the device is trying to send the command by the Wifi interface. When I disable the wifi, in some devices with Android 13 works and I can send commands to the GoPro
In Android <13 I can't send commands, even with the Wifi disabled.
For example, in iOS automatically create the network and I can access to the network and send commands.
Any idea about this?
I've tried to connect the GoPro by wire to an Android device and with an app like Postman send commands to control the GoPro, the commands are correct, tested in iOS.
Related
I want to communicate with a Sepura STP8000 radio from a Flutter app via Bluetooth (specifically SPP, Serial Port Protocol).
I first tried the flutter_bluetooth_serial and was able to connect and communicate successfully with another Android device running a Bluetooth Terminal app, sending text back and forth. But when I tried connecting to the Sepura radio I was out of luck. With my basic understanding of Bluetooth, I'm under the impression that the Sepura can only act as a client, so I would need my Flutter app to start a server and listen for an incoming connection (but I might be wrong).
So instead I tried the bluetoothadapter plugin, which seems to be able to act as a server (at least it has a startServer() method). That didn't work either. I was unable to connect from the Sepura, and also unable to connect from another Android device, so I'm not sure if startServer() actually starts a SPP server or not.
Any ideas for how I can listen for incoming Bluetooth SPP connections in my Flutter app? It's fine if it only works on either Android or iOS, as long as it works on one of them.
I have a need: Build a system that allows a offline terminal(it´s a PC) to connect to a server. to do this, we decided to upload the data to a android 3G smartphone and, by network, send the data to the server, retrieve the response and send to terminal. See the scheme below:
GOING
TERMINAL --(?)--> Android App --(HTTP)--> Server
BACK
Server -- (HTTP) --> Android App --(?)--> Terminal
We have some constraints:
1 - The terminal becomes locked until the android send the response from server (It´s a sync message)
2 - We have only text content.
3 - The place where the terminal is connected does not have network signal.
4 - We have to provide a minimum security level possible.
5 - The terminal app will be developed using PHP.
So, my question is: i have to connect the terminal to pc to send and retrieve information from a android phone. Should i use bluetooth or build a wi-fi network (with android phone built-in feature) to connect them?
Did someone have this problem?
I decided to use Bluetooth, because it's easier create a client-server app with bluetooth than develop a "Wi-fi point" programatically and the bluetooth dongle is cheaper than a wi-fi module in old computers.
I want to create a connection between my Android and a PC (or another device) just like in the Bluetooth menu from settings.
I have manage to get the list of all bt devices in my range and get their MAC addresses.
So, I have the BluetoothDevice, how can i connect to it or pair with it? I saw a lot of stuff about creating a server on PC, but I don't want that, i just wanna connect with the device.
My attempt were to get the UUID of the device and use createRfcommSocketToServiceRecord...but when i try socket.connect() it cannot connect (because I don't have a server). So practically I need to make the same structure that the OS is doing (connect with the device, if the connected device is trying to send i can receive the info and so on).
If I managed to connect with the device, I want to listen all that it is emitting, no matter the data...I haven't researched this topic, but any advice will be nice.
The connection must be made with any device that supports bluetooth, and I don't have access to it (of course the device is giving me the permission to connect).
Grab the Android sample projects by doing this http://developer.android.com/tools/samples/index.html
They have an app called BluetoothChat that pretty much does just what you want.
The thing about the 'server' is just in the connection, one side needs to open a listening port and that side is arbitrarily the 'server'. Once they are connected they are merely peers and you can write/read data till the cows come home.
I want to test my app on a android device, I have a local webservice (ASP.net) that is hosted in my laptop in local, when I plug my device, the app works in it but it cannot receive data from my local webservice, how can I get the data sent to the device just like in the emulator
PS: the app works properly in the emulator.
thank you
The emulator uses your laptop's network interfaces, hence it can access webservice directly. Your device needs to connect to your laptop via its own connectivity options (celluar network, WiFi, possibly bluetooth).
I have a few ideas how to get there:
If you have got a WiFi router and both your laptop and phone connect to it - that's pretty straightforward: just expose webservice to address that can be seen within network and use it on your phone.
If you've got an external IP - just use that address when phone is connected to network.
Set up a WiFi access point on your laptop and connect your device with it
Check these URLs how to set up a hosted network (hotspot) on Windows 7:
Hosted network documentation in MSDN
Hosted network tutorial
You might try Bluetooth and PAN.
I'm working on a project to automate some tasks (such as play a song, play a video, receive bluetooth data, etc) on an Android phone from a PC.
Basically the PC will send a notifier to the phone and an app or something on the phone would then process the notifier and do 'something'. The opposite of this really:
http://code.google.com/p/android-notifier/
I've seen some examples showing how to send commands to an Android listener app or service via a network connection, but in this case, I would much rather the transmission be over a physical connection.
USB
Ideally, I'd like the connection to be via the USB port. But I've seen some posts online that suggest that the SDK does not natively support this. (Android apps, communicating with a device plugged in the USB port).
Is there some other SDK/API out there that makes this easier?
I've seen some posts on the ADB, but don't really get it... Would that work?
(http://developer.android.com/guide/developing/tools/adb.html)
Serial over USB
I've also seen some sites that show how to use a breakoutbox to perform bi-directional serial communication, but only with the G1. Is this possible with newer phones?
The Phone
I'm open to really any newish phone. I'm currently looking at the Galaxy S, because it has the video out through the headphone jack. I'm open to rooting if need be.
Implement a HTTP server in your app, then put your phone in USB Tether mode. This will create a local network between your phone and your PC. You should then be able to send HTTP request or create websockets using the phone's ip.
EDIT : I tested it, and it works, see here
What you can do is the phone acting as a server and then use adb to forward ports [1].
In this scenario the pc app would connect to localhost which would be redirected to the app on the phone via the usb cable.
But if you go this way, you might just as well simply connect directly to the phone's ip (without the adb port forwarding)...
[1] http://developer.android.com/guide/developing/tools/adb.html#forwardports