문제

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