GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV Mobile 2024
→
update android app automatically
update android app automatically
Iniciado por Tiago, mar., 14 2019 11:37 AM - 1 resposta
Conecte-se…
Tiago
#1
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
Denunciar
0
0
Willian Fernando
#2
Membro registado
123 mensagems
Popularité : +46 (46 votes)
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
//gs_url_endpoint is GLOBAL VARIABLE, Example = https://mydomain.com
PROGBAR_progreso
..
Visible
=
True
//PROGBAR_progreso is a ProgressBar Control in Window.
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
//code on ShellExecute OK
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
Denunciar
1
0
→ Voltar para WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto