简体   繁体   中英

Fastest way of getting a list of installed packages in an Android device

I'm getting a list of packages installed in an Android devices very similar to the code here - http://www.androidsnippets.com/get-installed-applications-with-name-package-name-version-and-icon

The problem is that it takes quite a while to complete detection of all apps. I've discovered that the slow operations are those that call p.applicationInfo.loadLabel() and p.applicationInfo.loadIcon(). Once I comment those out and set them to dummy info, the detection is almost instantaneous.

Since I would still like to retrieve the app name and icon, I can't simply comment them out. Is there a faster way of retrieving this data?

Thanks.

You should populate the list with the names of the applications first and placeholders in place of the icons.
after this another thread should fetch the icons sequentially and list should be notified for data set changed every time.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM