Force Android 6.x Marshmallow use a WiFi connection even without Internet access

I am working on an application and I need to talk to my router. I need to download a file from a router using local ip . If the router does not have Internet access, Android tries to download the file via the mobile network .

Is there a way to get Android to use WiFi even if there is no Internet access? (its new Android Marshmallow feature for displaying WiFi, but using a mobile network). The file is not accessible from the WAN only from the LAN .

I can make him turn off the mobile network or turn on airplane mode with WiFi on, but this is not an option. I need to do this programmatically for this particular download.

+7
android android-6.0-marshmallow networking wifi connection
source share

No one has answered this question yet.

See similar questions:

12
android 6.0.1 makes Wi-Fi connection without internet access

or similar:

650
getColor (int id) deprecated on Android 6.0 Marshmallow (API 23)
617
How to check Internet access on Android? InetAddress never runs out
77
Android: how to enable / disable wifi or internet connection
63
How do I determine if Mobile Network Data is turned on (even when connected via WiFi)?
22
Force Android Uses Wi-Fi Network Without Internet
12
android 6.0.1 makes Wi-Fi connection without internet access
eleven
Android: turn on / off the Wi-Fi access point using the Android Marshmallow program (6.0)
3
Android Marshmallow - How to avoid Wi-Fi crashing if you don’t have Internet access
2
Internet access via mobile data when Wi-Fi is connected to OBD in marshmallows
2
Get the IP address of LTE and WiFi while connected in Android M

All Articles