AppList: Difference between revisions

From iPhone Development Wiki
m (Britta moved page Applist to AppList without leaving a redirect)
(a little more formatting and adding its description)
Line 1: Line 1:
Applist is a library to fetch app information https://github.com/rpetrich/AppList
'''AppList''' is a library for fetching app information. As described on its package page in Cydia: "Allows developers to query the list of installed apps and provide a preferences pane based on that information. Exports displayIdentifier, displayName, icon and smallIcon via a remote messaging center so that it's easy to write a prefs pane that presents a list of apps."


To get an array of applications and their display identifiers do the following
== Usage ==
 
To get an array of applications and their display identifiers, do the following:
<source lang=objc>
<source lang=objc>
ALApplicationList *apps = [ALApplicationList sharedApplicationList];
ALApplicationList *apps = [ALApplicationList sharedApplicationList];
Line 11: Line 13:
This gives you a list of all the apps in alphabetical order by their display name.
This gives you a list of all the apps in alphabetical order by their display name.


 
To get the display identifier and icon for a specific app at index <code>{X}</code> do the following:
To get the display identifier and icon for a specific app at index {X} do the following:
<source lang=objc>
<source lang=objc>
NSString *displayIdentifier = [displayIdentifiers objectAtIndex:{X}];
NSString *displayIdentifier = [displayIdentifiers objectAtIndex:{X}];
Line 24: Line 25:
};
};
</source>
</source>
== External links ==
* [https://github.com/rpetrich/AppList AppList on GitHub]

Revision as of 19:46, 3 March 2014

AppList is a library for fetching app information. As described on its package page in Cydia: "Allows developers to query the list of installed apps and provide a preferences pane based on that information. Exports displayIdentifier, displayName, icon and smallIcon via a remote messaging center so that it's easy to write a prefs pane that presents a list of apps."

Usage

To get an array of applications and their display identifiers, do the following:

ALApplicationList *apps = [ALApplicationList sharedApplicationList];

NSArray *displayIdentifiers = [[apps.applications allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
	    return [[apps.applications objectForKey:obj1] caseInsensitiveCompare:[apps.applications objectForKey:obj2]];}];
[displayIdentifiers retain];

This gives you a list of all the apps in alphabetical order by their display name.

To get the display identifier and icon for a specific app at index {X} do the following:

NSString *displayIdentifier = [displayIdentifiers objectAtIndex:{X}];
UIImage *icon = [apps iconOfSize:{size here - see enums} forDisplayIdentifier:displayIdentifier];
enum {
	ALApplicationIconSizeSmall = 29,
	ALApplicationIconSizeLarge = 59
};

External links