I ran this code:
public static void Get() {
MarketSession session = new MarketSession();
session.login("[My Gamil]","[My Password]");
session.getContext().setAndroidId("[My Gamil]");
String query = "maps";
AppsRequest appsRequest = AppsRequest.newBuilder()
.setQuery(query)
.setStartIndex(0).setEntriesCount(10)
.setWithExtendedInfo(true)
.build();
session.append(appsRequest, new Callback<AppsResponse>() {
@Override
public void onResult(ResponseContext context, AppsResponse response) {
// Your code here
System.out.println(response.getApp(0).getCreator());
// see AppsResponse class definition for more infos
}
});
session.flush();
}
and got this exception:
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Response code = 400, msg = Bad Request
at com.gc.android.market.api.MarketSession.executeRawHttpQuery(MarketSession.java:306)
at com.gc.android.market.api.MarketSession.executeProtobuf(MarketSession.java:252)
at com.gc.android.market.api.MarketSession.flush(MarketSession.java:221)
at myTest.Starter.Get(Starter.java:39)
at myTest.Starter.main(Starter.java:14)
Caused by: java.lang.RuntimeException: Response code = 400, msg = Bad Request
at com.gc.android.market.api.MarketSession.executeRawHttpQuery(MarketSession.java:287)
... 4 more