Merge branch 'master' into android_login

This commit is contained in:
Felix Kloft
2013-05-15 11:56:08 +02:00
8 changed files with 71 additions and 22 deletions

View File

@ -23,7 +23,7 @@ public class IITC_JSInterface {
@JavascriptInterface
public void intentPosLink(String lat, String lng, String portal_name) {
String uri = "geo:" + lat + "," + lng + "?q=" + lat + "," + lng
+ portal_name;
+ "%20(" + portal_name + ")";
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse(uri));
context.startActivity(intent);

View File

@ -255,12 +255,6 @@ public class IITC_Mobile extends Activity {
this.loadUrl(intel_url);
actionBar.setTitle(getString(R.string.menu_map));
return true;
// clear cache
case R.id.cache_clear :
iitc_view.clearHistory();
iitc_view.clearFormData();
iitc_view.clearCache(true);
return true;
case R.id.toggle_fullscreen :
toggleFullscreen();
return true;

View File

@ -1,10 +1,12 @@
package com.cradle.iitc_mobile;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.util.Log;
@ -122,11 +124,20 @@ public class IITC_WebView extends WebView {
}
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private boolean isConnectedToWifi() {
ConnectivityManager conMan = (ConnectivityManager) getContext()
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo wifi = conMan.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
return wifi.getState() == NetworkInfo.State.CONNECTED;
// since jelly bean you can mark wifi networks as mobile hotspots
// settings -> data usage -> menu -> mobile hotspots
// ConnectivityManager.isActiveNetworkMeter returns if the currently used wifi-network
// is ticked as mobile hotspot or not.
// --> IITC_WebView.isConnectedToWifi should return 'false' if connected to mobile hotspot
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
return ((wifi.getState() == NetworkInfo.State.CONNECTED) && !conMan.isActiveNetworkMetered());
}
return (wifi.getState() == NetworkInfo.State.CONNECTED);
}
public void disableJS(boolean val) {