I wanted to create a file in the internal directory of the Android and I'm unable to create it despite the standard procedure to create a file and a directory it. And when I install my app in my phone I'm not able to find the "com.package..." folder, installation done through direct android studio connected.
import android.os.Environment;
import android.util.Log;
import android.widget.TextView;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class CreateLogObject {
    public static final String TAG = "CreateLogObject ";
    private String logId;
    private TextView GPScurrentSpeed;
    private TextView latitude;
    private TextView longitude;
    private TextView accur;
    private TextView fomulaSpd;
    private String Xval;
    private String Yval;
    private String Zval;
    public CreateLogObject(String logId, TextView latitude, TextView longitude, TextView accur, TextView GPScurrentSpeed, TextView forSpeed, String X, String Y, String Z) {
        this.logId = logId;
        this.GPScurrentSpeed = GPScurrentSpeed;
        this.latitude = latitude;
        this.longitude = longitude;
        this.accur = accur;
        this.fomulaSpd = forSpeed;
        this.Xval = X;
        this.Yval = Y;
        this.Zval = Z;
        logDetails();
    }
    @Override
    public String toString() {
        return  ",  " + logId + ",  " + latitude.getText() + ", " + longitude.getText() + "," + accur.getText() + ",  getSpeed() Velocity:"
                + GPScurrentSpeed.getText() + ", Formula Speed:" + fomulaSpd.getText() + " , X: " + Xval + " , Y: " + Yval + " , Z: " + Zval;
    }
    private void logDetails() {
        generateNoteOnSD("speedLog.txt", toString());
    }
    public void generateNoteOnSD(String sFileName, String sBody) {
        try {
            File root = new File(Environment.getExternalStorageDirectory(), "LogFolder");
            if (!root.exists()) {
                Log.d(TAG, "MISSING DIRECTORY CREATED");
                root.mkdirs();
            }
            File gpxfile = new File(root, sFileName);
            FileWriter writer = new FileWriter(gpxfile, true);
            writer.append(new StringBuffer(sBody).append("\n"));
            writer.flush();
            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
And yes I have give permissions to WRITE and READ into internal/external directory. In need of immediate help please do guide with your suggestions.
