1

I'm running Android on a system-on-a-chip board (ODROID-U2). So, there are scenarios when I don't have any keyboard or screen connected to the board. Anyway, there is a small service app running which I want to update if a new release is available (developed by me).

So there are two options. a) download a new APK from an URL or b) plug an USB stick into the device and install the new update if found.

I already read this article but some question remain. Maybe you can give me a starting point.

  1. How would you implement a periodical loop that checks if an update is available online.
  2. How can the downloaded APK file be installed automatically without showing it in the file explorer? This article opens the explorer instead.
  3. Using an USB stick instead of Web-download needs to listen on android.intent.action.UMS_CONNECTED intent and then looking for a new APK file on the stick, right?
Community
  • 1
  • 1
Matthias
  • 5,574
  • 8
  • 61
  • 121
  • You don't want to use Google Play Store to upload your app? – Seshu Vinay Oct 15 '13 at 10:32
  • 1
    No, because the board (that runs Android) is integrated into another device. So I have no user interaction, no screen, no keyboard. But I do have Wifi access and someone can plug/unplug an USB stick if necessary. – Matthias Oct 15 '13 at 10:33
  • Did you ever figure out a solution that doesn't require user interaction? – Joshua Pinter Nov 01 '18 at 21:30
  • It’s been a while so I can’t really remember. But since this was an essential feature I guess we managed it as described in the comments below the accepted answer. The device in which we were using Android had no user interaction at all. But we had root rights. – Matthias Nov 01 '18 at 22:35

1 Answers1

1

1. How would you implement a periodical loop that checks if an update is available online.

You have to run a service(in the background of the app) which checks whether new version is available. You could use Alarm Manager to run service periodically.

2. How can the downloaded APK file be installed automatically without showing it in the file explorer? This article opens the explorer instead.

AFAIK, Only Google Play can do that. No other app has permissions to do that. Unless user explicitly says "Yes install it" by clicking install button.

3. Using an USB stick instead of Web-download needs to listen on android.intent.action.UMS_CONNECTED intent and then looking for a new APK file on the stick, right?

Yes, Even then I am not sure if the app updates automatically. Because it has the same problem (#2).

Seshu Vinay
  • 13,560
  • 9
  • 60
  • 109
  • Thanks for your answer. #1 you would need two URL's, right? One indicating that there is a new update available and specifying a link where to download it. #2 really? that's a killer argument for a standalone device. I will try to find out more about that topic. – Matthias Oct 15 '13 at 10:47
  • 1
    Or Have a single URL which gives version and download link. You could check the same with your app version and download if it's not the latest. – Seshu Vinay Oct 15 '13 at 10:51
  • Right, that's what I ment. First URL indicates version and download link while the second URL is actually the download of the APK file. Thanks again. – Matthias Oct 15 '13 at 10:53