|
update android app automatically |
Iniciado por tyagoug20, mar., 14 2019 11:37 AM - 1 resposta |
| |
| | | |
|
| |
Publicado em março, 14 2019 - 11:37 AM |
Hello everyone
I'm here to ask if someone knows how to download and install a new version of a apk.
FTPGets() only works in system folders and i can't download to an main storage folder.
Even if I mannually download the apk to downloads folder, Cant even install use ShellExecute()
thank you |
| |
| |
| | | |
|
| | |
| |
Membro registado 123 mensagems |
|
Publicado em março, 18 2019 - 10:25 PM |
Try use HTTPREQUEST, and put your file in Public URL,
Example code (in use by myself)
WHEN EXCEPTION IN PROGBAR_progreso..Visible = True HTTPProgressBar(PROGBAR_progreso) Ok is boolean = HTTPRequest(gs_url_endpoint+"/updates/myapp.apk") IF Ok = True THEN s_filename is string IF SysStatusExternalStorage(1) = sseAvailable THEN s_filename = CompleteDir(SysDirExternalStorage(1, ssePublicDownload))+"apptmp.apk" ELSE s_filename = CompleteDir(fDataDir())+"apptmp.apk" END FileDownloading is Buffer = HTTPGetResult() Ok = fSaveBuffer(s_filename,FileDownloading) OkFile is boolean = fFileExist(s_filename) IF Ok = True AND OkFile = True THEN IF ShellExecute(s_filename) THEN ELSE PROGBAR_progreso..Visible = False Error("Oops..","Error on Install App") RETURN END ELSE PROGBAR_progreso..Visible = False Error("Error On Download File") RETURN END ELSE PROGBAR_progreso..Visible = False Error("Error On Download File") RETURN END DO Error("Fatal Error",ExceptionInfo(errFullDetails)) RETURN END
P.D: Files downloaded with FTP if it can be stored in SDCARD (Check the help)
-- Atte. Willian Fernando |
| |
| |
| | | |
|
| | | | |
| | |
|