java - Failed to use Google Books API Library -


i developing android app makes use of google books. found api, registered api key , want use library instead of parsing myself this. code comes sample project google. project can compiled not work. "hello" shown "world" not.

info: 1. api key correct. 2. application name not null. 3. tried debugging in eclipse , export apk keystore (registered api key). both failed run code.

toast.maketext(this,"hello", 1).show();  // set books client. final books books = new books.builder(googlenethttptransport.newtrustedtransport(), jsonfactory, null)         .setapplicationname(application_name)         .setgoogleclientrequestinitializer(new booksrequestinitializer(clientcredentials.api_key))         .build(); toast.maketext(this, "world", 1).show(); 

what wrong it?

by way, necessary export keystore in order run above code , debug?

solution found:

  1. use com.google.api.client.extensions.android.http.androidhttp.newcompatibletransport instead of java one. please refer this.
  2. use com.google.api.client.extensions.android.json.androidjsonfactory
  3. be careful of android.os.networkonmainthreadexception. read this.

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -