Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download the ANE+SWC files from the Appoxee Download Page.
  2. Create a new ActionScript Mobile Project, as shown in the image.
  3. Name your project , as shown in the image.
  4. In the new project's dialog under Mobile Settings tab, mark the following permissions : INTERNET , WRITE_EXTERNAL_STORAGE, WAKE_LOCK, ACCESS_NETWORK_STATE , as shown in the image. Make sure that "Google Android" is ticked under "Target Platforms"
  5. in the new project's dialog under Build Paths tab, in the Library Path tab, Add the Appoxee SWC. add other SWC files if you use other 3rd party libs.
  6. in the new project's dialog under Build Paths tab, in the Native Extensions tab, Add the Appoxee ANE. add other ANE files if you use other 3rd party libs.
  7. After the project is generated, go into it's properties, into ActionScript Build Package ->Google Android and tick all the checkboxes of the ANE, including Appoxee's . Press OK.
  8. In your app's XML file , inside the Android tag you will find the Android Additions. Add the following code before the </manifest> tag : 

    Code Block
    languagexml
    firstline1
    titleManifest Additions
    linenumberstrue
    ...
    <permission android:name="air.DemoApp.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="air.DemoApp.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    
    <application>
    
    	 <meta-data android:name="com.google.android.gms.version"
      	  android:value="@integer/google_play_services_version" />
    
       	 <service android:name="com.appoxee.gcm.PlayIntentService" />
    	 <!-- REQUIRED for C2DM -->
    
            <receiver
                android:name="com.appoxee.gcm.PlayBroadcastReceiver"
                android:permission="com.google.android.c2dm.permission.SEND" >
    
                <!-- Receive the actual message -->
                <intent-filter>
                    <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                    <category android:name="air.DemoApp" />
                </intent-filter>
    
                <!-- Receive the registration id -->
                <intent-filter>
                    <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                    <category android:name="air.DemoApp" />
                </intent-filter>
            </receiver>
     </application> 
  9. In your app's main .as file , add the following code : 

    Code Block
    languageactionscript3
    firstline1
    titleCode into your main .as file
    linenumberstrue
    //Add this to imports : 
    
    import com.appoxee.AppoxeeANE;
    import com.appoxee.CallbackResult;
    import flash.events.Event;
    
    //Add this to class : 
    private var _appoxeeANE:AppoxeeANE;
    
    //Add the class's constructor : 
    
    _appoxeeANE = new AppoxeeANE("5625d0c93066e6.01334678","5625d0c9306825.8037476","air.DemoApp.debug.AppEntry");
    
    //Activate / De-Activate Event Registration
    this.addEventListener(Event.ACTIVATE,appActivate,false,0,true);
    this.addEventListener(Event.DEACTIVATE,appDeActivate,false,0,true);
    ...
    
    //Add this to class : 
    
    private function handleCallback(result:CallbackResult):void {
    //Do what is needed ...
    }
    
    private function appActivate(_event:Event):void {
    _appoxeeANE.onActivate();
    _appoxeeANE.addCallbackFunction(handleCallback)
    }
    
    private function appDeActivate(_event:Event):void {
    _appoxeeANE.onDeactivate();
    _appoxeeANE.removeCallbackFunction(handleCallback);
    }
  10. This conclude the basic integration of the ANE. Click here to see API usage.

...