How to notify the user that an FTP file is up to date?

Asked

Viewed 246 times

2

I’m developing an android application that lists and opens files from a directory via FTP

I need my application to notify the user that there is an updated version of a file through a Toast or any other way, ie when open the application appears a message written "example.pdf is updated"

Someone knows how to do it?

2 answers

1


You need a library that provides an API to access the FTP server and return the necessary information regarding the files present on it. Then every time your application runs, it will connect to FTP, read the information about the files (timestamp, etc.) and inform the user if there is any novelty regarding the file stored locally.

Try for example the Apache Commons FTP client: http://commons.apache.org/proper/commons-net/

Observing: This may not be the best way to do this. The ideal, I believe, would be to provide a web service that brings the information of the files stored on the FTP server. Then who gets information from the files is the web service and not the Android application (either via FTP connection or by reading the data from the local files, if the application server that provides the web service is on the same machine as FTP). A connection to FTP to download the file would only be done if there was really need to download it.

0

I read your post, and I believe that you should write a script that reads the files in the /var/log of your linux server if it is the case, for example on my machine is in /var/log/proftpd, inside there are 2 files system.log and transfer.log, interpreting the text contained in these files can keep its users informed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.