Cordova (PhoneGap) support in NME

246 views
Skip to first unread message

Joshua Granick

unread,
Aug 10, 2012, 10:48:46 PM8/10/12
to haxe...@googlegroups.com
Hi everyone,

Recently the command-line tools in NME have been maturing. In addition to native deployment, I have been working on adding support for web and Flash (AIR) deployment to each platform.

One of the things which drew me to the Haxe programming language and the NME framework in the first place were choices. I felt that Haxe and NME expanded my choices, allowing me the freedom to publish my content as I wanted.

Following this tradition, you will be able to add "-html5" or "-air" to one of the mobile or desktop platform targets in order to specify that you want either a web or Flash build instead of native C/C++.

Incidentally, this also means that the NME command-line tools are useful for much more than NME projects. I have posted samples online of a Haxe Javascript project, as well as a pure Javascript project, which both use the NME command-line tools to deploy directly to BlackBerry or iOS on mobile.

With a little more work, you will have the option of publishing using Adobe AIR or using NME, interchangeably. Again, this is about choices. It will also make it easier to compare them side-by-side if you prefer.

If you are interested in deploying web-based applications to mobile, I invite you to check out some of the newest development builds, give it a try, and help provide feedback to make this even more mature. You can find directions on how to install NME as well as sample projects for Javascript and Haxe JS, here:

https://gist.github.com/3299508

Marcelo de Moraes Serpa

unread,
Aug 10, 2012, 10:53:18 PM8/10/12
to haxe...@googlegroups.com
Wow!

That's amazing, Joshua. I understand that current NME projects would benefit from this (and NME is mainly about games and more interactive/graphical intensive apps). 

May I ask what's the relationship (if there's one) with this new approach and building regular regular (business) apps for phone gap-supported devices? I've been wanting to use haxe + phone gap for a while.

Cheers!

- Marcelo


Joshua Granick

unread,
Aug 10, 2012, 11:08:43 PM8/10/12
to haxe...@googlegroups.com
Hi Marcelo,

Publishing traditional web projects using NME should be very easy now :)

In my "SampleJS" project, this is the NMML: https://github.com/jgranick/SampleJS/blob/master/SampleJS.nmml

After that, you can compile like this:


    nme test SampleJS.nmml blackberry -html5
    nme test SampleJS.nmml blackberry -simulator -html5
    nme test SampleJS.nmml blackberry -bbos -html5
    nme test SampleJS.nmml ios -html5
    nme test SampleJS.nmml ios -simulator -html5


There is a "SampleHaxeJS" project that is similar, but uses Haxe-compiled Javascript instead of hand-written Javascript.
Reply all
Reply to author
Forward
0 new messages