CopyPastor

Detecting plagiarism made easy.

Score: 0.817141592502594; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-03-05
by milad salimi

Original Post

Original - Posted on 2017-07-30
by AndroidDevUser



            
Present in both answers; Present only in the new answer; Present only in the old answer;


**You can try this :**
ContextWrapper contextWrapper = new ContextWrapper(getApplicationContext()); File directory = contextWrapper.getDir(getFilesDir().getName(), Context.MODE_PRIVATE); File file = new File(directory,”fileName”); String data = “TEST DATA”; FileOutputStream fos = new FileOutputStream(“fileName”, true); // save fos.write(data.getBytes()); fos.close();

**This will write file in Device's internal storage (/data/user/0/com.yourapp/)**


You can try with below:
ContextWrapper contextWrapper = new ContextWrapper(getApplicationContext()); File directory = contextWrapper.getDir(getFilesDir().getName(), Context.MODE_PRIVATE); File file = new File(directory,”fileName”); String data = “TEST DATA”; FileOutputStream fos = new FileOutputStream(“fileName”, true); // save fos.write(data.getBytes()); fos.close(); This will write file in Device's internal storage (/data/user/0/com.yourapp/)
Hope this helps!

        
Present in both answers; Present only in the new answer; Present only in the old answer;