Don't work when wifi tethering is on
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 2
- Joined: 2011-06-16, 08:05 UTC
Don't work when wifi tethering is on
Don't work when wifi tethering is on.
Always pop up this message.
"No network connection! Please either enable WLAN or disable flight mode! Turn on WLAN now?"
Always pop up this message.
"No network connection! Please either enable WLAN or disable flight mode! Turn on WLAN now?"
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Which function are you trying to use? FTP?
And where is the target server? On the Internet or on one of the PCs connected via tethering?
And where is the target server? On the Internet or on one of the PCs connected via tethering?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- Junior Member
- Posts: 2
- Joined: 2013-01-31, 01:37 UTC
cannot FTP from android AP (when tethering is on)
I had the same problem..
Steps to reproduce:
1. enable tethering (to enable WIFI access point)
2. join the wifi network with the android running the FTP server
3. try to connect to the FTP server running on the WIFI client from the WIFI AP
-> "No internet connection - Enable WLAN or disable airplane mode"
Although there a simple workaround (run the FTP server on the Android where tethering is enabled) it would be nice if it was working both ways - sometimes you dont have Internet and it is not possible to install a FTP server or tethering widget...
Thanks for all !
Steps to reproduce:
1. enable tethering (to enable WIFI access point)
2. join the wifi network with the android running the FTP server
3. try to connect to the FTP server running on the WIFI client from the WIFI AP
-> "No internet connection - Enable WLAN or disable airplane mode"
Although there a simple workaround (run the FTP server on the Android where tethering is enabled) it would be nice if it was working both ways - sometimes you dont have Internet and it is not possible to install a FTP server or tethering widget...
Thanks for all !
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
The FTP plugin checks whether there is any active Internet connection. If there isn't, you get this error.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- Junior Member
- Posts: 2
- Joined: 2013-01-31, 01:37 UTC
The FTP plugin should rather check if beside the loopback interface any other network interface is up (and has an IP address assigned).ghisler(Author) wrote:The FTP plugin checks whether there is any active Internet connection. If there isn't, you get this error.
Or simply issue an error message only when the TCP connection cannot be open with the server, without checking first for an active network interface.
It would solve the bug mentioned.
Thanks in advance !
...
Note: If you dont have an internet connection, the workaround suggested earlier (run the FTP server on the Android where tethering is enabled) is not relevant since you cannot install anything from the play store without internet...
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
And HOW is that done? Currently TC uses the Connectivity Manager to check for an active connection:The FTP plugin should rather check if beside the loopback interface any other network interface is up (and has an IP address assigned).
Code: Select all
boolean connected=false;
NetworkInfo ni;
try {
ConnectivityManager cm=(ConnectivityManager)service.getSystemService(Context.CONNECTIVITY_SERVICE);
ni=cm.getActiveNetworkInfo();
connected=ni!=null;
for (int i=0;i<=9;i++)
if (!connected) {
ni=cm.getNetworkInfo(i);
connected=ni!=null && ni.isConnected();
}
} catch (Exception e) {
ni=null;
}
if (!connected) {
if (!errorMsg(s_NoInternet, true))
return FTP_GETSOCKNAMEFAILED;
}
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com