Skip to main content
Sunil Kumar Sah
Inspiring
Sep 29, 2014 6:15 AM UTC
Answered

Android kitkat issue in loading swf file from device. URL found but not working

Hi,


I am facing one issue from a very long time regarding file access in Android Kitkat version 4.4.*. I have developed Adobe Air player application for android and it is working as expected below kitkat version but not on kitkat.

I am following this methods -

  1. NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);

public function onInvoke(event:InvokeEvent):void

                        {

                                  

                                    var newFile:String = String(event.arguments[0]);

                                    trace("Received new file from Android: "+newFile)

                        }

Received URL form device in Android Kitkat -

/storage/emulated/0/.iProfData/swf/playListFiles/ContentCreation/Ma_V2_522/en/Animation/27031_1_Welcome screen.swf

file:////storage/emulated/0/.iProfData/swf/playListFiles/ContentCreation/Ma_V2_522/en/Animation/27031_1_Welcome screen.swf 

                -  Loading this URL using loader class in AS3 AIR but not working.

file%3A///storage/emulated/0/.iProfData/swf/playListFiles/ContentCreation/Ma_V2_522/en/Animation/27031_1_Welcome%20screen.swf

       - Have used also by doing escape character but still it is not working showing file not found both SWF and mp4 case. (Mp4 case NetStream.Play.FileNotFound)

By using the above methods I can have swf or mp4 video url but when I am loading it, It is not working giving error message "File not found/ IO Error". I have read that if use escape character then it will work but I have used escape character also but it is not working.

Humble request you to please advise how can I solve this issue.

Best regards,

Sunil Kumar

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer
Sep 29, 2014 4:37 PM UTC

Starting in KitKat, Google requires that applications have permission to access files on the system. You must specifically add either the READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE permissions in order to access files. Adding either one of those permissions should let you read/access files on the device. Prior to KitKat, you didnt have to have these permissions listed in the manifest to access files.

3 replies

Correct answer
Sep 29, 2014 4:37 PM UTC

Starting in KitKat, Google requires that applications have permission to access files on the system. You must specifically add either the READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE permissions in order to access files. Adding either one of those permissions should let you read/access files on the device. Prior to KitKat, you didnt have to have these permissions listed in the manifest to access files.

Translate
Sunil Kumar Sah
Inspiring
Sep 30, 2014 8:33 AM UTC

Thanks a lot for your kind co-operation. By doing the above changes my file is working as expected.

Thanks a lot for your support.

Best regards,

Sunil Kumar

Translate
Sep 30, 2014 5:40 PM UTC

Im glad it was a simple fix.

Translate