Back to project page blogwriter.
The source code is released under:
GNU General Public License
If you think the Android project blogwriter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.blogerwriter; /*from w ww . ja v a 2s . c o m*/ import java.io.File; import java.io.FileWriter; import java.io.IOException; import android.content.Context; import android.util.Log; public class DataExporter { private Context mContext; public DataExporter(Context context){ mContext=context; } public void export(String path,String filename){ File isaidFile=new File(path, filename); if(!isaidFile.exists()){ try { isaidFile.createNewFile(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } FileWriter fwr; try { fwr = new FileWriter(isaidFile); DBHelper dbHelper=new DBHelper(mContext); dbHelper.open(); String data=dbHelper.getAllDataString(); dbHelper.close(); fwr.write(data); Log.v("export data", data); fwr.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }