GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV Mobile 2024
→
[WM22] Android Installing APKs from inside an app
[WM22] Android Installing APKs from inside an app
Iniciado por Robert, jan., 18 2018 4:53 PM - 3 respostas
Conecte-se…
Robert
#1
Membro registado
105 mensagems
Publicado em janeiro, 18 2018 - 4:53 PM
Does anyone know if it's possible to say have an android app download an APK file and install it? (obviously would require the allow unknown sources option to be turned on)
The reason I'm asking, is we're looking at some industrial android devices, and some of them don't come with the Google services installed (no play store access)
So i'm trying to figure out an alternative way to distribute updates.
Thanks!
Denunciar
0
0
Robert
#2
Membro registado
105 mensagems
Publicado em janeiro, 19 2018 - 4:19 PM
I figured out this can be done using the ShellExecute() function.
Denunciar
0
0
Rubén Sánchez Peña
#3
Membro registado
795 mensagems
Popularité : +40 (42 votes)
Publicado em janeiro, 23 2018 - 5:03 PM
Hi. You must use Java for this:
https://stackoverflow.com/questions/4604239/install-application-programmatically-on-android
https://stackoverflow.com/questions/4967669/android-install-apk-programmatically
Rubén
Denunciar
0
0
Joey Dieleman
#4
Membro registado
28 mensagems
Popularité : +2 (2 votes)
Publicado em janeiro, 26 2018 - 11:58 AM
Hi!
ShellExecute should work, but here I have a java example (to upgrade).
com.xxxx.myapp is de name of the application
PATH_TO_FILE_APK is the full path of the apk you want to install.
PUBLIC static
void Java_Install_APK
(
string
PATH_TO_FILE_APK
)
{
import android.net.Uri
;
import android.content.Intent
;
Uri uri
=
Uri.fromFile
(
new File
(
PATH_TO_FILE_APK
)
)
;
Intent intent
=
new
Intent
(
Intent.ACTION_VIEW
)
;
intent.putExtra
(
"Intent.ACTION_PACKAGE_REPLACED"
,
"com.xxxx.myapp"
)
;
intent.setDataAndType
(
uri
,
"application/vnd.android.package-archive"
)
;
getCurrentActivity
(
)
.
startActivity
(
intent
)
;
}
Regards,
Joey
Denunciar
0
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