Bluetooth comport programming very slow - java

this is Dharmesh i developed one application of gps. my gps connected via Bluetooth but my program take too much time identify comport. but if i connected my gps with usb cable it run easily any one face this issue and how to overcome this issue.
thanking you......

This may be a side effect of the fact that you let the bluetooth port go between attempts. Bluetooth connections setup and teardown are very expensive, so if you connect to the GPS, you should remain connected. Of course, that doesn't help during dev, so once you know the bluetooth connection works, it probably makes sense to use the USB cable except when testing the connection for regressions.

Related

Turn off specific USB port programmatically

I use an hardware device that goes in standby after it is not used for several minutes.
The only way to reactivate it is to unplug it from the USB port and reconnect it.
So I would like to know if there is a way to turn off (and then turn on) that specific USB port.
Thanks in advance!

Get Devices connected to same wifi network in android programmatically?

I am developing an app in which the first thing i need is how to get devices that are connected to my wifi network or same wifi network .ie ip adress,device name etc.
I don't have any idea how to do that have searched alot but there are no examples available.
I have done one thing that i will ping 255 ips and whichever will respond will be the connected ips but the problem here is that there are virtual ips already assigned to some websites so i need to detect only the real device ip addresses.
I want to do the same thing as done in the app WifiTalkie
Follow Any one of the following:
Way1:
If you mean you want to see all the devices connected to your current WiFi connection (and you are not trying to do Ad Hoc networking), then you are essentially wanting to run a network scanner.
There are a bunch of these around. This one has the source available on github
http://rorist.github.com/android-network-discovery/
Way2:
Refer How to detect all the Devices connected in a WiFi network from Android App

How to improve BLE connection success rate on connection calls to D-Bus through BlueZ

I have an iOS app that can connect pretty reliably to my BLE devices that advertise at 1.285 seconds, a frequency defined by Apple as one of the freqs that will help to optimize connectivity. I also have some BLE devices that advertise much slower (an advertisement every 4 seconds, for example), and these can be connected using the iOS app, but a little less reliably. To get these to connect the app has to wait longer for the connection to complete, after issuing the command to connect to the device, and sometimes the app must invoke a retry.
Running a Java app on Raspbian on a Raspberry Pi 3 Model B, I find that connection attempts to the BLE devices advertising at the 1.285 rate succeed pretty reliably, but connection attempts to the slower-advertising BLE devices always fail. I'm looking for ways to affect BlueZ, and thus D-Bus, to improve the connectability of these slower-advertising devices. I've looked through the BlueZ source code and so far have found no hints.
Does anyone have suggestions or insights?
The BlueZ D-Bus API is quite restrictive what you can do. I'd suggest you try some other solution that communicates over HCI to the bluetooth chip directly. Maybe https://github.com/sandeepmistry/bleno.

Android Wear: bluetooth vs wifi connection

How to detect if Android wear switched the connection from bluetooth to wifi or vice versa? And is there a way to force it to connect via bluetooth?
Being an Android framework, you can register a broadcast receiver to be notified when connectivity status changes. In general, when your watch is connected to a phone directly (which only happens via BT), wifi connection is dropped and when it is not connected, if your phone is wifi capable and if a wifi network is available, it gets connected to the cloud node. In that case, you cannot force it to connect through BT since, most likely, it is not possible (might be due to distance or many other reasons). What exactly are you trying to accomplish?

WiFi Access point switch android

I have two access point broadcasting same SSID across a wide open area. Usually the mobile device switches to strongest AP by default if the currently AP is not strong enough without haviong disconnecting and reconnecting to WiFi. But over a long period we have observed that the WiFi switching does not happen sometimes.
For such cases we were planning to handle that switching at android application level itself.
But after doing lots of research over web. We could only find methods which involve disconnecting the Wifi and reconnecting again which is not desirable in our case. As our application accepts payments over web . Disconnecting and reconnecting again based on signal strength would result in payments getting declined.
Is is possible to replicate the WiFi switching which mobile device does automatically at android application level.(I know the question is absurd but i am desperately looking for a workaround)

Categories

Resources