I was wanting to create a android application where I could quickly write basic java code and get it to output in a TextView. I originally got this idea up and running messing around in intellij and thought it would be a cool app so I started building it in android studio. What I was planning to do was create a 'dummy' java file, parse my code into the file, then execute the file. That way java would do all of the heavy lifting.
I am a student so I want this app as a way to practice writing sorting algorithms/recursive functions... basically the stuff they ask you to program in job interviews. I should also mention that this is research for my final school project.
Here is what I have already tried to do.
I have added permission in my manifest
< uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/ >
and this is how I am trying to create the file.
String FILENAME = "Interpreter.java";
String string = "hello world!";
try {
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
}catch(Exception e){
}
I do not know where the file is being created if at all...
Am i going in the right direction? does anyone know if this is even possible in android?
Thank you in advance!