Вопрос

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

Does anyone knows how to do same?

Thanks in advance.

Это было полезно?

Решение

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();
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top