Android System Properites in Adobe Air Native Extension

Packed new Feature in asNativeAlert .
SystemProperties class can provide some of the missing properties that You can’t get in adobe air.

Class supports two functions. One like always isSupported and the second getProperites() returns a flash Dictionary object with all the properties.
Available parameters:

  • os – like in Capabilities
  • language – the set language in the system
  • architecture of the cpu
  • package name
  • source directory
  • application uid -always when a application is installed on device the system creates a unique id for setting up the space for it
  • UID – created a unique ID for the device based on some of the device properties
    • Extension requires adding permission in the application xml descriptor.

      <uses-permission android:name="android.permission.READ_PHONE_STATE" />

      Usage:

      if(SystemProperties.isSupported()){
      	var dictionary:Dictionary = SystemProperties.getAndroidProperites(); 
      	trace(SystemProperties.ARCHITECTURE+"  "+dictionary[SystemProperties.ARCHITECTURE]);
      	trace(SystemProperties.JAVA_NUMBER+"  "+dictionary[SystemProperties.JAVA_NUMBER]);
      	trace(SystemProperties.LANGUAGE+"  "+dictionary[SystemProperties.LANGUAGE]);
      	trace(SystemProperties.OS+"  "+dictionary[SystemProperties.OS]);
      	trace(SystemProperties.VERSION+"  "+dictionary[SystemProperties.VERSION]);
      	trace(SystemProperties.PACKAGE_DIRECTORY+"  "+dictionary[SystemProperties.PACKAGE_DIRECTORY]);
      	trace(SystemProperties.PACKAGE_NAME+"  "+dictionary[SystemProperties.PACKAGE_NAME]);
      	trace(SystemProperties.APP_UID+"  "+dictionary[SystemProperties.APP_UID]);
      	trace(SystemProperties.UID+"  "+dictionary[SystemProperties.UID]);
      }
      

Leave a comment