← Back to team overview

ubuntu-phone team mailing list archive

Re: App storage

 

Hi,

Le 26/09/2013 11:23, Sam Bull a écrit :
What's the method required for apps to store data on the phone?

We're using a library that simply saves files in the apps current
directory, but running on the phone it doesn't seem to have permission
to do so.

Is there a location we can save the files, which should be easy to
change. Or, do we need to do something more complex to save the data?


You can also consider using U1db, but it'll require some changes in your lib. Here is some doc :
http://developer.ubuntu.com/api/devel/ubuntu-13.10/qml/u1db-qt5/tutorial.html

BTW, it would be easier if U1db objects had some CRUD API :
ex :
var doc = mydatabase.CreateDoc(docId, values);
doc.Write(...);
var content = doc.Read();
var doc2 = mydatabase.GetDocById(docId2);


Tip : I had a weird bug on tablet because the path of my database was "name" instead of "name.db".

Cheers,
Michel


References