0
votes

I try to run : http://www.smallscreendesign.com/2011/09/29/air-native-extensions-rock/

I downloaded the code and imported the project folder (AndroidExtensions_Demo) in Flash Builder 4.6, changed the air version to 3.1, changed the flex compiler to 4.6 as that is what I’m using and ran it on the device.

However, when I clicked on Send button, I got the error below.

TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.ssd.ane::AndroidExtensions$/get context()[/Users/anto/git/Android-AIR-Extensions/AndroidExtensions/src/com/ssd/ane/AndroidExtensions.as:158] at com.ssd.ane::AndroidExtensions$/shareText()[/Users/anto/git/Android-AIR-Extensions/AndroidExtensions/src/com/ssd/ane/AndroidExtensions.as:48]

Is there another way to send SMS with Flex Mobile ? I want to avoid the manual sending SMS process by pressing "Send" or "Ok" button

1

1 Answers

0
votes

The reported exception refers to a failure during the context setup of the ANE. It should be mostly related to project configuration in many different ways.

Make sure you're setting the correct path of the ANE in your project and please consider a full rebuild of the ANE, including the native (Android) code in order to avoid further problems.

Edit:
Unfortunately AIR doesn't provide any native other way to send a SMS save calling the navigateToUrl() using the sms: uri scheme (eg: navigateToUrl("sms:5551234567"); ). This way however the system SMS editor will be shown and you can't specify any body neither.

The only way to send an SMS in a full programmatically way is to write your own ANE and leverage Android APIs in order to get the things done.