This commit is contained in:
Joe Bowser 2009-11-26 11:48:16 -08:00
parent 34ab64655d
commit 0af30a6e82
4 changed files with 23 additions and 8 deletions

View File

@ -24,7 +24,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:icon="@drawable/icon" android:label="@string/app_name" <application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="false"> android:debuggable="true">
<activity android:name=".StandAlone" <activity android:name=".StandAlone"
android:label="@string/app_name" android:configChanges="orientation|keyboardHidden"> android:label="@string/app_name" android:configChanges="orientation|keyboardHidden">
<intent-filter> <intent-filter>
@ -38,6 +38,6 @@
<action android:name="android.intent.action.PICK" /> <action android:name="android.intent.action.PICK" />
</activity> </activity>
</application> </application>
<uses-sdk android:minSdkVersion="4" /> <uses-sdk android:minSdkVersion="3" />
</manifest> </manifest>

View File

@ -9,6 +9,6 @@
apk-configurations= apk-configurations=
# Project target. # Project target.
target=android-4 target=android-5
# Indicates whether an apk should be generated for each density. # Indicates whether an apk should be generated for each density.
split.density=false split.density=false

View File

@ -41,7 +41,7 @@ public class GapClient extends WebChromeClient {
result.confirm(); result.confirm();
return true; return true;
} }
public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize, public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater) long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
{ {
@ -58,4 +58,5 @@ public class GapClient extends WebChromeClient {
quotaUpdater.updateQuota(currentQuota); quotaUpdater.updateQuota(currentQuota);
} }
} }
} }

View File

@ -8,7 +8,7 @@ import android.webkit.WebSettings;
public class WebViewReflect { public class WebViewReflect {
private static Method mWebSettings_setDatabaseEnabled; private static Method mWebSettings_setDatabaseEnabled;
private static Method mWebSettings_setDatabasePath;
static static
{ {
checkCompatibility(); checkCompatibility();
@ -41,18 +41,32 @@ public class WebViewReflect {
try { try {
mWebSettings_setDatabaseEnabled = WebSettings.class.getMethod( mWebSettings_setDatabaseEnabled = WebSettings.class.getMethod(
"setDatabaseEnabled", new Class[] { boolean.class } ); "setDatabaseEnabled", new Class[] { boolean.class } );
mWebSettings_setDatabasePath = WebSettings.class.getMethod(
"setDatabasePath", new Class[] { String.class });
/* success, this is a newer device */ /* success, this is a newer device */
} catch (NoSuchMethodException nsme) { } catch (NoSuchMethodException nsme) {
/* failure, must be older device */ /* failure, must be older device */
} }
} }
public static void setStorage(WebSettings setting, boolean enable, String path) { public static void setStorage(WebSettings setting, boolean enable, String path) {
if (mWebSettings_setDatabaseEnabled != null) { if (mWebSettings_setDatabaseEnabled != null) {
/* feature is supported */ /* feature is supported */
setting.setDatabaseEnabled(enable); try {
setting.setDatabasePath(path); mWebSettings_setDatabaseEnabled.invoke(setting, true);
mWebSettings_setDatabasePath.invoke(setting, path);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//setting.setDatabaseEnabled(enable);
//setting.setDatabasePath(path);
} else { } else {
/* feature not supported, do something else */ /* feature not supported, do something else */
System.out.println("dump not supported"); System.out.println("dump not supported");