0

I would like to code a function which will let me know if another specific app of my company is installed on the current device. I guess that in order to do so I need to retrieve a list of the installed apps like here (Answer for native coders):

How to get a list of installed android applications...

Is there a straight forward way to get the list with action script? Bottom line, I just need to know about my own apps. Maybe a way to get a list of air apps installed?

Thank you

Community
  • 1
  • 1
mik
  • 799
  • 9
  • 31

1 Answers1

2

The direct answer no, but you can use one of the following:

1- Write a file in specific location indicates that the app from your company installed, and check this file from your app, to do this - On the first time run of the application write a file in the desktopDirectory:

var myAppTextFile:File = File.desktopDirectory.resolvePath("MyAppVersion.txt");
var fs:FileStream = new FileStream();
fs.open(myAppTextFile, FileMode.WRITE);
fs.writeUTF("MyApp V0.0 installed");
fs.close();`
  • Each time you run the New Application check this file:

    var myAppTextFile:File = File.desktopDirectory.resolvePath("MyAppVersion.txt"); var fs:FileStream = new FileStream(); fs.open(myAppTextFile, FileMode.READ); var str:String = fs.readUTF(); fs.close();`

    Note: Works for Android not for iOS.

2- Use Native extension to do this.

Anas
  • 711
  • 7
  • 24
  • 1
    Thanks. Option 2 is obvious, option 1 is unclear for me. Can I actually access a common folder on Android (and iOS? I need both) write a file there using app A and access it from app B? – mik Feb 15 '14 at 20:53
  • 1
    yes you can, i am using File.DesktopDirectory to write/read files and folders, i will share some code when i return to home :) – Anas Feb 16 '14 at 08:56
  • 1
    Doesn't let me write to File.applicationDirectory. Did you test it on an Android device? File.applicationDirectory is a read-only folder. – mik Feb 17 '14 at 11:13
  • 1
    File.desktopDirectory worked! Was able to access the same file from 2 different apps. Will edit the answer. – mik Feb 17 '14 at 11:34
  • @mik you are right it should be desktopDirectory, thanks for your edit :) – Anas Feb 18 '14 at 19:00