• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Add custom information into application descriptor?

Engaged ,
Nov 12, 2015 Nov 12, 2015

Copy link to clipboard

Copied

Hi,

Is it possible to add a 'custom' node into an AIR application descriptor? I was hoping to be able to read a specific field from the file eg:

<application xmlns="http://ns.adobe.com/air/application/20.0">

    <id>com.application.id</id>

    <filename>Test</filename>

    <name>Test App</name>

    <versionNumber>0.0.1</versionNumber>

    <customNode>value</customNode>


</application>



However it seems nodes like this are stripped out of the packaged application. Any ideas how to add something like this? Or suggestions as to a better method?

air native extensions // https://airnativeextensions.com
TOPICS
Development

Views

870

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
community guidelines
Engaged ,
Nov 19, 2015 Nov 19, 2015

Copy link to clipboard

Copied

It depends on your platform, but you could try putting it in the description field?  I'm not sure that the description field is used at all on Android or iOS, but I haven't checked the bundle to see if the field has also been stripped.  It also won't help you on other platforms.

Loving your ANE's by the way.

Votes

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
community guidelines
Engaged ,
Dec 16, 2015 Dec 16, 2015

Copy link to clipboard

Copied

Thanks,

The description field is an option, but we are trying to use a method that doesn't interfere with the standard usage and would like to keep it cross platform as much as possible.

Cheers      

air native extensions // https://airnativeextensions.com

Votes

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
community guidelines
Explorer ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

for android add a custom meta to xml manifest file.

<meta-data android:name="send_launch_scheme" android:value="xdev" />

then read that value from metada property of ApplicationInfo

private String readMetaScheme(){

        String send_launch_scheme = null;

        try {

            ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA);

            Bundle bundle = ai.metaData;

            send_launch_scheme = bundle.getString("send_launch_scheme");

        } catch (NameNotFoundException e) {

            Log.e(TAG, "Failed to load meta-data, NameNotFound: " + e.getMessage());

        } catch (NullPointerException e) {

            Log.e(TAG, "Failed to load meta-data, NullPointer: " + e.getMessage());        

        }

        return send_launch_scheme;

    }

Votes

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
community guidelines
Engaged ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

Thanks for that, we are aware of the Android meta-data tags, we were looking for an AIR cross platform method though.

Cheers

air native extensions // https://airnativeextensions.com

Votes

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
community guidelines
Enthusiast ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

LATEST

you can also add metadata to the SWF file itself

see: Adding metadata to SWF files

and then at loading times you can read the loaderInfo.bytes to parse and get back that data

and/or you can use a custom metadata in AS3
eg.

[mystuff(name="foobar", desc="something")]
public class Whatever {}

then in compiler options use keep-as3-metadata=mystuff

then in AS3 use describeType to get the values etc.

see Using Custom Metadata Tags

Votes

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
community guidelines