Checking where the file is stored in android? -


i writing log data file in android. unable understand file stored on android device ( google nexsus 7 ). , how should contents of file ?

following piece of code using write log data file.

public file appendinglog(string logdata){           try {             file logfile = new file(environment.getexternalstoragedirectory(),                     "yourlog.txt");             if (!logfile.exists()) {                 try {                     logfile.createnewfile();                 } catch (ioexception e) {                     // todo auto-generated catch block                     e.printstacktrace();                 }             }             try {                 bufferedwriter buf = new bufferedwriter(new filewriter(logfile,                         true));                 buf.append(logdata);                 buf.newline();                 buf.close();             } catch (ioexception e) {                 e.printstacktrace();             }         } catch (exception e) {                   e.printstacktrace();         }           return logfile;     } 

android.util.log.d("myapp", logfile.tostring());


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -