Don't work when wifi tethering is on

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
cronosmachine
Junior Member
Junior Member
Posts: 2
Joined: 2011-06-16, 08:05 UTC

Don't work when wifi tethering is on

Post by *cronosmachine »

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?"
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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?
Author of Total Commander
https://www.ghisler.com
luc.deschenaux
Junior Member
Junior Member
Posts: 2
Joined: 2013-01-31, 01:37 UTC

cannot FTP from android AP (when tethering is on)

Post by *luc.deschenaux »

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 !
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
luc.deschenaux
Junior Member
Junior Member
Posts: 2
Joined: 2013-01-31, 01:37 UTC

Post by *luc.deschenaux »

ghisler(Author) wrote:The FTP plugin checks whether there is any active Internet connection. If there isn't, you get this error.
The FTP plugin should rather check if beside the loopback interface any other network interface is up (and has an IP address assigned).

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...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The FTP plugin should rather check if beside the loopback interface any other network interface is up (and has an IP address assigned).
And HOW is that done? Currently TC uses the Connectivity Manager to check for an active connection:

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
charly_35
Junior Member
Junior Member
Posts: 21
Joined: 2010-03-26, 17:14 UTC
Location: France Rennes 35

Post by *charly_35 »

LO,

The workaround is to initiate the connection from the other hand.
I use this possibility between my androphone and my tablette (both android 4.0.4)
Cdlt Charles.
Post Reply