<commit_before>#License
This project is provided under a MIT open-source license. See LICENSE.md

#Structure
Finished ANE ready for download: https://github.com/AppKey/AIR/blob/master/ANE/AppKey-1-6.ane

The approach to the AppKey ANE roughly follows the Adobe Android ANE tutorial.
Setting up a proper FlashBuilder environment is as tricky as building the ANE itself.
Instructions for a basic ANE & build environment setup can be found here:
http://www.adobe.com/devnet/air/articles/ane-android-devices.html

/actionscript - ANE interface definition in actionscript<br />
/android - Native side of the ANE<br />
/build - ANE build scripts. Run buildANE.sh to rebuild the ANE<br />
/ANE - Finished ANE<br />
/demo - Flex based demo project that uses the ANE<br />

#Demo project
Typically the fastest way to become familiar with the AppKey AIR integration is
to download and run the sample flex project in /demo. The demo app automatically
checks AppKey status when run, and every time the user switches back to the app.

https://github.com/AppKey/AIR/blob/master/demo/AppKeyANEdemo.apk

Open the project in Flash Builder to observe the (rather simple) integration.

#Integration
1. Add AppKey-x-x.ane to your AIR project
2. Instantiate & Initialize AppKey upon creationComplete()
```actionscript
import com.appkey.ane.AppKey;
import com.appkey.ane.AppKeyEvent;
...
private static const AppKeyAppId : String = "0";  <<<---- NOTE: Replace with AppId from AppKey.com
private static const AppKeyAnalyticsEnabled : Boolean = true;
private var mAppKey:AppKey = null;
...
private function handleCreationComplete():void
{
	mAppKey = new AppKey(AppKeyAppId, AppKeyAnalyticsEnabled);
	mAppKey.addEventListener(AppKeyEvent.APPKEY_ENABLED, this.onEvent);
	mAppKey.addEventListener(AppKeyEvent.APPKEY_DISABLED, this.onEvent);
	mAppKey.checkAccess();
}
```
3. Create event handlers that switch on/off AppKey features
```actionscript
public function onEvent(akEvent:AppKeyEvent):void {
	switch (akEvent.type) {
		case AppKeyEvent.APPKEY_ENABLED:
			//TODO: Insert code here to ENABLE features for AppKey users
			break;
		case AppKeyEvent.APPKEY_DISABLED:
			//TODO: Insert code here to DISABLE features for AppKey users
			break;
	}
}
```
4. Prompt the user to install and/or enable AppKey.  (Note - AppKey handles all
the UI, your app simply needs to call promptUser())
```actionscript
private static const AppKeyBenefit : String = "feature";  <<<--- Replace with feature to be unlocked
...
public function button_promptUser_clickHandler(event:MouseEvent):void
{
	mAppKey.promptUser(AppKeyBenefit);
}
```

#Feedback
We would love your feedback and/or improvements to this project - <EMAIL><commit_msg>Small update to docs<commit_after>#License
This project is provided under a MIT open-source license. See LICENSE.md

#Structure
Finished ANE ready for download: https://github.com/AppKey/AIR/blob/master/ANE/AppKey-1-6.ane

The approach to the AppKey ANE roughly follows the Adobe Android ANE tutorial.
Setting up a proper FlashBuilder environment is as tricky as building the ANE itself.
Instructions for a basic ANE & build environment setup can be found here:
http://www.adobe.com/devnet/air/articles/ane-android-devices.html

/actionscript - ANE interface definition in actionscript<br />
/android - Native side of the ANE<br />
/build - ANE build scripts. Run buildANE.sh to rebuild the ANE<br />
/ANE - Finished ANE<br />
/demo - Flex based demo project that uses the ANE<br />

#Demo project
Typically the fastest way to become familiar with the AppKey AIR integration is
to download and run the sample flex project in /demo. The demo app automatically
checks AppKey status when run, and every time the user switches back to the app.

https://github.com/AppKey/AIR/blob/master/demo/AppKeyANEdemo.apk

Open the project in Flash Builder to observe the (rather simple) integration.

#Integration
1) Add AppKey-x-x.ane to your AIR project
2) Instantiate & Initialize AppKey upon creationComplete()
```actionscript
import com.appkey.ane.AppKey;
import com.appkey.ane.AppKeyEvent;
...
private static const AppKeyAppId : String = "0";  <<<---- NOTE: Replace with AppId from AppKey.com
private static const AppKeyAnalyticsEnabled : Boolean = true;
private var mAppKey:AppKey = null;
...
private function handleCreationComplete():void
{
	mAppKey = new AppKey(AppKeyAppId, AppKeyAnalyticsEnabled);
	mAppKey.addEventListener(AppKeyEvent.APPKEY_ENABLED, this.onEvent);
	mAppKey.addEventListener(AppKeyEvent.APPKEY_DISABLED, this.onEvent);
	mAppKey.checkAccess();
}
```
3) Create event handlers that switch on/off AppKey features
```actionscript
public function onEvent(akEvent:AppKeyEvent):void {
	switch (akEvent.type) {
		case AppKeyEvent.APPKEY_ENABLED:
			//TODO: Insert code here to ENABLE features for AppKey users
			break;
		case AppKeyEvent.APPKEY_DISABLED:
			//TODO: Insert code here to DISABLE features for AppKey users
			break;
	}
}
```
4) Prompt the user to install and/or enable AppKey.  (Note - AppKey handles all
the UI, your app simply needs to call promptUser())
```actionscript
private static const AppKeyBenefit : String = "feature";  <<<--- Replace with feature to be unlocked
...
public function button_promptUser_clickHandler(event:MouseEvent):void
{
	mAppKey.promptUser(AppKeyBenefit);
}
```

#Feedback
We would love your feedback and/or improvements to this project - <EMAIL>
{'fraction_non_alphanumeric': 0.08765088207985144, 'fraction_numerical': 0.0025998142989786446, 'mean_word_length': 4.657563025210084, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7069596', 'n_tokens_mistral': 1642, 'n_tokens_neox': 1576, 'n_words': 592}