Android Question Download and install APK from FTP

attune

Member
Good morning.

So, written a little app that I want to be able to update itself. In short, I send it a UDP command, it downloads its updates (all files from an FTP server, which include mp4 files, img files etc. If it finds an APK file on the FTP server it pulls that down also. I can then trigger a different UDP command to tell it to update, when I'm ready!

Each time I get an error about not being able to parse the package. I thought perhaps because it was trying to install a newer copy of itself that I was getting the error, but even when I tell it to download and install another APK (for a small utility) it does the same thing.

Now, if I use File Command to access the FTP server, pull the files down, they both install without a glitch.

All the permissions are enabled and I'm pulling the files down into the SafeDir, and using the FileProvider method from Erels tutorials etc.

I just can't get it to work, and I really wanted to role this out on a some little tablets tomorrow for a project I'm working on.

Any and all ideas greatly received!
 

attune

Member
Download text:
ftp.DownloadFile(Files(i).Name, True, File.DirRootExternal&"/Download/", Files(i).Name)

Latest try was above. Was trying different download locations incase the location was causing an issue.
Originally tried with GetSafeDir etc.
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Any and all ideas greatly received!

Have you checked this library?

 
Upvote 0

attune

Member
Have you checked this library?

Thanks Jose

The download and ability to run the file is not an issue now.

The problem comes because the app is installed on a media player connected to a screen (there are 70 in total) and there are no input devices connected, no touch screen etc. So at the moment, the only way to confirm the installation is to connect a mouse and click install on each screen. They're not the easiest to access either, so plugging in the mouse can be tricky on some units. Looks like the only option is to manually click the install button.

Was considering some kind of remote access tool, so could remotely connect to the screens and click connect, but seems on some of those you also need to click confirm to accept the remote connection.
 
Upvote 0
Top