cannot initialize MarketSession (MarketSession.executeRawHttpQuery threw excetion)

44 views
Skip to first unread message

Elad Benda via StackOverflow

unread,
Mar 1, 2013, 12:32:48 PM3/1/13
to google-appengin...@googlegroups.com

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


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/15163425/cannot-initialize-marketsession-marketsession-executerawhttpquery-threw-excetio

Elad Benda via StackOverflow

unread,
Mar 1, 2013, 12:42:50 PM3/1/13
to google-appengin...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages