Java tutorial
//package com.java2s; import android.os.Environment; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { static void setSetting(String name, String data) { try { File root = new File(Environment.getExternalStorageDirectory().toString(), ".Instagram"); if (!root.exists()) { root.mkdirs(); } File gpxfile = new File(root, name + ".txt"); FileWriter writer = new FileWriter(gpxfile); writer.append(data); writer.flush(); writer.close(); } catch (IOException e) { } } }