why you don't use the gson library for json ? checkout
http://code.google.com/p/google-gson , easy coding ...


On Wed, Nov 24, 2010 at 5:33 PM, Atik <[email protected]> wrote:
> i have checked the permission in menifest and  i replaced the code
> snippet as u gave me , but still its giving me null pointer exception
> and i m still too much worried..
>
> thx for the help sir..
>
> waiting for ur helpfull  reply
>
> On Nov 24, 2:23 pm, Sarwar Erfan <[email protected]> wrote:
>> I think you understand that it has nothing to do with the line you
>> specified.
>>
>> However, I suggest you do the followings:
>>
>> #1: Check whether you have added the INTERNET permission to android
>> menifest. You need to add this:
>> <uses-permission android:name="android.permission.INTERNET" />
>> It is required to be added to the AndroidMenifest.xml file. Under
>> menifest tag.http://developer.android.com/guide/topics/security/security.html
>>
>> #2: I had a quick overview of your code and the response of the url
>> (http://ajax.googleapis.com/ajax/services/search/local?
>> v=1.0&sll=48.8565,2.3509&q=restaurant)
>> I found that, there is a bug in your code.
>> In your getResultsArrayList function you have:
>> resultsJsonArray = jsonObject.getJSONArray("results");
>> Which should be:
>> resultsJsonArray =
>> jsonObject.getJSONObject("responseData").getJSONArray("results");
>>
>> Regards
>> Sarwar Erfan
>>
>> On Nov 24, 2:40 pm, Atik <[email protected]> wrote:
>>
>> > thx bro..aftre changing the key now its giving me null pointer
>> > exception for the same code.. for the following lines
>> > line number 51 in JSONHelper Class
>> > JSONObject jsonObject = getJSONObject(httpResponse);
>> > line number 160 in JSONHelper Class
>> > if (httpResponse.getStatusLine().toString().equals("HTTP/1.1 200 OK"))
>>
>> > line number 18 in First Class
>> > jsoNhelper.getJson();
>>
>> > why its giving null here.....some time before it was giving me
>> > arraylentg =0..
>>
>> > pls reply
>>
>> > On Nov 24, 1:26 pm, Sarwar Erfan <[email protected]> wrote:
>>
>> > > On Nov 24, 12:33 pm, Atik <[email protected]> wrote:
>>
>> > > > hi guys this the class where i m parsing the values
>>
>> > > >                         resultsJsonArray = 
>> > > > jsonObject.getJSONArray("resuslt");
>>
>> > > Is this spelling mistake in your actual code? (You wrote resuslt
>> > > instead results)
>>
>> > > Regards
>> > > Sarwar Erfan
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
--------------------------------------
Do you know  Caker?!
http://webcaker.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to