You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Sumudu Chinthaka <cs...@gmail.com> on 2014/02/12 07:30:18 UTC

Native Extension

Hi

I have being working on a Native Extension for a Flex Mobile app and came
across this problem

i want to have a  default implementation of the extension written in AS, so
that i can test the app on FB imulator without any errors.but i found that
 i could not use any Flex Framework classes in the library. please let me
know how to use them.

what i ideally want to do is supply native extensions for Android and IOS,
any other platform that app runs (Blackberry/Windows Emulator ) should pick
up default AS implementation with some flex controls in it

Please let me know whether this is possible

Thanks
Sumudu

RE: Native Extension

Posted by Maurice Amsellem <ma...@systar.com>.
There is also a full example with sources at the following location:
http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/vibration.html

Source is in:  Vibration.zip.

HTH

Maurice 

-----Message d'origine-----
De : Maurice Amsellem [mailto:maurice.amsellem@systar.com] 
Envoyé : mercredi 12 février 2014 15:25
À : users@flex.apache.org
Objet : RE: Native Extension

Someone else had the same problem in an earlier thread ("How to avoid native extension execution", on 11/26/2013), so this is what I answered to him:
___________

Instead of referencing the ANE in the app descriptor, you can package your ANE is a separate SWC, using ADT,  that has its own deployment descriptor.

In that descriptor, you can say which  file/class is used on which platform, so you can set it to use a fake class on Desktop.

Example:
adt -package -target ane myextension.ane extension.xml -swc mySwc.swc -platform iPhone-ARM library.swf libmylib.a -platformoptions myplatformoptions.xml

OR:
adt -package -target ane Output.ane extension.xml -swc VolumeLib.swc -platform iPhone-ARM -C ios . -platformoptions platformoptions.xml -platform Android-ARM -C android . -platform default -C default

http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt5.html

The sample mobile demo "FlexGame" uses this approach:

http://www.adobe.com/devnet/flex/samples/game-of-flex-on-tablets.html

(source is available in the page).

HTH.

Maurice

-----Message d'origine-----
De : Sumudu Chinthaka [mailto:csumudu@gmail.com] Envoyé : mercredi 12 février 2014 07:30 À : users@flex.apache.org Objet : Native Extension

Hi

I have being working on a Native Extension for a Flex Mobile app and came across this problem

i want to have a  default implementation of the extension written in AS, so that i can test the app on FB imulator without any errors.but i found that  i could not use any Flex Framework classes in the library. please let me know how to use them.

what i ideally want to do is supply native extensions for Android and IOS, any other platform that app runs (Blackberry/Windows Emulator ) should pick up default AS implementation with some flex controls in it

Please let me know whether this is possible

Thanks
Sumudu

RE: Native Extension

Posted by Maurice Amsellem <ma...@systar.com>.
Someone else had the same problem in an earlier thread ("How to avoid native extension execution", on 11/26/2013), so this is what I answered to him:
___________

Instead of referencing the ANE in the app descriptor, you can package your ANE is a separate SWC, using ADT,  that has its own deployment descriptor.

In that descriptor, you can say which  file/class is used on which platform, so you can set it to use a fake class on Desktop.

Example:
adt -package -target ane myextension.ane extension.xml -swc mySwc.swc -platform iPhone-ARM library.swf libmylib.a -platformoptions myplatformoptions.xml

OR:
adt -package -target ane Output.ane extension.xml -swc VolumeLib.swc -platform iPhone-ARM -C ios . -platformoptions platformoptions.xml -platform Android-ARM -C android . -platform default -C default

http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt5.html

The sample mobile demo "FlexGame" uses this approach:

http://www.adobe.com/devnet/flex/samples/game-of-flex-on-tablets.html

(source is available in the page).

HTH.

Maurice

-----Message d'origine-----
De : Sumudu Chinthaka [mailto:csumudu@gmail.com] 
Envoyé : mercredi 12 février 2014 07:30
À : users@flex.apache.org
Objet : Native Extension

Hi

I have being working on a Native Extension for a Flex Mobile app and came across this problem

i want to have a  default implementation of the extension written in AS, so that i can test the app on FB imulator without any errors.but i found that  i could not use any Flex Framework classes in the library. please let me know how to use them.

what i ideally want to do is supply native extensions for Android and IOS, any other platform that app runs (Blackberry/Windows Emulator ) should pick up default AS implementation with some flex controls in it

Please let me know whether this is possible

Thanks
Sumudu

Re: Native Extension

Posted by Alex Harui <ah...@adobe.com>.
I'm not an expert on Native Extensions, but my understanding is that they
are designed to interface with a platform/device-specific native code.

If you want per-platform UI, you can switch to different UI's using view
states and/or themes.

-Alex

On 2/11/14 10:30 PM, "Sumudu Chinthaka" <cs...@gmail.com> wrote:

>Hi
>
>I have being working on a Native Extension for a Flex Mobile app and came
>across this problem
>
>i want to have a  default implementation of the extension written in AS,
>so
>that i can test the app on FB imulator without any errors.but i found that
> i could not use any Flex Framework classes in the library. please let me
>know how to use them.
>
>what i ideally want to do is supply native extensions for Android and IOS,
>any other platform that app runs (Blackberry/Windows Emulator ) should
>pick
>up default AS implementation with some flex controls in it
>
>Please let me know whether this is possible
>
>Thanks
>Sumudu