Skip to main content
March 15, 2013
Question

AIR / Android, content-URI to AS3-file-path

  • March 15, 2013
  • 1 reply
  • 3763 views

Hey guys, i need help.

I registered some file-extensions for my AIR-Android-App, so when a file is selected, my app receives an Invoke-Event in Flash/AS3 with the path to that file.This works fine for files/downloads/links.

However, some Applications provide a a content-uri instead of a direct file-path (e.g. eMail-attachments before they are downloaded, hell, even local download folders on newer Android OS).

e.g.:

content://gmail-ls/houseatreides@gmail.com/messages/6/attachments/0.1/BEST/false

QUESTION:

How can i turn this into something i can load in AIR/AS3.

Or how can i order the other application or a service to catch the file for me?

If its not possible in AIR, does anyone know of an ANE that gets the job done ?

I found a post how to do it native in Java.

Confirmation that it is (currently) not possible in AIR is also welcome. Thank you.

verdave

This topic has been closed for replies.

1 reply

April 26, 2013

Hey guys,

Well, I could not find any ANE for that (start contentProvider / contentResolver).

Before i start reading Native-Extension-Tutorials tomorrow:

If you think there are any reasons why this is essentially not possible at all (for whatever reason, restrictions, security, streaming etc), let me know.


thx,

V.

Inspiring
May 8, 2013

Did you ever figure this out?  I would also be interested in getting this to work.

May 10, 2013

Unfortunately there are higher priorities in the todo list. For now, we just scan if the invoke-argument starts with a content-scheme and tell the user to download it before opening.  If he is sure he already downloaded the file (and still has the content-scheme) we show a file-selection with the most recent downloads. 

Not the most elegant way, but it works.

The whole intent stuff is flawed - not inherently - the basic concept is very good.

But the developers of other apps (e.g. Mail-Client) tend to dispatch so many different intents/mimetypes/files/content for the same task/media that its impossible to register for the correct intent/filetype.

I finally installed a nice little App called "IntentIntercept" on Android. Great for analysing whose app sends which intent. It turned out different mail-clients convert mimetypes while sending and then dispatch the wrong intent...  Gmail works more reliable than the native mail apps, but its clusterf# because there no standard and your own apps reliability depends on other apps working correctly.