fredag den 26. november 2010

How to test applications written in JavaScript

Anyone who has tried to build a mobile application using JavaScript has been in a situation where they have tested their application as much as you can in your desktop browser but once you get it on your phone it doesnt work like its suppose to.

Well someone has tried that situation so many times that they finally did something about it. Introducing "Ripple" an extension to Chrome that allows you to test your web-app under a wide range of supported platforms. Once you select a platform you can setup what kind of device you want it it emulate. Say you want to test your web-app on an iPhone simply select that as well the orientation of the screen (portrait/landscape).

Your application is now being shown emulated on an iPhone. From here you have a bunch of tools at your disposal.

  • Accelerometer - Send input to your application from the emulated accelerometer, you could tell it, it's being tilted sideways and should adapt to landscape mode instead for instance. 
  • Geo Location - Does your application use input from the GPS? You can also send coordinates among other geo info to it.
  • Storage - Need to store something on the phone? Using the key/value storage you can do this as well.

Ripple also supports phonegap and could be used to test your application before compiling it to a real app on Android or iOS. For a list which parts of the phonegap API Ripple supports see this site

The only downside to Ripple is that it doesn't work with file system paths, so you need to set up a web server to use it. (more info here)

Since the Ripple homepage is remarkably empty of screenshots i have made one for you. It's the mobile twitter site running in phonegap on an iPhone

Screenshot of Twitter Mobile running in ripple
Ripple homepage: Ripple
Installing ripple: Installing Ripple

torsdag den 25. november 2010

Write once, Test, Build in the Cloud and Publish

In an earlier blogpost i wrote about a wonderous new technology called "Phonegap" that allowed you to publish apps written in Javascript to just about any mobile platform.

The biggest problem with Phonegap was that you had to install the SDK and IDE's unique to each platform which complicated the build process a whole lot.

They have tackled this problem with a new initiative. The concept is quite simple, why compile it yourself when you can have it done correctly and proffesionaly the first time on Phonegaps servers?

Build in the Cloud
With their new 'cloud-build' service all you have to do is write your Javascript/HTML5 against the generic Phonegap Javascript API. Once your done you upload your app in an zip file or similiar, select which platforms you wan't to publish to and hit done. When the server is finished you will get access to your platform specific apps ready to be added to the markets.

Market limitations
Not all platforms are currently supported, most notably iOS and WP7 aren't available yet. This is not a technological barrier, this is simply due to legal concerns with Apple and Microsoft. Issues that are currently being ironed out and hopefully means we will be able to get out apps built for those platforms as well.
PhoneGaps Cloud build server supports
Building apps for a mobile phone no longer requires tedious work installing IDE's or SDK, nor does it require any knowledge or experience in Java, Silverlight or ObjectC. Anyone with 30 minutes to learn the basics of JavaScript can get started. The mobile platform is truly wondrous.

Phonegap Cloud Build: http://build.phonegap.com/