Is it possible to read a file of type txt
or xml
that is hosted in an onion domain from an android application?
Something like this but for a domain of type .onion
URL url = new URL("http://www.dominio.com/mifichero.txt"); // aquí la url sería del tipo .onion
URLConnection conn = url.openConnection();
int contentLength = conn.getContentLength();
DataInputStream stream = new DataInputStream (url.openStream());
byte[] buffer = new byte[contentLength];
stream.readFully(buffer);
stream.close();
DataOutputStream fos = new DataOutputStream (new FileOutputStream(file_path + File.separator + "mifichero.txt"));
fos.write (buffer);
fos.flush();
fos.close();
Greetings.