I have a project where use a custom Android launcher (android 4.2.2). The launcher shows games which are made in Adobe Air. Now we want to expand the list of games with Unity games.
To show the games we use the PackageManager and filter on name eg: air.Bimii. Namespace of both technologies are kept the same: air.BimiiMath, air.BimiiABC and so on.
The problem is that the games made in Unity are not listed when using:
private ArrayList<LocalAppDetail> initAppList(){
ArrayList<LocalAppDetail> res = new ArrayList<LocalAppDetail>();
PackageManager main_package_manager = main_activity.getPackageManager();
List<PackageInfo> packs = main_package_manager.getInstalledPackages(0);
for (int i = 0; i < packs.size(); i++) {
PackageInfo p = packs.get(i);
if ((p.versionName == null)) {
continue;
}
//Store Local Appdetail
LocalAppDetail newInfo = new LocalAppDetail();
newInfo.name = p.applicationInfo.loadLabel(main_package_manager).toString();
newInfo.pname = p.packageName;
newInfo.versionName = p.versionName;
newInfo.versionCode = p.versionCode;
newInfo.icon = p.applicationInfo.loadIcon(main_package_manager);
//Parse if the app meets requirements
if (newInfo.name.toLowerCase().contains(MiscData.apk_filter_text)) {
if(!newInfo.name.toLowerCase().contains("launcher")) {
if(!newInfo.name.toLowerCase().contains("rfid")){
res.add(newInfo);
}
}
}
}
//Store The Collection
return res;
}
but when i try using ADB: adb shell pm list packages -f air this is the result:
package:/data/app/air.BimiiFarm-1.apk=air.BimiiFarm package:/data/app/air.BimiiFood-1.apk=air.BimiiFood package:/data/app/air.nl.mediaheads.klassewinkel-1.apk=air.nl.mediaheads.klassewinkel package:/system/app/Air.apk=com.adobe.air package:/mnt/asec/nl.mediaheadsair.bimiiRekenen-1/pkg.apk=nl.mediaheadsair.bimiiRekenen
So the game is there (last in the list). The name is pkg.apk and the location is different. Do you guys have an idea about how to catch all the games in a list show we can launch them?
Help would be great! Thanks in advance
Update Sigh, it was an option in Unity Player settings. Install Location should be put on "Force Internal". What a world, what a world.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.