Par*_*eek 5 java android google-play-services
我已在Playstore上为我的应用上传了多个APK,以在所有设备上支持它。
现在的问题是,当我使用以下代码获取Playstore版本时,它将返回“随设备而异”。
字符串playStoreUrl =“ http://play.google.com/store/apps/details?id= ” + mContext.getPackageName();
//It retrieves the latest version by scraping the content of current version from play store at runtime
Document doc = Jsoup.connect(String.valueOf(playStoreUrl)).get();
mAppStoreVersion = doc.getElementsByAttributeValue
("itemprop","softwareVersion").first().text();
Run Code Online (Sandbox Code Playgroud)
mAppStoreVersion为“随设备而异”。还有其他方法可以从Playstore获取最新的应用程序版本吗?
对于“因设备而异”的版本,您可以检查您的 Google Play 发布商帐户。Google Play 允许您为您的应用程序发布不同的 APK。每一种都针对不同的设备配置。因此,每个 APK 都是应用程序的独立版本,但它们在 Google Play 上共享相同的应用程序列表,并且必须共享相同的包名称并使用相同的发布密钥进行签名。
有关更多详细信息,您可以查看Google 官方文档 Multiple APK Support。