FOROS PROFESIONALES
WINDEV
,
WEBDEV
y
WINDEV Mobile
Inicio
|
Mensajes recientes
|
Conéctese...
|
Desconectar
|
Español
Inicio
→
WINDEV Mobile 2024
→
[WM22] Android Installing APKs from inside an app
[WM22] Android Installing APKs from inside an app
Iniciado por Robert, 18,ene. 2018 16:53 - 3 respuestas
Conéctese…
Robert
#1
Miembro registrado
105 mensajes
Publicado el 18,enero 2018 - 16:53
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!
Informar
0
0
Robert
#2
Miembro registrado
105 mensajes
Publicado el 19,enero 2018 - 16:19
I figured out this can be done using the ShellExecute() function.
Informar
0
0
Rubén Sánchez Peña
#3
Miembro registrado
794 mensajes
Popularité : +40 (42 votes)
Publicado el 23,enero 2018 - 17:03
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
Informar
0
0
Joey Dieleman
#4
Miembro registrado
28 mensajes
Popularité : +2 (2 votes)
Publicado el 26,enero 2018 - 11:58
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
Informar
0
0
→ Volver a WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versiones precedentes)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Búsqueda Tipo
Sólo temas
Todos los mensajes
Periodo Buscar
Cualquier fecha
Última hora
Última 24 horas
Última semana
Último mes
Último año
Cancelar
Vista previa del mensaje
Añadiendo una imagen
Importar una imagen desde una URL
Enviar una imagen desde un archivo de su disco
Arrastrar un archivo o click en "Examinar..."
o
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto