Showing apk icons in desktop version

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
qx87
Junior Member
Junior Member
Posts: 23
Joined: 2011-11-17, 20:51 UTC
Location: Russia

Showing apk icons in desktop version

Post by *qx87 »

Well, this is it :)
I would like subject feature be included in 8.0 release.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately there are no functions to get apk icons under Windows. The AndroidManifest.xml file is compressed with some unknown method - this file describes which image resource is used for the apk file.
Author of Total Commander
https://www.ghisler.com
qx87
Junior Member
Junior Member
Posts: 23
Joined: 2011-11-17, 20:51 UTC
Location: Russia

Post by *qx87 »

But Android is open-source OS. I hope somewhere must be information about compressing method.

By the way, how are apk icons shown in Android version?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

By the way, how are apk icons shown in Android version?
There is a function to load them:

Code: Select all

		Drawable icon=null;
		try {
			PackageInfo pi = packageManager.getPackageArchiveInfo(item.name, 0);
			if (pi!=null) {
				pi.applicationInfo.sourceDir = item.name;
				pi.applicationInfo.publicSourceDir = item.name;
				icon = packageManager.getApplicationIcon(pi.applicationInfo);
			}
		} catch (OutOfMemoryError e) {
			icon = null;
		} catch (Exception e) {
			icon = null;
		}
Author of Total Commander
https://www.ghisler.com
Post Reply