문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top