3 ms·
How do they collect this data, technically?
by jonny_eh 14y ago
How do they collect this data, technically?
- deleted 14y ago[deleted]
- jrnkntl 14y agothe iHasApp framework does it like this: https://github.com/danielamitay/iHasApp/blob/master/iHasApp/iHasApp.m https://github.com/danielamitay/iHasApp/blob/master/iHasApp/...
- objclxt 14y agoThat's slightly different: iHasApp is matching back against a list of URL schemes (check the repository, you'll find a big fat JSON file full of app identifiers). This can tell you if an app is installed, but not if it's being actively run. See my answer above for how you can figure out whether an app is currently being used, rather than simply just installed.
- objclxt 14y agoIt's a bit of a hack. There is no way to get hold of a list of installed or runnings apps through the Cocoa APIs (this is in contrast to Android, where you can obtain finite information on apps right down to data consumption). However, there is a way to obtain all current running processes, using the standard sysctl function[1]. This includes apps that are backgrounded but not terminated. If you are interested someone on StackOverflow has put together some sample code (I haven't verified it, but it looks like it should work)[2]. This is not as useful as it sounds though. You're not getting app metadata, just process names. The developers behind AppMap will presumably have set up a database populated with the most popular apps, but will need to keep this current as more apps come to market. [1]: http://developer.apple.com/library/ios/#documentation/System/Conceptual/ManPages_iPhoneOS/man3/sysctl.3.html http://developer.apple.com/library/ios/#documentation/System... [2]: http://stackoverflow.com/questions/10141067/running-apps-in-background-or-active http://stackoverflow.com/questions/10141067/running-apps-in-...
- phoenixy 14y agoIt's really interesting. Thanks for the detailed explanation. I always wondered if there's any way to do this.. And it's good to know that Apple is OK with this kind of hack.