Skip to main content
Inspiring
February 27, 2012
Question

ANE with default platform

  • February 27, 2012
  • 17 replies
  • 5938 views

Is there an existing code example for an ANE that includes a default platform? All of the examples I can find simply implement one or more platforms.

I have managed to build a native extension to read phone number from an Android phone, but I want to be able to run a version on other platforms where the isSupported function simply returns false. When running from Flash Builder, an error message tells me it cannot find my PhoneNumber class.

This topic has been closed for replies.

17 replies

Participant
September 5, 2012

I'm having the same issue. I'm not convinced anyone has actually created an ANE with a default lib.

Any luck ?

January 8, 2013

@lyvewoy8gcfwewf: Were you ever able to figure this out?

January 8, 2013

Nope.

I endup handling the default behavior in the ane swf.

If there is not a valid ExtensionContext then I defaulted to a default behaviour. a cheap way of doing this was with try/catch blocks around the extension context call.

Participating Frequently
March 6, 2012


This one has the solution:
http://www.riaspace.com/2011/08/defining-custom-url-schemes-for-your-air-mobile-applications/

<extension xmlns="http://ns.adobe.com/air/extension/3.1">

    <id>extensionId</id>

    <versionNumber>0.0.1</versionNumber>

    <platforms>

        <platform name="iPhone-ARM">

            <applicationDeployment>

                <nativeLibrary>libContactEditor.a</nativeLibrary>

                <initializer>ContactEditorExtInitializer</initializer>

                <finalizer>ContactEditorExtFinalizer</finalizer>

            </applicationDeployment>

        </platform>

        <platform name="default">

            <applicationDeployment/>

        </platform>

    </platforms>

</extension>

adt -package -target ane ContactEditor.ane ./extension.xml -swc ContactEditor.swc -platform iPhone-ARM library.swf libContactEditor.a  -platform default library.swf

Inspiring
March 7, 2012

Just say it's very important that Default library.swf and iPhone/Android library.swf must be different. In Default library.swf should not do calls to any native extension, you must only to implement the same functions to prevent APP not blocked.

Participating Frequently
March 7, 2012

Actualy this is not so important to be completle diferent if there is a "isSupported()" function. Default platform packing is also a good solution to use it as a alternative to support it on the desktop for debbuging even if the project is only mobile. But isSupported() is one of the most important function and should be writen as first.