Skip to content

Instantly share code, notes, and snippets.

View creativedrewy's full-sized avatar

Andrew Watson creativedrewy

View GitHub Profile
@creativedrewy
creativedrewy / NFCDataHandling.as
Last active December 11, 2015 04:08
Sample Adobe AIR Android application class that handles incoming NFC intent data.
package
{
import flash.desktop.NativeApplication;
import flash.events.InvokeEvent;
public class NFCDataHandling extends Sprite
{
/**
* Constructor
*/
@creativedrewy
creativedrewy / SampleManifestAdditions.xml
Last active December 11, 2015 04:08
An example of how to setup an Adobe AIR for Android application xml file to enable incoming NFC data.
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="auto">
<!-- I left out the "default" AIR manifest additions that are there by default. You should keep those. -->
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />
<application android:enabled="true">
<activity android:excludeFromRecents="false">
@creativedrewy
creativedrewy / LinkedAssetLibraryBase.as
Created November 8, 2012 02:12
Use AS3 describeType() to dynamically list out strongly-typed referenced assets in a class
package com.creativedrewy.app.model.assetlibrary
{
import flash.display.Sprite;
import flash.utils.describeType;
import flash.utils.getDefinitionByName;
/**
* Base class for asset libraries that index their clips based on the "asset helper"
* model, where assets are ref'd only by class name
*/
@creativedrewy
creativedrewy / as3 embed sample.as3
Created November 7, 2012 03:20
Cannot embed sym-linked files in AS3 on Windows
[Embed(source="assets/socketMessages.json", mimeType="application/octet-stream")]
public var SocketMessages:Class;
@creativedrewy
creativedrewy / flashpolicy.xml
Created October 13, 2012 01:56 — forked from mattcg/flashpolicy.xml
A simple Flash socket policy server for NodeJS.
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<!-- Policy file for xmlsocket://socks.example.com -->
<cross-domain-policy>
<!-- This is a master socket policy file -->
<!-- No other socket policies on the host will be permitted -->
<site-control permitted-cross-domain-policies="master-only"/>
@creativedrewy
creativedrewy / gist:3411593
Created August 21, 2012 04:35
Android List of Installed Apps
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
lView = (ListView) findViewById(R.id.list1);
PackageManager pm = this.getPackageManager();
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
List list = pm.queryIntentActivities(intent, PackageManager.PERMISSION_GRANTED);