Skip to content

Commit

Permalink
Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowser committed Nov 26, 2009
1 parent 21a8e4d commit 3a164ee
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
4 changes: 2 additions & 2 deletions android/framework/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -38,6 +38,6 @@
<action android:name="android.intent.action.PICK" />
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
<uses-sdk android:minSdkVersion="3" />

</manifest>
2 changes: 1 addition & 1 deletion android/framework/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion android/framework/src/com/phonegap/GapClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public boolean onJsAlert(WebView view, String url, String message, JsResult resu
result.confirm();
return true;
}

public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
{
Expand All @@ -58,4 +58,5 @@ public void onExceededDatabaseQuota(String url, String databaseIdentifier, long
quotaUpdater.updateQuota(currentQuota);
}
}

}
22 changes: 18 additions & 4 deletions android/framework/src/com/phonegap/WebViewReflect.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class WebViewReflect {
private static Method mWebSettings_setDatabaseEnabled;

private static Method mWebSettings_setDatabasePath;
static
{
checkCompatibility();
Expand Down Expand Up @@ -41,18 +41,32 @@ public static void checkCompatibility() {
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");
Expand Down

0 comments on commit 3a164ee

Please sign in to comment.