Question

I am new in Blackberry 10, I want to create file in device document.

Does anyone knows how to do same?

Thanks in advance.

Était-ce utile?

La solution

You can access device's Documents folder by using "/accounts/1000/shared/documents" path. You need access_shared permission to access the shared folders. You can find more information about BB10 file system here.

Following is sample code which shows how to write file using QFile.

QFile textfile("/accounts/1000/shared/documents/newfile.txt");
textfile.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&textfile);
out << "This is a text file\n";
textfile.close();
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top