I’ve had this example of the Vibration ActionScript Native Extension (ANE) on my DROID3 for some time now and am just thrilled with the expanded capabilities of ANE in Adobe AIR 3 for both mobile and desktop. Wanted to share this example which I originally wrote for my upcoming AIR 3 book which displays the Vibration ANE in action on a device!
Native extensions for Adobe AIR are a combination of ActionScript classes and native code that provide easy access to device-specific libraries and features that are not available in the built-in ActionScript classes.
Want to use it in your own projects? Adobe has made it available for download here :)
…and a few others are also available from the Adobe Developer Connection repository! I have a feeling we’ll be seeing a lot of these pop up in the weeks and months to come.
Nice, I’ve been really needing this for a project I’ve had in mind for a long time.
Thanks!
hi Joseph,
thanks for this example. I’ve tried out the extension but can’t seem to get t working though. Could you please take a look at my question here?
http://forums.adobe.com/message/3939849#3939849
I noticed the libs folder in your TestVibrationExtension folder is empty. If I add the .swc from the ReadyToUseExtension folder to it, then I get the error shown in the forum thread. Do I also need to do something with the .ane file? Any idea why this error happens?
thanks,
Jeff.
Have a look at http://www.adobe.com/devnet/air/articles/extending-air.html – Oliver goes into packaging options.
Yes, you absolutely need to include the .ane – the .swc simply has the hooks for AS3 – all the actual code is enclosed in the .ane package.
I have been trying to get this to work on my Galaxy Tab with Android 4.0.4 and while it reports that vibration is supported, and I have the permission set to allow vibration, nothing ever vibrates. Have you tested it on any newer devices/versions of Android recently?
I just tested on a Droid3 running Jelly Bean and it works just fine. Different hardware and software than your example – but I had no problems.