1

Hello guys i'm starting android development and currently i'm testing some basic search the UI is like this:

1 EditText: where the user writes something that wants to search example Android 2 Button: when click this button i want to do all the process of searching for that particular topic using the google search api

https:/ /ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Android

i think i have right the json parser but i'm getting and NetworkOnMainException something like that..

MainActivity.java :

http://pastebin.com/4CCmviBR#

JSONParser.java:

http://pastebin.com/Ue630Eqs

the JSON:

http://pastebin.com/kw1qDuvS

please guys help me out

Carlos Delgado
  • 159
  • 1
  • 2
  • 15
  • 1
    in case you miss this: http://stackoverflow.com/questions/6343166/android-os-networkonmainthreadexception – pt2121 Feb 18 '15 at 00:54
  • 1
    In the future, please include all relevant code in your post and **don't** just include a link to a code hosting site. Your post should stand alone from any other resource; consider what would happen if that site went down in the future! – Nathan Tuggy Feb 18 '15 at 00:57
  • thanks for answer, EntryLevelDev i check the link you prived but i'm not clear yet in the doInBackground() needs parameters and also a return type.. what type you think is the one i need?? – Carlos Delgado Feb 18 '15 at 02:53
  • Nathan i tryed to put in code tag but i don't know what didn't work so i had to put it pastebin =/ – Carlos Delgado Feb 18 '15 at 02:53
  • Check here for how to do that, or search for resources on AsyncTask: https://developer.android.com/reference/android/os/AsyncTask.html – nasch Feb 18 '15 at 04:07

0 Answers0