I have a server that stores a plain text file with a numerical value. The text file is constantly edited by the server every few minutes or so. What is the best way for an Android Client to retrieve the text file's contents?
答案 0 :(得分:1)
The most efficient way would be using Volley library with a string request.
答案 1 :(得分:0)
Do something like this:
URL url = new URL("http://www.domain.com/file.txt");
URLConnection urlConnection = url.openConnection();
urlConnection.setConnectTimeout(1000);
InputStream is = urlConnection.getInputStream();