Create Android .apk files using PhoneGap

From Lennie De Villiers:

Instructions to compile an NSBasic app to PhoneGap on Android on MS (Windows only)

  1. Download Java JDK 1.6
  2. Set the Java class path and add the Java bin folder to the PATH variable so that you can run Java (“javac”) from the command line
  3. Download latest Apache Ant
  4. Download Apache Ant to a folder and set the PATH variable to the bin folder so that you can run ant from the command line
  5. set the ANT_HOME variable to the Ant home folder
  6. Download the latest version of Ruby
  7. Set the PATH variable to the bin folder of Ruby so that you can run it from the command line
  8. Get the latest source code of Phone Gap for Android from the GIT repo: https://github.com/phonegap/phonegap-android
  9. Set the PATH variable to the bin folder so that you can run droidgap.bat from the command line (droidgap.bat is just a wrapper that calls the Ruby script)
  10. Open an command prompt and CD to a folder that contains your NSBasic script files (Index.htm etc)
  11. Rename “index.htm” to “index.html”
  12. Run “droidgap create”. This will create an Android solution using your NSBasic script files.
  13. Compile the application using Ant and deploy to device for testing.

Tip: Getting rid of URL bar on Android

1. Add this line of code to Main(). It forces the screen to
reposition, moving the URL bar off the top.

Sub Main()
  setTimeout(window.scrollTo(0,window.innerHeight),100)
End Sub

2. Put this code in your program. It makes the contents of the screen full size.

HTML
  <p><br>
  <p><br>
  <p><br>
  <p><br>
  <p><br>
  <p><br>
  <p><br>
  <p><br>
  <p><br>
  <p><br>
  <p><br>
End HTML

We will be developing a more elegant solution, but this should work for now.