last day (855 days later) » 

12:21 PM
hhhmmm see api key
...
right click on link
 
{
"Status": {
"code": 610,
"request": "geocode"
}
}
 
copy link address then paste it
done ?
right click on link
then paste it
 
Note: The Google Maps Geocoding API Version 2 has been officially deprecated as of March 8, 2010. The V2 API will continue to work as per our deprecation policy, but we encourage you to migrate your code to the new Geocoding API.
 
what ?
but i am getting all code in String
 
you are talking about right??
this is the expected JSON response format?
 
12:25 PM
okay so its not possible right
did u seen whole json 44 line code
 
still no array of Placemark
wait this link is a whole new data!
 
not related to 1st one right?
 
see formatted_address
yeah got o/p
getting data
i want to fetch formatted_address
@Pallavi
 
@Rstar what do you want to do now?
ok...
formatted_address is just a simple string
 
12:35 PM
yeah so i am doing this
 
geometry is object
 
try
{
JSONObject json = new JSONObject(response);
JSONArray resultJson = json.getJSONArray("results");
JSONArray addJson = resultJson.getJSONArray("address_components");
}
catch(Exception e)
{
Log.d("Error",e.toString());
}
 
types is array
 
JSONArray addJson = resultJson.getJSONArray("address_components"); gives error
The method getJSONArray(int) in the type JSONArray is not applicable for the arguments (String)
@Pallavi
 
you have to get the array from the object
not array from inside an array
JSONArray addJson = resultJson.getJSONArray("address_components");
this should have been
 
12:45 PM
not getting ?
 
for(int i=0;i<resultJson.length;i++)
 
ok
now ?
 
{
JSONObject resultObj=resultJson.getJsonObject(i);
JSONArray addJson = resultObj.getJSONArray("address_components");
}
finally whole of your code should look like
 
try
{
JSONObject json = new JSONObject(response);
JSONArray resultArray = json.getJSONArray("results");
JSONArray resultJson = json.getJSONArray("address_components");

JSONObject resultObj=resultJson.getJsonObject(i);
JSONArray addJson = resultObj.getJSONArray("address_components");
}
catch(Exception e)
{
Log.d("Error",e.toString());
}
?
 
try
{
JSONObject json = new JSONObject(response);
JSONArray resultJson = json.getJSONArray("results");
for(int i=0;i<resultJson.length;i++)
{
    JSONObject resultObj=resultJson.getJsonObject(i);
    JSONArray addJson = resultObj.getJSONArray("address_components");
}
}
catch(Exception e)
{
Log.d("Error",e.toString());
}
 
12:53 PM
he method getJsonObject(int) is undefined for the type JSONArray
 
@Rstar the for loop you forgot :P
@Rstar did you paste this same code?
 
{
JSONObject json = new JSONObject(response);
JSONArray resultJson = json.getJSONArray("results");
for(int i=0;i<resultJson.length();i++)
{
JSONObject resultObj=resultJson.getJsonObject(i);
JSONArray addJson = resultObj.getJSONArray("address_components");
}
}
catch(Exception e)
{
Log.d("Error",e.toString());
}
nope see what i wrote
 
@Rstar
wait
1 more change in the above code
try
{
JSONObject json = new JSONObject(response);
JSONArray resultJson = json.getJSONArray("results");
for(int i=0;i<resultJson.length;i++)
{
JSONObject resultObj=resultJson.getJSONObject(i);
JSONArray addJson = resultObj.getJSONArray("address_components");
}
}
catch(Exception e)
{
Log.d("Error",e.toString());
}
and this code should work fine
and to get the long_name, short_name, types
you have to write another for loop
right after addJson
search for Parsing JSON Data in that tutorial
then read only step 2
that would be useful for you :)
 
okay
@Pallavi what to do to print formatted_address
 
JSONArray addJson = resultObj.getJSONArray("address_components");
JSONObject formatted_address=resultObj.getString("formatted_address");
 
