I am trying to understand the mechanism that lets an application manager register a new application so that it will show up in the menus.
I understand that an application receives all kind of events and can also broadcast events. So a new app can declare 'I am active and I am <someapp>'. Then an application manager will receive this broadcast and register the application (if it's the first time ever that it runs). However, this requires that any newly installed application must immediately run in order to 'regsiter' itself. This does not make much sense.
So can anyone explain how does the system become aware of a new application and also when an application is removed? The .apk format does not have any post/pre-install/uninstall scripts, as far as I understand.