WiFi Access point switch android - java

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)

Related

Is it possible to connect and communicate with multiple Bluetooth Low Energy sensors with an android box simultaneously?

I want to connect and stream the multiple Bluetooth low energy sensors by matching their gatt profiles. All the sensors devices are of the same type but different mac address. So I want to connect those sensors to my mobile application and stream those data to our other application through the serial port. I know the Bluetooth can connect to 7 devices at a time.
But for connectivity with Android devices, it is not stated properly and still in a dilemma. Or else is it possible to connect external Bluetooth module to the android box to connect it to multiple devices? If yes then to do this what are the changes I need to perform on my system? How many devices can be used to communicate with the Android device at the same time? Can the android box act as a master that collects all the data from the peripherals and stream via the serial port. We have completed our process for a single sensor. Or is there any other possibility to stream multiple ble sensor data to another device through serial port write. please guide me through this process.
Execute connectGatt one time for every device, which will then give you one BluetoothGatt object per device. The callback object can be the same, or a separate instance per device, it depends on the use-case but most probably the devices serve different purposes so you'll have separate specific instances per device.
As long as you have a BluetoothDevice object, you can make a GATT connection to it. You can get it either using Bluetooth device address (which can sometimes be problematic since the API misses the random / public address type bit) or by a scan. You can have one outstanding GATT operation at a time, per BluetoothGatt object, so yes you can read / write characteristics to both devices simultaneously.
Feel free to post some source code for more analysis.

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 Application, problems advertising service on network

Currently working on an Android application that enables people to alert other people in the same network that have said app installed on their android device. It uses Java's Network Service Discovery classes to accomplish this.
There's a background android service that advertises a network service to the network, so the device can be seen and communicated with by other devices in the network. It calls
mNsdManager.registerService(serviceInfo, NsdManager.PROTOCOL_DNS_SD, mRegistrationListener);
to register the service on the network.
This background service runs at all times when the device is connected to a WiFi-network to ensure availability.
All the functionalities that have been implemented work fine, until the phone gets put to sleep.
When that happens the network service, which is supposed to be broadcasted at all times, stops showing up.
I assume this is not a bug, but normal behaviour since the Android background service is stopped(?) and as such stops sending packets to the network when the phone is put to sleep.
How can I solve this issue? Do I need to take a different approach entirely?

Bluetooth comport programming very slow

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.

Categories

Resources