1

I'm developing a launcher application. I want to auto organize apps into folders with subjects as Game, Social Network, Entertainment, Tool... But I do not know based on the information of the application to know what type it.

Sample : http://dantri4.vcmedia.vn/tI0YUx18mEaF5kMsGHJ/Image/2014/07/APUS-Launcher-3-feb4a.jpg

namdn
  • 69
  • 8

1 Answers1

0

As far as I know there is no straightforward way to achieve that. The only thing that I could think about is to try to find some key words in the labels name of the apps. Something like that:

private ArrayList<PackageInfo> searchPackageForString(PackageManager pm, String find){
    List<PackageInfo> packs = pm.getInstalledPackages(0);
    ArrayList<PackageInfo> results = new ArrayList<>();
    for (PackageInfo pi : packs) {
        if(pi.applicationInfo.loadLabel(pm).toString().toLowerCase().contains(find)){
            results.add(pi);
        }
    }
    return results;
}

Then you could try something like That:

searchPackageForString(getPackageManager(), "game");

I didn't try it but I thing that this is the only possibly direction. Of course I can be wrong...

Edit: Now that I looked in the pic you attached, I think that they check by find apps respond to Intents for action. here some example: https://stackoverflow.com/a/28404480/3332634

Community
  • 1
  • 1
yshahak
  • 4,996
  • 1
  • 31
  • 37
  • i used intent for find apps. but classify applications into folders by topic, then there is no good solution – namdn Feb 25 '15 at 10:10
  • Of course there is no perfect solution because there is no API to what you asking. I think that my answer + the link I gave you is the closest you can get. – yshahak Feb 25 '15 at 10:18
  • OK. thank you so muck. i will try to find a bettter solution then share it with you. – namdn Feb 25 '15 at 10:31