views:

222

answers:

2

Hi

I would like to embed user-specific data on-the-fly when distributing an APK from my website (NOT from the Market).

My current idea is simply to embed a unique ID in the APK filename. This is simple enough and changing the filename doesn't break the code signing. My current issue is trying to retrieve the filename (APK or DEX) so that I can read this ID.

I've tried most of the standard methods -- poking around PackageInfo, ApplicationContext, ProtectionDomain but I can't seem to get anything to work. Ideas?

+1  A: 

APK filenames don't have much meaning in Android. I am not terribly surprised there is no spot in PackageInfo for it. I don't even know if the APK file is stored on the device under its original name.

CommonsWare
If you download from the Market then the file goes into /data/app and is renamed to the package name (e.g. com.mozilla.firefox) . If the file is downloaded from a website (i.e. 3rd party), it is saved under its original name in /sdcard/download but the installed file is renamed as above after installation.
ChaimKut
A: 

I have same problem but I just want to know how to get currently running apk file name programmaticaly.....

Rajeev