Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue creating files on BlackBerry Playbook in android app?
    primarykey
    data
    text
    <p>I am running my android app on the Blackberry Playbook using RIM's eclipse plugin.</p> <p>Files I create in the "/accounts/1000/shared/documents" directory are "locked" (when I browse to them and try open using the AIR browser, I get the error message "file locked"). Files that I create in the "/sdcard" directory (the one returned by Environment.getExternalStorage) work fine. I can create and read these files programatically using the below code.</p> <p>Any suggestions on how to create files in the documents directory which are not "locked"?</p> <pre><code>public class TempActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { File docFile = new File("/accounts/1000/shared/documents/tmp.txt"); File sdcardFile = new File(Environment.getExternalStorageDirectory().getPath() + "/tmp.txt"); FileWriter writer = new FileWriter(docFile); try { writer.write("Hello doc file"); Log.i("success writing doc file", "success writing doc file"); } catch (Exception e) { Log.e("exception writing doc file", Log.getStackTraceString(e)); } writer.close(); writer = new FileWriter(sdcardFile); try { writer.write("Hello sdcard file"); Log.i("success writing sdcard file", "success writing sdcard file"); } catch (Exception e) { Log.e("exception writing sdcard file", Log.getStackTraceString(e)); } writer.close(); FileReader in = new FileReader(docFile); BufferedReader reader = new BufferedReader(in); try { Log.i("firstLine in doc file", reader.readLine()); } catch (Exception e) { Log.e("exception reading doc file", Log.getStackTraceString(e)); } in.close(); reader.close(); in = new FileReader(sdcardFile); reader = new BufferedReader(in); try { Log.i("firstLine in sdcard file", reader.readLine()); } catch (Exception e) { Log.e("exception reading sdcard file", Log.getStackTraceString(e)); } in.close(); reader.close(); } catch (Exception e) { Log.e("exception", Log.getStackTraceString(e)); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload