Page 1 of 1

Showing apk icons in desktop version

Posted: 2012-01-08, 09:46 UTC
by qx87
Well, this is it :)
I would like subject feature be included in 8.0 release.

Posted: 2012-01-08, 15:57 UTC
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.

Posted: 2012-01-08, 19:05 UTC
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?

Posted: 2012-01-09, 15:49 UTC
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;
		}