FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV Mobile 2024
→
[WM22] Android Installing APKs from inside an app
[WM22] Android Installing APKs from inside an app
Débuté par Robert, 18 jan. 2018 16:53 - 3 réponses
Connectez-vous…
Robert
#1
Membre enregistré
105 messages
Posté le 18 janvier 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!
Signaler
0
0
Robert
#2
Membre enregistré
105 messages
Posté le 19 janvier 2018 - 16:19
I figured out this can be done using the ShellExecute() function.
Signaler
0
0
Rubén Sánchez Peña
#3
Membre enregistré
797 messages
Popularité : +40 (42 votes)
Posté le 23 janvier 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
Signaler
0
0
Joey Dieleman
#4
Membre enregistré
28 messages
Popularité : +2 (2 votes)
Posté le 26 janvier 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
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte