Skip to content

Simple OpenFL extension for accessing android device hardware methods.

License

Notifications You must be signed in to change notification settings

ktravis/haxe-hardware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

haxe-hardware

Simple OpenFL extension for accessing android device hardware methods.

Currently implements methods to use the android vibrator and access screen dimensions.

Install via haxelib git haxe-hardware https://github.com/ktravis/haxe-hardware

Add to project.xml:

<haxelib name="openfl" />
<haxelib name="haxe-hardware" if="android" />

And import into your project (haxe) with:

import Hardware;

Exposed methods are currently:

public static function vibrate(int duration):Void;
public static function getScreenWidth():Int;
public static function getScreenHeight():Int;
public static function wakeUp():Void;

More can be simply added in the java source file, replicating the function and corresponding JNI.createStaticMethod(...) call in Hardware.hx.

Contributions

Thank you to alagator for contributing wakeUp()!

About

Simple OpenFL extension for accessing android device hardware methods.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published