Merge pull request #278 from infil00p/master

Modifying build.xml to use custom versions, adding ant files, and fixing HTC Logcat
This commit is contained in:
Joe Bowser 2011-10-21 11:00:37 -07:00
commit 75f3651376
2 changed files with 16 additions and 7 deletions

View File

@ -28,7 +28,6 @@
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
@ -55,7 +54,7 @@
unless="sdk.dir"
/>
<!-- version-tag: custom -->
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
@ -89,7 +88,6 @@
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
@ -141,7 +139,8 @@
<fileset file="assets/www/index.html" />
<!-- <fileset file="../bin/templates/project/assets/www/index.html" /> -->
</replaceregexp>
<replaceregexp match="phonegapVersion = [\u0022].*[\u0022];" replace="phonegapVersion = ${dblQuote}${version}${dblQuote};" byline="true">
<!-- This is sketchy, but it works, ${dblQuote} does not -->
<replaceregexp match="phonegapVersion = [\u0022].*[\u0022];" replace='phonegapVersion = ${dblQuote}${version}${dblQuote};' byline="true">
<fileset file="src/com/phonegap/Device.java" />
</replaceregexp>

View File

@ -42,6 +42,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.ConsoleMessage;
import android.webkit.GeolocationPermissions.Callback;
import android.webkit.JsPromptResult;
import android.webkit.JsResult;
@ -278,6 +279,9 @@ public class DroidGap extends PhonegapActivity {
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
//Set the nav dump for HTC
settings.setNavDump(true);
// Enable database
settings.setDatabaseEnabled(true);
String databasePath = this.getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
@ -1102,10 +1106,16 @@ public class DroidGap extends PhonegapActivity {
@Override
public void onConsoleMessage(String message, int lineNumber, String sourceID)
{
// This is a kludgy hack!!!!
LOG.d(TAG, "%s: Line %d : %s", sourceID, lineNumber, message);
}
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage)
{
LOG.d(TAG, consoleMessage.message());
return true;
}
@Override
/**
* Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.