diff --git a/AndroidManifest.xml b/AndroidManifest.xml index fcf5c5bc..64439357 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,6 +1,6 @@ diff --git a/res/values/strings.xml b/res/values/strings.xml index 097634a1..977f3d55 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1,5 +1,6 @@ - Hello World, DroidGap - TransLink + Hello World, PhoneGap + PhoneGap +http://phonegap.com/demo2/ diff --git a/src/com/nitobi/droidgap/AccelTuple.java b/src/com/nitobi/phonegap/AccelTuple.java similarity index 76% rename from src/com/nitobi/droidgap/AccelTuple.java rename to src/com/nitobi/phonegap/AccelTuple.java index 490a186b..aa78a975 100644 --- a/src/com/nitobi/droidgap/AccelTuple.java +++ b/src/com/nitobi/phonegap/AccelTuple.java @@ -1,4 +1,4 @@ -package com.nitobi.droidgap; +package com.nitobi.phonegap; public class AccelTuple { public long accelX; diff --git a/src/com/nitobi/droidgap/DroidGap.java b/src/com/nitobi/phonegap/DroidGap.java similarity index 82% rename from src/com/nitobi/droidgap/DroidGap.java rename to src/com/nitobi/phonegap/DroidGap.java index 36ea3e03..e2fc81c8 100644 --- a/src/com/nitobi/droidgap/DroidGap.java +++ b/src/com/nitobi/phonegap/DroidGap.java @@ -1,7 +1,8 @@ -package com.nitobi.droidgap; +package com.nitobi.phonegap; import java.io.IOException; import java.io.InputStream; +import java.lang.reflect.Field; import android.app.Activity; import android.os.Bundle; @@ -35,16 +36,26 @@ public class DroidGap extends Activity { /* Bind the appView object to the gap class methods */ bindBrowser(appView); - /* - * We need to decide whether this is a local or a remote app. For the sake of clarity - * we can use HTML with both local and remote applications, but it means that we have to open the local file - */ + /* Load a URI from the strings.xml file */ + String uri = null; + Class c = R.string.class; + Field f; + int i = 0; + + try { + f = c.getField("url"); + i = f.getInt(f); + uri = this.getResources().getString(i); + } catch (Exception e) + { + uri = "http://www.phonegap.com"; + } - appView.loadUrl("http://www.infil00p.org/gap/demo/"); + appView.loadUrl(uri); } - private void loadFile(WebView appView){ + protected void loadFile(WebView appView){ try { InputStream is = getAssets().open("index.html"); diff --git a/src/com/nitobi/droidgap/GeoTuple.java b/src/com/nitobi/phonegap/GeoTuple.java similarity index 75% rename from src/com/nitobi/droidgap/GeoTuple.java rename to src/com/nitobi/phonegap/GeoTuple.java index 50196314..0959c548 100644 --- a/src/com/nitobi/droidgap/GeoTuple.java +++ b/src/com/nitobi/phonegap/GeoTuple.java @@ -1,4 +1,4 @@ -package com.nitobi.droidgap; +package com.nitobi.phonegap; public class GeoTuple { public double lat; diff --git a/src/com/nitobi/droidgap/GpsListener.java b/src/com/nitobi/phonegap/GpsListener.java similarity index 98% rename from src/com/nitobi/droidgap/GpsListener.java rename to src/com/nitobi/phonegap/GpsListener.java index e592d020..06b2a3e6 100644 --- a/src/com/nitobi/droidgap/GpsListener.java +++ b/src/com/nitobi/phonegap/GpsListener.java @@ -1,4 +1,4 @@ -package com.nitobi.droidgap; +package com.nitobi.phonegap; import android.content.Context; import android.hardware.SensorManager; diff --git a/src/com/nitobi/droidgap/NetworkListener.java b/src/com/nitobi/phonegap/NetworkListener.java similarity index 98% rename from src/com/nitobi/droidgap/NetworkListener.java rename to src/com/nitobi/phonegap/NetworkListener.java index 46c2390a..d54f4794 100644 --- a/src/com/nitobi/droidgap/NetworkListener.java +++ b/src/com/nitobi/phonegap/NetworkListener.java @@ -1,4 +1,4 @@ -package com.nitobi.droidgap; +package com.nitobi.phonegap; import android.content.Context; import android.hardware.SensorManager; diff --git a/src/com/nitobi/droidgap/PhoneGap.java b/src/com/nitobi/phonegap/PhoneGap.java similarity index 98% rename from src/com/nitobi/droidgap/PhoneGap.java rename to src/com/nitobi/phonegap/PhoneGap.java index 4319cd67..7b656993 100644 --- a/src/com/nitobi/droidgap/PhoneGap.java +++ b/src/com/nitobi/phonegap/PhoneGap.java @@ -1,4 +1,4 @@ -package com.nitobi.droidgap; +package com.nitobi.phonegap; import android.content.Context; import android.hardware.SensorManager; diff --git a/src/com/nitobi/droidgap/R.java b/src/com/nitobi/phonegap/R.java similarity index 89% rename from src/com/nitobi/droidgap/R.java rename to src/com/nitobi/phonegap/R.java index a4deb51e..4bc4cd22 100644 --- a/src/com/nitobi/droidgap/R.java +++ b/src/com/nitobi/phonegap/R.java @@ -5,7 +5,7 @@ * should not be modified by hand. */ -package com.nitobi.droidgap; +package com.nitobi.phonegap; public final class R { public static final class attr { @@ -22,5 +22,6 @@ public final class R { public static final class string { public static final int app_name=0x7f040001; public static final int hello=0x7f040000; + public static final int url=0x7f040002; } }