Let\'s say I have an Android App A that is installed in the user\'s device and I have an AppWidget with my App where we let other Android developers publish their App promot
You can also use third party tracking like Mobile App Tracking from Tunes. This will help Android A app to get postbacks whenever Android B is installed. Third party tools like MAT,Appsflyer is one of the most common tools used to track installs.
the source code above is not correct.
the line
referrer = URLDecoder.decode(referrer, "x-www-form-urlencoded");
should be
referrer = URLDecoder.decode(referrer, "UTF-8");
the android documentation is not clear about this, but if you use x-www-form-urlencoded it will throw an unsupported encoding exception....