Question

I'm very new at Flex Mobile Projects and native extension.

I have a big doubt... If I have an ANE that only works on iOS or Android, can I use it into a project for Android AND iOS?

I mean, if I want to do something and I've only found and ANE that works for iOS and another ANE that works for Android, can I create only one project and depending on the device use one or another? or should I create two different projects?

Thanks in advance

Was it helpful?

Solution

You should be able to correctly code using two different ANE's, one for each platform, but it does really depend on the ANE.

Most provide a isSupported flag to allow you to determine programmatically whether the extension is supported on the current platform.

if (ExtensionA.isSupported)
{
    // Use extension A
}
else if (ExtensionB.isSupported)
{
    // Use extension B
}

It's also worth noting that if the extension isn't correctly implementing a "default" version (i.e. one that gets used on unsupported platforms) this may fail. Really comes down to the ANE implementation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top