Apps Have app check a url and decide what to do from the result

cr5315

Android Enthusiast
I want to add the ability for my app to check if there is an update by checking a .txt I uploaded. Is there any way to make the app check a url and read the .txt and determine what to do if the txt says there's an update or not?
 

JamTheMan

Well-Known Member
It is possible, and fairly simple:

Download the file. Take a look at this example on how to do that (set up for an image file, but any file will do):

How to download file/image from url to your device | Hello Android

Red the txt file, by doing something like this:

read text file data in android - Stack Overflow

And there you have it. All you now need is a simple way of checking if there are any updates. You could for example have the very first line of your txt file say when it was last updated.Then you could simply read this line and check if it has been updated since you last checked...
 
Top