Virtualbox WIN/XP and Ubuntu Wine

Lanny Rosiky from the Czech Republic reports that NS Basic/App Studio runs on Virtualbox WIN/XP and on Ubuntu Wine with the Linux version of Chrome.

Are you using App Studio on an interesting configuration? Let us know!

Cache Events

One of the cool features of NS Basic/App Studio is that apps can be installed to the Home screen and run even if the device is offline. It does this by caching the files the app uses.

There have been some questions about how offline apps get cached: how do you tell if you app is being updated with a fresh copy?

It turns out there are some nice events you can watch. You could use these to put up a progress dialog, or a warning to wait until the update is complete. The events only appear if you are downloading a deployed version – they do not fire if you are running locally.

Here’s the important code – a good place to put it is in the global code section.

window.applicationCache.addEventListener("checking", logEvent, false)
window.applicationCache.addEventListener("downloading", logEvent, false)
window.applicationCache.addEventListener("noupdate", logEvent, false)
window.applicationCache.addEventListener("progress", logEvent, false)
window.applicationCache.addEventListener("updateready", logEvent, false)

Function logEvent(e)
  print e.type
End Function

Targeting BlackBerry WebWorks

From Lennie De Villiers:

WebWorks is an open source project by RIM, supporting all new devices like the new Blackberry Torch 9800 (OS 6.0) and Blackberry Playbook tablet PC (from next year). There are two ways to target WebWorks: use WebWorks directly or via PhoneGap. The PhoneGap version adds additional JavaScript APIs. Instructions below are for WebWorks only. If there is demand, I’ll add instructions for PhoneGap as well.

WebWorks is the same as “WebKit” so you can see a lot of videos + tutorials etc on the Blackberry Developer Zone website. The WebWorks home page:
http://us.blackberry.com/developers/browserdev/opensource.jsp

These instructions are for Windows.

  1. Download and install latest JDK 1.6
  2. Download WebWorks SDK from https://github.com/blackberry/WebWorks. You can download the Setup.exe file (size: 301.5MB)
  3. Install the Web Works SDK and note the location.
  4. Create a config.xml file (sample file below). This config.xml file indicates the name of the application, permission settings etc.
  5. Place your NSBasic files into the same folder that contains the config.xml file
  6. Rename “index.htm” to “index.html”
  7. Delete the off line file.
  8. ZIP the directory into a ZIP file. This ZIP file mustn’t contain any special characters (no underscores etc)
  9. Run “bbwp” from the command line giving it your ZIP file as input. For example: bbwp test.zip
  10. Under WebWork’s bin folder you will see “OTAInstall” and “StandardInstall”… The “StandardInstall” folder contains the COD file that you can test on the emulator.
  11. The WebWorks SDK comes with a 6.0 and 5.0 emulator.

Create iOS App Store apps using PhoneGap

From Lennie De Villiers:

This requires a Mac OX running 10.6.0 Snow Leopard or greater.

  1. Download and install XCode with iPhone SDK.
  2. Note: You will need an Apple Developer license (USD $99.00 per year) to deploy to your device or the App Store.
  3. Get the latest PhoneGap for iPhone from GIT. See setup instructions at https://github.com/phonegap/phonegap-iphone
  4. Create a new PhoneGap project using the XCode template.
  5. Delete index.html file under the www folder
  6. Download the NSBasic App Studio project to the www folder
  7. Rename “index.htm” to “index.html”
  8. You might need to change the “index.html” file to use the PhoneGap API if you want to use features like camera etc.
  9. Remove the off line file
  10. Reload the XCode project to pickup your files
  11. Build + Run
  12. You will see an PhoneGap splash screen first before it shows your application.

Once this is done, you can start the process for submitting to the App Store. Be prepared – it’s a lot of work.

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.

What about Palm’s WebOS?

Michael Strupp took some time to try out NS Basic/App Studio on a Palm Pre Plus. In theory, it should work OK: it uses the same HTML5 + WebKit + JavaScript framework that NS Basic/App Studio does. Here’s his report:

I had a chance to try out NSBasic App Studio on my Palm Pre Plus and it looks like it works fine – even the email example worked great (the message loaded into my gmail app, including the body of the text). From what I read, WebOS (the OS running on the Palm Pre) is basically all built upon the WebKit model, so the two seem made for each other.

The only sample app that I tested that I couldn’t get to work right was the one where you squeeze and expand the picture of Mario – I think this is because the WebOS browser natively responds to those gestures already. Otherwise, it seems to work great.

Thanks!

Make App Store apps using AppMobi

Lennie De Villiers from South Africa has built an NS Basic app into AppMobi. AppMobi takes your apps and turns them into packages suitable for submission to the App Store. If you try this, let us know how it goes for you. We will probably turn this into a full Tech Note. Here are his notes:

  1. Register for a free account on AppMobi.com, this free account allows you to test the application but if you want to deploy to the App Store then you need to pay the license fee.
  2. Download and install AppMobi XDK IDE, this requires Chrome and Java 6 run-time. The XDK is a full IDE that run within the web browser.
  3. Run the IDE and start a new project.
  4. Choose “Open project folder” menu option.
  5. It open all the project folders… Within this folder you will find “image” folder and the index.html file
  6. Replace these files with your files (see attached sample)
  7. Back at the IDE choose the Reload button. You will see that the interface will change to show the Twitter example.
  8. Go to appmobi.com on your mobile phone
  9. Login
  10. you might need to download the test program to your phone (SlimFat)
  11. Choose your application
  12. Choose “Test Local” or “Test Anywhere”
  13. Chose Launch
  14. SlimFat will open up and run with your NSBasic application.
  15. To deploy to the App Store you need to purchase a license.

More information on how the XDK IDE works etc can be found on theĀ AppMobi web site.