Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.
marchbold edited this page May 23, 2018 · 2 revisions

built by distriqt //

Custom Android Resources

This project uses an Apache Ant build script to create and package an ANE with your custom Android resources.

The main purpose of this is to allow AIR developers to easily add android resources such as notification icons and configuration values using the correct Android resource process.

This is very important for resources such as notifications icons:

To use this script ensure you have Apache Ant installed on your machine along with a recent version of the AIR and Android SDKs and a version of Java.

Once you have all those setup, download this repository and open the build.config file. You will need to update the paths to the AIR and Android SDKS, however the rest you can leave as is.

# AIR SDK
air.sdk = /PATH/TO/YOUR/AIR/SDK

# ANDROID
android.sdk = /PATH/TO/YOUR/ANDROID/SDK

On Windows it will look something like the following, you must make sure to use two backslashes to correctly escape a backslash:

# AIR SDK
air.sdk = C:\\Users\\username\\sdks\\air\\AIRSDK_22.0.0.153

# ANDROID
android.sdk = C:\\Users\\username\\AppData\\Local\\Android\\sdk

Resources

Next you will need to place your resources to the res folder. You can add any custom resources your application requires.

The next section shows how to create notification icons to use in our extensions.

Notification Icons

The Android Asset Studio is a great resource which will convert your icon into the correct sizes and formats for an Android notification icon.

Your notification icon needs to be white(grey) and transparent and will be converted to meet these requirements if you provide something different.

Notification Icons

To generate these goto the Android Asset Studio Notification Icon Generator and upload your source image. Make sure you change the name of the icon. You will be using this name to reference this icon in notifications.

Asset Studio

You can then download the zip and extract the contents into the res directory in the repository.

Running the script

Once you have your resources set up, you can run the script to generate your ANE. Open a terminal in the downloaded repository directory and run:

ant

You should see a series of outputs as the libraries are built and eventually a BUILD SUCCESSFUL message.

Once that occurs your ANE will be located in the build directory:

build/com.distriqt.CustomResources.ane

Add this ANE to any projects you will be using your custom resources in.

Custom Resources


  1. Quick Start

Troubleshooting

  1. FAQs
  2. Common Errors

External Links

Clone this wiki locally