I'm working on an Android App that writes and reads files (*.txt) on a Windows PC. The App connects to a WiFi network and uses the SMB. The App works pretty well while the network has internet connection. When I disconnect Internet, the App can't connect to the PC. I mean, the device remains connected to the network on a WLAN, but there is no internet access on that network, and the App then can't connect to the folder on the Windows PC.
I've searched on internet if this is a problem in the JCIFS library or Android system, and I found no information about it. So, maybe anyone has experienced this before? Is there any solution?
Here is some information about my project:
JCIFS - 1.3.18
Android Device 4.1.2 (16)
Android Manifest permissions - <uses-permission android:name="android.permission.INTERNET"
I've tried with ES File Explorer in the same scenario, connected to a WiFi network without Internet connection, then I searched for PCs in LAN and a message has been showed up: "Connect to a WLAN first".
Maybe is Android's fault?
Thanks in advance.
1
votes
The JCIFS library (the use of SMB in this case) uses a valid DNS to resolve names. Therefore, if there is no internet connection, SMB cannot resolve the name of the host to which you are referring to.
- Kevin Fernández