Perhaps these two links may help you with understanding directories on
mobile devices:
http://dlgsoftware.com/StageWebViewAndLocalFiles.php
http://www.cultcreative.com/tutorials/11/13/2011/local-file-access-editing-for-android-and-ios/
This is a quote from the first web page:
Here's the slightly longer answer: on Android your application is
contained in an .apk file, which is basically a .zip file. And that's
why the nativePath value returns a blank for these files: there's no
"real" file, there's just that compressed apk. If you want a file you
can work with then you have to extract it from that apk.
Regards
Margo
On 2/11/2013 5:40 AM, Philippe Bossu wrote:
Hello,
Just to give you feedback.
Copying document to file.documentsDirectory and then calling ANE with the
new path works.
But using localStorage with ANE fails with Activity not finding file to
open.
And it fails even with setting :
intent.addFlag(Intent.FLAG_GRANT_READ_URI_PERMISSION)
This is strange to me.
Any other feedback is welcome.
Regards
On Fri, Feb 8, 2013 at 11:11 PM, Jonathan Campos <[email protected]>wrote:
the code is all available on github. you could make that change. the
current implementation just provides access to it's own pdf's not cross
application.
On Fri, Feb 8, 2013 at 3:06 PM, Philippe Bossu <[email protected]> wrote:
Shouldn't code call:
intent.addFlag(Intent.FLAG_GRANT_READ_URI_PERMISSION<
http://developer.android.com/reference/android/content/Intent.html#FLAG_GRANT_READ_URI_PERMISSION
);
I thought that app sandboxing didn't allow one application to access
local
storage of another one.
Thanks
On Fri, Feb 8, 2013 at 9:53 PM, Philippe Bossu <[email protected]> wrote:
So you confirm that the code works from applicationStorage ?
I thought called application needed to have access to the file to read.
We will try again and give feedback.
Many thanks for you reactivity and help.
Regards
On Friday, February 8, 2013, Jonathan Campos wrote:
by the example the applicationStorageDirectory also works (I forget
sometimes)
https://github.com/jonbcampos/unitedmindset-ane-repo/blob/master/OpenDocument/OpenDocumentApp/src/OpenDocumentApp.mxml
On Fri, Feb 8, 2013 at 1:07 PM, Jonathan Campos <[email protected]
wrote:
- due to permissions and whatnot I found that the document had to be
in
a
more public area. Copy it over to File.documentsPath and then
whatever
subpath you may want
- make sure that the application is included with the packaging
process.
You may need to go into properties>packaging>ios>native extensions
and
add
it.
I run on a MAC so that may make a slight difference in the packaging
process.
J
On Fri, Feb 8, 2013 at 12:14 PM, Philippe Bossu <[email protected]>
wrote:
Hello,
I am working on the same kind of project.
We succeeded opening in IOS with StagedWebView and in Mac/PC with
file.openWithDefaultApplication.
Under Android, we tried with the ANE mentioned by J. Campos but we
are
facing some issues:
- When running under android it says it does not find the file:
- Looking at code , can the launched activity find file in
Flex
LocalStorage ?
- So I wonder if StageWebView approach could not be facing
this
issue
- We are not able to package IOS application as it says ANE is
missing
Any ideas ?
Thanks.
On Fri, Feb 8, 2013 at 7:36 AM, Angelo Lazzari <
[email protected]
wrote:
Thank you very much!!I will!
Angelo
Sent from my
On Feb 8, 2013, at 0:59, Jonathan Campos <[email protected]>
wrote:
As stated previously, on iOS the PDF will show in a
stagewebview.
On Android this doesn't work.... but I have an ANE that will do
what
you
need:
https://github.com/jonbcampos/unitedmindset-ane-repo
My logic for apps has been:
if !support > goto stagewebview and display
if supported > open with ane
enjoy
On Thu, Feb 7, 2013 at 1:53 PM, Angelo Lazzari <
[email protected]
wrote:
I tried to write/read from the same place
(applicationStorageDirectory
or userDirectory) but the error that come up is nearly the
same:
Error #2044: Unhandled ErrorEvent:. text=Load error.
However, i'll look up in internet tring to follow your
advices!
Thanks to everyone!
Angelo
On Thu, Feb 7, 2013 at 8:47 PM, Om <[email protected]>
wrote:
It looks like you are writing the pdf to:
File.userDirectory.resolvePath("testPageAngelo.pdf");
But trying to load it from:
File.applicationStorageDirectory.resolvePath("testPageAngelo.pdf")
This might be causing the error.
Thanks,
Om
On Thu, Feb 7, 2013 at 11:33 AM, Angelo Lazzari <
[email protected]
wrote:
I'm sorry.
--
Jonathan Campos
--
Jonathan Campos
--
Margo Powell
Applications Analyst/MS Computer Science
Nutrition in Medicine Project
Nutrition Education for Practicing Physicians Initiative
Department of Nutrition
University of North Carolina at Chapel Hill
800 Eastowne Dr, Suite 100
Chapel Hill, NC 27514
919-408-3320 ext 30
[email protected]
www.nutritioninmedicine.net