Android market API无法返回结果
我有下面的代码在我的应用程序中被调用。 传入execute方法的appName是用户指定的任何应用程序名称 希望搜索。 起初这很好用,但是现在我想要的主要应用程序 搜索不返回任何结果。 例如,如果appName=“maps”返回一个值数组,那么 如果appName=“capitalOne”未找到任何结果。 就像我上面说的,这确实有效,但有一天它停止了 返回我搜索的主要应用程序的结果。 任何帮助都将不胜感激Android market API无法返回结果,android,google-play,Android,Google Play,我有下面的代码在我的应用程序中被调用。 传入execute方法的appName是用户指定的任何应用程序名称 希望搜索。 起初这很好用,但是现在我想要的主要应用程序 搜索不返回任何结果。 例如,如果appName=“maps”返回一个值数组,那么 如果appName=“capitalOne”未找到任何结果。 就像我上面说的,这确实有效,但有一天它停止了 返回我搜索的主要应用程序的结果。 任何帮助都将不胜感激 private Callback<AppsResponse> call
private Callback<AppsResponse> callback = new Callback<AppsResponse>() {
public void onResult(ResponseContext context, AppsResponse response) {
List<Results> list = new ArrayList<Results>();
List<App> apps = response.getAppList();
for (App app : apps) {
Results r = new Results();
r.setArtistName(app.getCreator());
r.setArtistId(app.getCreatorId());
r.setKind(app.getAppType().toString());
r.setTrackId("DROID_" + app.getId());
r.setPrice(app.getPrice());
r.setVersion(app.getVersion());
r.setAverageUserRating(app.getRating());
r.setUserRatingCount(String.valueOf(app.getRatingsCount()));
r.setTrackViewUrl("https://ssl.gstatic.com/android/market/"
+ app.getPackageName());
list.add(r);
}
res.setResults(list);
}
};
public T execute(String appName) throws Exception {
String query = appName;
session.login("email", "password");
res = new SearchResults();
AppsRequest appsRequest = AppsRequest.newBuilder().setQuery(query) .setStartIndex(0).setEntriesCount(10).setWithExtendedInfo(true)
.build();
session.append(appsRequest, callback);
session.flush();
return (T) res;
}
Android市场没有官方API
如果您使用的第三方API出现问题,您应该尝试联系该API的开发人员。您必须提供真实的android id才能使其正常工作。 不是这个假的Android:“0123456789123456” 您可以从gtalk服务监视器获得它
(android id的数字部分)您是否检查过该应用程序是否仍然存在?有时人们会关闭应用程序。没有Android Market API。假ID可以很好地搜索某些应用程序,但有些则不行。例如,搜索“地图”会返回许多结果,但是搜索“大写字母1”不会返回任何结果。此外,我不是在一个真正的设备上工作。这是一个运行在用户工作站而不是android设备上的胖客户端java应用程序。这种方式不有效。它不是一个官方API,它的开发人员可以多次更改或更新,因此您需要多次更改代码或方法。我用这个非官方的API创建了一个应用程序,第一次它运行良好,然后在一个月后崩溃,再次开始工作,然后再次崩溃。这个API可以检索市场上并非所有应用程序的信息。我认为开发人员有自己的数据库,他们可以在需要时更新它。我决定不使用这个API。
authSubToken: "token goes here"
unknown1: 0
version: 1002012
androidId: "0123456789123456"
deviceAndSdkVersion: "crespo:8"
userLanguage: "en"
userCountry: "us"
operatorAlpha: "T-Mobile"
simOperatorAlpha: "T-Mobile"
operatorNumeric: "310260"
simOperatorNumeric: "310260"