Pergunta

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

Does anyone knows how to do same?

Thanks in advance.

Foi útil?

Solução

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();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top