I'm doing tests with an example about downloading files from a url and recording it in the internal memory, apparently it works well, the code manages to link to the url and read the file but I can not keep it in the internal memory, see if someone can tell me the correct procedure to get it stored in the internal memory of the device.
Greetings and thanks in advance.
here is the code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate ( savedInstanceState );
setContentView ( R.layout.activity_main );
new Thread ( new Runnable () {
@Override
public void run() {
try {
URL url = new URL("http://www.videotutoriales.es/android-xml/cursos.xml");
//establecemos la conexión con el destino
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection ();
//establecemos el método jet para nuestra conexión
//el método setdooutput es necesario para este tipo de conexiones
urlConnection.setRequestMethod ( "GET" );
urlConnection.setDoOutput ( true );
//por último establecemos nuestra conexión y cruzamos los dedos