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

View File

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

View File

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

View File

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