1:07 PM
written
try
{
JSONObject json = new JSONObject(response);
JSONArray resultJson = json.getJSONArray("results");
for(int i=0;i<resultJson.length();i++)
{
JSONObject resultObj =resultJson.getJSONObject(i);

JSONArray addJson = resultObj.getJSONArray("address_components");
Log.d("long_name", addJson.getJSONObject(i).getString("long_name"));
Log.d("short_name", addJson.getJSONObject(i).getString("short_name"));
Log.d("types", addJson.getJSONObject(i).getString("types"));
JSONObject formatted_address=resultObj.getString("formatted_address");
 
try
{
JSONObject json = new JSONObject(response);
JSONArray resultJson = json.getJSONArray("results");
for(int i=0;i<resultJson.length();i++)
{
JSONObject resultObj =resultJson.getJSONObject(i);

JSONArray addJson = resultObj.getJSONArray("address_components");
for(int j=0;j<lenght;j++){
Log.d("long_name", addJson.getJSONObject(j).getString("long_name"));
Log.d("short_name", addJson.getJSONObject(j).getString("short_name"));
Log.d("types", addJson.getJSONObject(j).getString("types"));
}
JSONObject formatted_address=resultObj.getString("formatted_address");
@Rstar for every array you need to write the for loop
 
okay wait there is an error
it should be String String formatted_address = resultObj.getString("formatted_address");
not JSONObject
@Pallavi what it gives see
 
@Rstar right.. sorry my mistake
 
see i got this
06-18 18:46:41.151: D/add(1440): Dhongre Mahraj Rd, Sarvodaya Nagar, Sola, Ahmedabad, Gujarat, India
06-18 18:46:41.161: D/add(1440): Sarvodaya Nagar, Sola, Ahmedabad, Gujarat, India
06-18 18:46:41.171: D/add(1440): Sola, Ahmedabad, Gujarat, India
06-18 18:46:41.181: D/add(1440): Ahmedabad, Gujarat, India
06-18 18:46:41.181: D/add(1440): Ahmedabad, Gujarat, India
06-18 18:46:41.181: D/add(1440): Gujarat, India
06-18 18:46:41.181: D/add(1440): India
multiple times
 
@Rstar @Pallavi Hello maintaining seperate rooms.......
 
1:17 PM
@Abhi had to share lots of code
 
@Abhi nope
 
and others might b offended
 
yeah with personal infos
 
in that room
so, better separate
 
okay @Rstar what should give call back url for Yahoo integration..?
 
1:20 PM
@Rstar your result is correct
now all you do is add correct TAGs to specify which line is for which data
 
after login where u want to move if u write String CALLBACK_UR="http://www.google.com"
it will redirect you to google after login
@Pallavi means ? i just want first address
 
Okay....., We have scheme and host in manifest , right? what should we give there @Rstar
 
what first address?
 
it has provided add of 6 lines i just want to fetch 06-18 18:46:41.151: D/add(1440): Dhongre Mahraj Rd, Sarvodaya Nagar, Sola, Ahmedabad, Gujarat, India
 
ok... additional lines are there in logt
then comment the extras :P
 
1:23 PM
?
comments the extras ?
 
@Rstar you will get as many lines as number of address_components in the data
 
Log.d("add",formatted_address);
this gives 6 lines
 
??
 
6 mins ago, by Rstar
06-18 18:46:41.151: D/add(1440): Dhongre Mahraj Rd, Sarvodaya Nagar, Sola, Ahmedabad, Gujarat, India
06-18 18:46:41.161: D/add(1440): Sarvodaya Nagar, Sola, Ahmedabad, Gujarat, India
06-18 18:46:41.171: D/add(1440): Sola, Ahmedabad, Gujarat, India
06-18 18:46:41.181: D/add(1440): Ahmedabad, Gujarat, India
06-18 18:46:41.181: D/add(1440): Ahmedabad, Gujarat, India
06-18 18:46:41.181: D/add(1440): Gujarat, India
06-18 18:46:41.181: D/add(1440): India
 
it should give 7 lines in all
which is correct
 
1:24 PM
what ?
@Pallavi i want only 06-18 18:46:41.151: D/add(1440): Dhongre Mahraj Rd, Sarvodaya Nagar, Sola, Ahmedabad, Gujarat, India
 
yeah
you have looped the results right?
so it will give for ALL the possible formatted_address that it finds
in the data
 
okay
 
and search for the formatted_address in the data, there are 7
so
 
i got u
 
it is showing 7 lines
right!
@Abhi whose profile did you follow to come to this room???
 
1:27 PM
@Rstar reply me...., I know Rstar is friend of Pallavi :P
 
@Abhi wait i am inproblem
nope @Abhi
 
Okay..., what is your problem
 
@Abhi answer my question first
1 min ago, by Pallavi
@Abhi whose profile did you follow to come to this room???
 
@Abhi just copy paste code
 
@Pallavi I know Rstar is friend of Pallavi :P so i have followed your's only
 
1:28 PM
huh?
 
Yes
 
why?
 
Nothing leave it we are in problem you alone enjoying.... :P
 
can't help you in your problem sorry
 
why :)
 
1:30 PM
coz i have no idea about yahoo
 
@Rstar <data android:scheme="url" android:host="callback" /> this is i am asking what should we give for scheme and host
@Pallavi Smiley changed :P
 
lol right :P
 
Smiling _____
 
@Pallavi
 
hmm
 
1:32 PM
this gives nullpointer
if(formatted_address.equals(""))
{
formatted_address = resultObj.getString("formatted_address");
Log.d("add",formatted_address);
}
 
@Rstar what with this: if(formatted_address.equals(""))
 
formatted_address.??
 
formatted_address is String
try
{
String formatted_address = null ;
JSONObject json = new JSONObject(response);
JSONArray resultJson = json.getJSONArray("results");
for(int i=0;i<resultJson.length();i++)
{
JSONObject resultObj =resultJson.getJSONObject(i);

JSONArray addJson = resultObj.getJSONArray("address_components");
for(int j=0;j<addJson.length();j++)
{
Log.d("long_name", addJson.getJSONObject(j).getString("long_name"));
Log.d("short_name", addJson.getJSONObject(j).getString("short_name"));
Log.d("types", addJson.getJSONObject(j).getString("types"));
 
formatted_address=null.., where you getting value to this string
 
formatted_address="" initially?
otherwise even better
if(formatted_address.length==0)
 
1:37 PM
6 mins ago, by Abhi
@Rstar <data android:scheme="url" android:host="callback" /> this is i am asking what should we give for scheme and host
 
@Pallavi correct
 
@Rstar @Rstar..................
 
he is updating daily status
chalo
bye guys
c u tomorrow
 

  last day (855 days later) »