android host txt file and read it

752 Views Asked by At

I doing a application with a database, and to check if I need update the database I want to read a txt file and check the version. The problem is I cant find any website to store my txt file and edit. I tried to use onedrive, dropbox, etc but the link to the file doesnt finish with .txt so instead of read the file I read the html code. Somebody know any website to store and edit my txt file? Or somebody know how I can read the file from onedrive or dropbox? Where is my code to read the txt file:

protected Void doInBackground(Void... arg0) {
        System.out.println("starting");
        try {

            URL url = new URL("");
            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
            String str;

            str = in.readLine();

            in.close();

            System.out.println("version: " + str);

        } catch (IOException e) {
            e.printStackTrace();
        }

        return null;
    }

Thanks for the help and sorry my english.

1

There are 1 best solutions below

0
On BEST ANSWER

I take so many time and its a simple soluction for the onedrive, just need to copy the download link of the file and can read fine.