accessing storage files from cn1storage

15 views
Skip to first unread message

babes

unread,
Apr 10, 2018, 11:05:33 AM4/10/18
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: Eclipse
Desktop windows
Simulator
Device  iOS


Hi,

In my application some data are stored in cn1storage directory, <package-name> directory and just document something like as given below

1. cn1storage/ text-files
2. Data/Application/app-id/Documents/<package-name>/tempimage.jpg
3. temp.jpg

So, this is data structure how my data are stored. I am able to access the path of second one by FileSystemStorage.getInstance().getAppHomePath(), but I want to browse files present in cn1storage and the other one. Its because my zipping the files of each directory and I am only able to zip the files of second directory, whereas the files of first directory and third image file isnt included in my zip file. 

So, please tell me how to access the cn1storage files by any path or by some means.

Thanks for help.

Shai Almog

unread,
Apr 11, 2018, 12:26:55 AM4/11/18
to CodenameOne Discussions
Hi,
the simulator places things in those directories but devices can use very different directory structures so you can't rely on Storage & FileSystemStorage to map to each other.
Storage might be completely inaccessible from FileSystemStorage!

You can just use the app home path to store everything and avoid Storage. Or use the Storage API to list files and copy things into the zip process.

Workmobile Esay

unread,
Apr 11, 2018, 4:03:20 AM4/11/18
to codenameone...@googlegroups.com
Hi,
In simulator, all the things are in .cn1storage, but in device when I check through file sharing I can see the app directory as cn1storage, <app-Package>, where app-package directory consists of file from filesystemstorage and cn1storage consists of storage files. So, I am confused of this.



--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/78Ru-DaxmQY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/12c6b980-80cd-43ec-9cbc-1a1b852d72fc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Shai Almog

unread,
Apr 12, 2018, 1:28:57 AM4/12/18
to CodenameOne Discussions
Hi,
As I said, this would behave differently on every platform and might not be visible from the file system API at all!
You are relying on implementation details which is problematic...
Reply all
Reply to author
Forward
0 new messages