简体   繁体   中英

How to read a file using JAVA while making Android Application

I am trying to accomplish reading a content of a csv file when I go to a URL. The content in the file are always float and the csv file will only have 1 float number. I want to save it to a float variable.

I need to go to a URL. Lets say I go to URL:

https://someurl.com/this-is-a-CSV-file.csv 

When you go to the url it auto downloads the csv file and the file has 1 number.

How do I do this while making android application in Android Studio?

Please help me.

Tried this once before, my app downloads a csv file from dropbox,add a new row of data at the end of file, then saves it and upload back to dropbox.

After you download it, you should be able to read the file line by line. Each column on the csv file is separated by a comma(,). I forgot how i did it but it should still work. You should research on how to read and modify files. Im sure there are a lot of resources you can get because file reading has been present on java even before android existed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM