0

I know many analytics tools are available online to track app's performance. But I am referring to personalised statistics.

I have an android app which lets users download question papers and various other files in pdf format. I would like to know total number of files downloaded to date. What I think:

  1. Host a file on my server with text "0"
  2. Create 2 AsyncTasks and call one to get the value in file.
  3. Store it in a variable as integer and increment it.
  4. Call 2nd asynctask and overwrite existing file's values by now stored variable.

I don't know if any easier way exists like Firebase? If yes, please give some details.

Paras Sidhu
  • 652
  • 1
  • 12
  • 36
  • I would track these kind of stats on the server... – Ken Wolf Jun 07 '17 at 10:47
  • 1
    don't do it in android.. collect data on server.. sample script - https://stackoverflow.com/questions/7213940/php-count-downloads – Amod Gokhale Jun 07 '17 at 10:48
  • @AmodGokhale and then call this file using Asynctask? – Paras Sidhu Jun 07 '17 at 10:51
  • it depends upon your Android Code.. your question is specific to download count, for that call need not be async – Amod Gokhale Jun 07 '17 at 10:53
  • AsyncTasks are for moving the network request into the background so that won't block the UI thread. What you really need is HttpURLConnection in your AsyncTask's doInBackground() function. Alternatively you could use other network management libraries but let's stick to the basics :). – Endre Börcsök Jun 07 '17 at 10:53

0 Answers0