Extract _id of non-installed application or id of installed application.