Highlighted

ANE Android onCreate

Enthusiast ,
May 09, 2016

Copy link to clipboard

Copied

Hi,

I am working on an ANE that requires a call to be made during onCreate of the application.

I have found a number of threads on this, all prefaced with "Adobe does not support this, you are mad, here be dragons" etc.

Has anybody found a viable workaround to support making a call during "onCreate" to initialise a third-party service?

Thanks,

G

Im going to say no it is not possible. If you look at the source code for Adobe's main Activity class, "AndroidActivityWrapper", you will see in its "onCreate()" function definition, that it does a tiny amount of setup, and then runs a method called "afterOnCreate()" which instantiates an object called "AIRWindowSurfaceView". I am going to take a wild guess that that class is the AIR runtime that your AIR app runs in. Assuming that I am right and the "AIRWindowSurfaceView" is the container for the SWF part of your AIR app, then any AS3 code you have that would initialize an ANE would happen after "onCreate()" had already fired.

Link below to someone having decompiled the Android/AIR JAR file. Because it is decompiled, you will see a tad bit of wonkiness to it, but the overall structure of the source is there.

I imagine that the only way for you to have something occur in "onCreate()" is if you could have the original source files that make an Android/AIR app possible, add your code to it, create a new JAR file of it, and have Flash CS6/CC use that instead of the one Adobe created when it publishes your AIR app. This approach, assuming it is even possible, would also require the runtime to be embedded with the app since you technically modified part of it.

https://searchcode.com/codesearch/view/85539041/

TOPICS
Development

Views

487

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

ANE Android onCreate

Enthusiast ,
May 09, 2016

Copy link to clipboard

Copied

Hi,

I am working on an ANE that requires a call to be made during onCreate of the application.

I have found a number of threads on this, all prefaced with "Adobe does not support this, you are mad, here be dragons" etc.

Has anybody found a viable workaround to support making a call during "onCreate" to initialise a third-party service?

Thanks,

G

Im going to say no it is not possible. If you look at the source code for Adobe's main Activity class, "AndroidActivityWrapper", you will see in its "onCreate()" function definition, that it does a tiny amount of setup, and then runs a method called "afterOnCreate()" which instantiates an object called "AIRWindowSurfaceView". I am going to take a wild guess that that class is the AIR runtime that your AIR app runs in. Assuming that I am right and the "AIRWindowSurfaceView" is the container for the SWF part of your AIR app, then any AS3 code you have that would initialize an ANE would happen after "onCreate()" had already fired.

Link below to someone having decompiled the Android/AIR JAR file. Because it is decompiled, you will see a tad bit of wonkiness to it, but the overall structure of the source is there.

I imagine that the only way for you to have something occur in "onCreate()" is if you could have the original source files that make an Android/AIR app possible, add your code to it, create a new JAR file of it, and have Flash CS6/CC use that instead of the one Adobe created when it publishes your AIR app. This approach, assuming it is even possible, would also require the runtime to be embedded with the app since you technically modified part of it.

https://searchcode.com/codesearch/view/85539041/

TOPICS
Development

Views

488

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 09, 2016 0
Engaged ,
May 09, 2016

Copy link to clipboard

Copied

Im going to say no it is not possible. If you look at the source code for Adobe's main Activity class, "AndroidActivityWrapper", you will see in its "onCreate()" function definition, that it does a tiny amount of setup, and then runs a method called "afterOnCreate()" which instantiates an object called "AIRWindowSurfaceView". I am going to take a wild guess that that class is the AIR runtime that your AIR app runs in. Assuming that I am right and the "AIRWindowSurfaceView" is the container for the SWF part of your AIR app, then any AS3 code you have that would initialize an ANE would happen after "onCreate()" had already fired.

Link below to someone having decompiled the Android/AIR JAR file. Because it is decompiled, you will see a tad bit of wonkiness to it, but the overall structure of the source is there.

I imagine that the only way for you to have something occur in "onCreate()" is if you could have the original source files that make an Android/AIR app possible, add your code to it, create a new JAR file of it, and have Flash CS6/CC use that instead of the one Adobe created when it publishes your AIR app. This approach, assuming it is even possible, would also require the runtime to be embedded with the app since you technically modified part of it.

https://searchcode.com/codesearch/view/85539041/

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 09, 2016 1
Enthusiast ,
May 09, 2016

Copy link to clipboard

Copied

Thanks, I suspected that but I wanted to be sure before approaching the third-party.

G

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 09, 2016 0
Engaged ,
May 10, 2016

Copy link to clipboard

Copied

Sorry to be the bearer of bad news but I figured I would at least investigate it some and give you a reason as to why you can't instead of giving you the annoying responses you had already read about from other people.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 10, 2016 1