With BlackBerry having recently announced the death of AIR, including the planned removal of applications from user phones, I thought I would leave a small present for other BlackBerry AIR developers on their final build months.
Freeware & Open Source : BlackBerry 10 ANE for AIR, Access to Camera Flash
What it does:
This allows AIR developers to turn the phones flash on and off.
How to setup an ANE in AIR:
Step 1: Launch Adobe Flash Builder
Step 2: Drag and Drop the ANE to your projects SRC folder
Step 3: Open bardescriptor.xml and add the following to the permissions section:
- <permission system=“true”>run_air_native</permission>
Step 4: Right click on your project and select properties
Step 5: Select ActionScript Build Path, Native Extensions tab, press Add ANE, and browse to your projects SRC folder to pick the file CameraFlashBB10_16.ane
Step 6: Select ActionScript Build Packaging and open BlackBerry
Step 7: Select Native Extensions, scroll to the right, and check Package beside the ANE above
How to use the ANE:
Now it can be referenced like any object.
- import com.FileArchiveHaven.CameraFlash.CameraFlashBB10;
- private var flashANE:CameraFlashBB10 = new CameraFlashBB10();
- flashANE.myver – Returns a string with the version of the ANE
- flashANE.flashOn(); – Returns a Number that is the flash instance
- flashAne.flashOff(Number); – Turns off a flash instance with the flash instance specified
ANE, Sample Project, and BAR