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

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cradle.iitc_mobile"
android:versionCode="18"
android:versionName="0.3.6" >
android:versionCode="19"
android:versionName="0.3.7" >
<uses-sdk
android:minSdkVersion="14"

View File

@ -75,13 +75,6 @@
android:showAsAction="ifRoom"
android:title="@string/action_settings">
</item>
<item
android:id="@+id/cache_clear"
android:icon="@drawable/content_remove"
android:orderInCategory="150"
android:showAsAction="never"
android:title="@string/cache_clear">
</item>
<item
android:id="@+id/menu_debug"
android:icon="@drawable/alerts_and_states_warning"

View File

@ -5,7 +5,6 @@
<string name="action_settings">Settings</string>
<string name="reload">Reload IITC</string>
<string name="version">Print Version</string>
<string name="cache_clear">Clear Cache</string>
<string name="toggle_fullscreen">Toggle fullscreen</string>
<string name="locate">Get Location</string>
<string name="local">local</string>

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) {