Haxe library for mobile APIs like location, compass, camera, etc?

902 views
Skip to first unread message

trusktr

unread,
Sep 23, 2012, 3:10:07 AM9/23/12
to haxe...@googlegroups.com
Is there a library for Haxe so that one can, for example, access the readings from a device's compass? Does HaxeNME have any such features?

For example, take a look at the PhoneGap framework for making cross-platform apps using HTML5. It provides developers with JavaScript API for getting such things as compass readings or screen orientation readings. Under the hood, the API is calling native functions specific to the platform on which the app is running, but to the developer he only has to worry about a single API (an abstraction).

Does something like this already exist for Haxe or HaxeNME? I'd like to use the power of NME to make dynamic animated apps, but be able to access certain things like the device tilt/gyro, compass, etc, regardless of device. If a feature like this doesn't already exist, adding would be a great addition to Haxe.

Cauê Waneck

unread,
Oct 1, 2012, 12:55:54 PM10/1/12
to haxe...@googlegroups.com
Hi,

If you're ok to do only iOs for now, there is croxit ( https://github.com/waneck/croxit/ ), which provides a webview, like PhoneGap, and there are the geo-location (https://github.com/waneck/croxit-geo) and camera (https://github.com/waneck/croxit-camera) plugins. When I have the time, I'll release the NME integration plugin also, and start working on the android side as well

2012/9/23 trusktr <tru...@gmail.com>
Is there a library for Haxe so that one can, for example, access the readings from a device's compass? Does HaxeNME have any such features?

For example, take a look at the PhoneGap framework for making cross-platform apps using HTML5. It provides developers with JavaScript API for getting such things as compass readings or screen orientation readings. Under the hood, the API is calling native functions specific to the platform on which the app is running, but to the developer he only has to worry about a single API (an abstraction).

Does something like this already exist for Haxe or HaxeNME? I'd like to use the power of NME to make dynamic animated apps, but be able to access certain things like the device tilt/gyro, compass, etc, regardless of device. If a feature like this doesn't already exist, adding would be a great addition to Haxe.

Emiliano Angelini

unread,
Oct 2, 2012, 9:02:15 AM10/2/12
to haxe...@googlegroups.com
Hi,

I've made a few simple NME extensions here: https://github.com/emibap/nmeXtensions
It's not everything you want but at least you can play with the LocationManager extension and perhaps add more functionality. It's currently for iOS only.

Cheers

BP

unread,
Oct 25, 2012, 6:20:01 AM10/25/12
to haxe...@googlegroups.com
There's also this library as well:



On Sunday, September 23, 2012 4:10:07 AM UTC-3, trusktr wrote:

trusktr

unread,
Oct 26, 2012, 5:02:25 PM10/26/12
to haxe...@googlegroups.com
Cauê, Coxit looks interesting.

What i'm auming to do is make an interface that is 100% hardware accelerated.

Can you explain more about Coxit? How does it compare to PhoneGap? What are the differences? You mentioned "native" on github in terms of ui. What do you mean exactly? Is it hardware accelerated?

trusktr

unread,
Oct 26, 2012, 9:40:57 PM10/26/12
to haxe...@googlegroups.com
I meant *aiming* in my previous reply. Do Croxit and PhoneGap both use webkit? That's what I'm guessing since it uses the iOS web view. Please describe all the advantages Croxit has over PhoneGap. That'd be very helpful!

Cauê Waneck

unread,
Oct 27, 2012, 5:58:03 PM10/27/12
to haxe...@googlegroups.com

2012/10/26 trusktr <tru...@gmail.com>

I meant *aiming* in my previous reply. Do Croxit and PhoneGap both use webkit? That's what I'm guessing since it uses the iOS web view. Please describe all the advantages Croxit has over PhoneGap. That'd be very helpful!

Hi trusktr,

Yes, they both use WebKit on iOs. 
Croxit's main advantage is that you compile a native program, so you're not restricted by JavaScript's limitations.
Also it works on a client / server way, so you can test on your browser first with neko development server, and you can even compile the same code base as a web app (instead of a mobile one)

Cheers!
Cauê

Cauê Waneck

unread,
Oct 27, 2012, 6:02:38 PM10/27/12
to haxe...@googlegroups.com
About hardware acceleration, you won't be able to achieve that with either Phonegap or Croxit.
I'm working on a croxit extension that allows NME to work on top of it, so that would probably solve it. But it's still very nme version dependent so I really need to work on a better solution for it ;)

Cheers
Cauê

2012/10/27 Cauê Waneck <wan...@gmail.com>

trusktr

unread,
Oct 29, 2012, 10:35:02 PM10/29/12
to haxe...@googlegroups.com
Oh ok i see. So you mean that many of the native features are available through the JavaScript API via the web view, right?

I'll be looking forward to seeing how Croxit progresses.

trusktr

unread,
Oct 29, 2012, 10:36:52 PM10/29/12
to haxe...@googlegroups.com
Speaking of hardware acceleration, I bet IE10 will raise the bar for Mozilla and Google to implement full hardware acceleration in their browsers. I can't wait ti see how it turns our.
Reply all
Reply to author
Forward
0 new messages