PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 25 → WX - Como saber a lista de app/apk android estão instaladados no celular com Windev Mobile?
WX - Como saber a lista de app/apk android estão instaladados no celular com Windev Mobile?
Started by BOLLER, Aug., 12 2017 8:08 AM - 1 reply
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on August, 12 2017 - 8:08 AM
import android.content.pm.*;
import android.content.Context;
import java.util.List;

PUBLIC static string getInstalledPackage()
{
string ListInstalledPackage = "";

Context myContext = getContexteApplication();

PackageManager pm = myContext.getPackageManager();

List packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo packageInfo : packages) {
ListInstalledPackage = ListInstalledPackage + pm.getApplicationLabel(packageInfo) + "(" + packageInfo.packageName + ")\r\n";
}
RETURN ListInstalledPackage;
}


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Registered member
3,651 messages
Popularité : +175 (223 votes)
Posted on August, 12 2017 - 8:10 AM
Para executar uma aplicação android:

Procedure Global LanceAppli1
import android.app.Activity;
import android.content.*;

public static boolean LanceAppli1()
{
Activity act = getActiviteEnCours();
try {
act.startActivity(act.getPackageManager().getLaunchIntentForPackage("com.test.appli1"));
} catch (Exception e) {
return false;
}
return true;
}



WinDev Mobile WL:
SI (PAS LanceAppli1()) ALORS
Info("L'app n'est pas installée")
FIN


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/