Skip to main content
Participant
July 20, 2017
Question

How to share an image with air for mobile?

  • July 20, 2017
  • 1 reply
  • 588 views

Hi, I have been trying to share an image with the datashare ANE with FlashDevelop: http://www.adobe.com/devnet/air/articles/datashare-native-extension.html

At first, it was working great (AIR 24), but since I updated the AIR sdk (I am using AIR 26), it doesn't seem to work anymore. I get this:

     [Fault] exception, information=Error: Error #3001: File or directory access denied.

     in flash.filesystem::FileStream/open

But my application.xml file already has <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

I'm kind of stuck here, and don't know where to look at... Any help?

Thanks!

This topic has been closed for replies.

1 reply

Legend
July 20, 2017

Are you also calling File.requestPermission?

From Android 6+ And AIR24+ you need to also run permission checking code

See the release notes for sample code flow.

Release Notes Flash Player 24 AIR 24

yvant_netAuthor
Participant
July 20, 2017

Maybe the ANE does that, I don't know...

After further testing, I was able to use the DataShare feature on an older device (galaxy S3, android 4.4.4). Maybe that's the issue? The most recent phone is on Android 7.0.

natural_criticB837
Legend
July 24, 2017

It looks like this ANE saves the image to a file before sending a reference to other apps to be able to share it. That means with latest Air / Android you will need to ask for the permission as described in the Air 24 release notes

Alternatively you can use another ANE. For example we are using the GoViral ANE to share images and they have removed the requirement to give a WRITE permission in the latest version of their ANE.