I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 4b5420f5 authored by zzz's avatar zzz
Browse files

- Toast if no network

- Update status faster
- Update release notes
parent e86e69f4
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ The app runs on either WIFI or mobile networks. For now, the app is very low ban ...@@ -12,7 +12,7 @@ The app runs on either WIFI or mobile networks. For now, the app is very low ban
The app uses TCP only for router-router connections, with a maximum of 24 simultaneous. UDP is disabled. The app uses TCP only for router-router connections, with a maximum of 24 simultaneous. UDP is disabled.
UPnP is enabled but it it doesn't appear to be working. UPnP is enabled but it doesn't appear to be working.
NTP is disabled. If you have cell service, your phone or tablet should have the correct time. If you do not have cell service, ensure your device has accurate time. NTP is disabled. If you have cell service, your phone or tablet should have the correct time. If you do not have cell service, ensure your device has accurate time.
...@@ -29,6 +29,7 @@ The browser does not use the outproxy for regular web sites. Javascript is disab ...@@ -29,6 +29,7 @@ The browser does not use the outproxy for regular web sites. Javascript is disab
The following problems with eepsites are probably not fixable except on Android 3.0 (Honeycomb - i.e. tablets) due to API limitations. I don't have a tablet to test on, so I haven't made any effort to work on it. The workaround is to use Firefox Mobile 4 and the ProxMob plugin (see below). The following problems with eepsites are probably not fixable except on Android 3.0 (Honeycomb - i.e. tablets) due to API limitations. I don't have a tablet to test on, so I haven't made any effort to work on it. The workaround is to use Firefox Mobile 4 and the ProxMob plugin (see below).
- No images - No images
- No CSS - No CSS
- No POSTs to forms
For eepsites, there are several other things to note: For eepsites, there are several other things to note:
- No cookies - No cookies
...@@ -41,9 +42,9 @@ For eepsites, there are several other things to note: ...@@ -41,9 +42,9 @@ For eepsites, there are several other things to note:
Using clients with the router Using clients with the router
----------------------------- -----------------------------
The app stats an HTTP proxy at localhost port 4444 and a transparent IRC proxy at localhost port 6668. These are "shared clients" on the same tunnels. Once you see in and out client tunnels listed on the router status (several minutes after startup), you should be able to connect. The app starts an HTTP proxy at localhost port 4444 and a transparent IRC proxy at localhost port 6668. These are "shared clients" on the same tunnels. Once you see in and out client tunnels listed on the router status (several minutes after startup), you should be able to connect.
The HTTP proxy is untested (other than with the news fetcher). It should work with Firefox 4 Mobile and the ProxyMob Firefox plugin, if you have at least 512 MB of RAM. The HTTP proxy should work with Firefox 4 Mobile and the ProxyMob Firefox plugin, if you have at least 512 MB of RAM. If it works it should avoid all the problems with the embedded web browser listed above. I can't test it as I have a 256 MB Droid.
The IRC proxy destinations are irc.postman.i2p and irc.freshcoffee.i2p. It is tested with the "Android IRC Free" app. The IRC proxy destinations are irc.postman.i2p and irc.freshcoffee.i2p. It is tested with the "Android IRC Free" app.
......
...@@ -4,6 +4,7 @@ import android.app.Dialog; ...@@ -4,6 +4,7 @@ import android.app.Dialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.view.Gravity;
import android.webkit.WebView; import android.webkit.WebView;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;
import android.widget.Toast; import android.widget.Toast;
...@@ -12,6 +13,7 @@ import java.net.URI; ...@@ -12,6 +13,7 @@ import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import net.i2p.android.apps.EepGetFetcher; import net.i2p.android.apps.EepGetFetcher;
import net.i2p.android.router.util.Util;
import net.i2p.util.EepGet; import net.i2p.util.EepGet;
class I2PWebViewClient extends WebViewClient { class I2PWebViewClient extends WebViewClient {
...@@ -31,7 +33,8 @@ class I2PWebViewClient extends WebViewClient { ...@@ -31,7 +33,8 @@ class I2PWebViewClient extends WebViewClient {
URI uri = new URI(url); URI uri = new URI(url);
String s = uri.getScheme(); String s = uri.getScheme();
if (s == null) { if (s == null) {
Toast toast = Toast.makeText(view.getContext(), "Bad URL " + url, Toast.LENGTH_SHORT); Toast toast = Toast.makeText(view.getContext(), "Bad URL " + url, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show(); toast.show();
return true; return true;
} }
...@@ -40,7 +43,15 @@ class I2PWebViewClient extends WebViewClient { ...@@ -40,7 +43,15 @@ class I2PWebViewClient extends WebViewClient {
return false; return false;
String h = uri.getHost(); String h = uri.getHost();
if (h == null) { if (h == null) {
Toast toast = Toast.makeText(view.getContext(), "Bad URL " + url, Toast.LENGTH_SHORT); Toast toast = Toast.makeText(view.getContext(), "Bad URL " + url, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
return true;
}
if (!Util.isConnected(view.getContext())) {
Toast toast = Toast.makeText(view.getContext(), "No Internet connection is available", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show(); toast.show();
return true; return true;
} }
...@@ -48,10 +59,14 @@ class I2PWebViewClient extends WebViewClient { ...@@ -48,10 +59,14 @@ class I2PWebViewClient extends WebViewClient {
h = h.toLowerCase(); h = h.toLowerCase();
if (h.endsWith(".i2p")) { if (h.endsWith(".i2p")) {
if (!s.equals("http")) { if (!s.equals("http")) {
Toast toast = Toast.makeText(view.getContext(), "Bad URL " + url, Toast.LENGTH_SHORT); Toast toast = Toast.makeText(view.getContext(), "Bad URL " + url, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show(); toast.show();
return true; return true;
} }
// TODO check that the router is up and we have client tunnels both ways
// strip trailing junk // strip trailing junk
int hash = url.indexOf("#"); int hash = url.indexOf("#");
if (hash > 0) if (hash > 0)
......
...@@ -23,6 +23,7 @@ public class MainActivity extends I2PActivityBase { ...@@ -23,6 +23,7 @@ public class MainActivity extends I2PActivityBase {
private Handler _handler; private Handler _handler;
private Runnable _updater; private Runnable _updater;
private Runnable _oneShotUpdate;
private String _savedStatus; private String _savedStatus;
protected static final String PROP_NEW_INSTALL = "i2p.newInstall"; protected static final String PROP_NEW_INSTALL = "i2p.newInstall";
...@@ -111,7 +112,7 @@ public class MainActivity extends I2PActivityBase { ...@@ -111,7 +112,7 @@ public class MainActivity extends I2PActivityBase {
} else { } else {
startRouter(); startRouter();
} }
updateVisibility(); updateOneShot();
} }
}); });
...@@ -122,7 +123,7 @@ public class MainActivity extends I2PActivityBase { ...@@ -122,7 +123,7 @@ public class MainActivity extends I2PActivityBase {
if (svc != null && _isBound) { if (svc != null && _isBound) {
setPref(PREF_AUTO_START, false); setPref(PREF_AUTO_START, false);
svc.manualStop(); svc.manualStop();
updateVisibility(); updateOneShot();
} }
} }
}); });
...@@ -134,7 +135,7 @@ public class MainActivity extends I2PActivityBase { ...@@ -134,7 +135,7 @@ public class MainActivity extends I2PActivityBase {
if (svc != null && _isBound) { if (svc != null && _isBound) {
setPref(PREF_AUTO_START, false); setPref(PREF_AUTO_START, false);
svc.manualQuit(); svc.manualQuit();
updateVisibility(); updateOneShot();
} }
} }
}); });
...@@ -148,6 +149,7 @@ public class MainActivity extends I2PActivityBase { ...@@ -148,6 +149,7 @@ public class MainActivity extends I2PActivityBase {
_handler = new Handler(); _handler = new Handler();
_updater = new Updater(); _updater = new Updater();
_oneShotUpdate = new OneShotUpdate();
} }
@Override @Override
...@@ -174,8 +176,7 @@ public class MainActivity extends I2PActivityBase { ...@@ -174,8 +176,7 @@ public class MainActivity extends I2PActivityBase {
public void onResume() public void onResume()
{ {
super.onResume(); super.onResume();
updateVisibility(); updateOneShot();
updateStatus();
} }
@Override @Override
...@@ -186,6 +187,17 @@ public class MainActivity extends I2PActivityBase { ...@@ -186,6 +187,17 @@ public class MainActivity extends I2PActivityBase {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
} }
private void updateOneShot() {
_handler.postDelayed(_oneShotUpdate, 100);
}
private class OneShotUpdate implements Runnable {
public void run() {
updateVisibility();
updateStatus();
}
}
private class Updater implements Runnable { private class Updater implements Runnable {
private int counter; private int counter;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment