http://maps.googleapis.com/maps/api/geocode/xml?address =% E5% 8C% 97% E4% BA% AC% E5 % A4% A9% E5% AE% 89% E9% 97% A8 & sensor = false
Call the above that link directly in the browser is Chinese.
But why on Android, and always return it in English?
Is there anyone encountered this problem
This is my code:
public static JSONObject getLocationInfo (String address)
throws JSONException, UnsupportedEncodingException
{
HttpGet mHttpGet = new HttpGet ("https://maps.googleapis.com/maps/api/geocode/json?address = Beijing Tiananmen & sensor = false");
HttpClient mHttpClient = new DefaultHttpClient ();
StringBuilder stringBuilder = new StringBuilder ();
try
{
HttpResponse response = mHttpClient.execute (mHttpGet);
HttpEntity entity = response.getEntity ();
InputStream stream = entity.getContent ();
int b;
while ((b = stream.read ())! = -1)
stringBuilder.append ((char) b);
} Catch (ClientProtocolException e)
{
e.printStackTrace ();
} Catch (IOException e)
{
e.printStackTrace ();
}
return new JSONObject (stringBuilder.toString ());
}
Reply:
Nobody knows this problem?
Themselves go top
Reply:
Both days, and how no one way.
Zaiding
Reply:
Reply:
Coding problems
Reply:
I just have to help you tune a bit, found that no matter how codes are returned in English, Tiananmen Square became a "Tiananmen", I do not know how it was.
Bangding one, with demand
Reply:
The reason is not set the phone into English
The server should be able to get some information the client sends http request, and then based on the English system locale returned
Just a guess
Reply:
Where would be the coding problem?
When is coded Http request or obtain data (Response) Code,
However, both of which I have set up, or not, sometimes it returns half in English, half Chinese, for example: Peking
I am very confused
Reply:
Ah, this I thought of the first time I've put the entire system environment settings into Simplified Chinese, the browser also set into UTF8 encoding.
But this still does not work.
I do not know if you are not such wording, or other written information to search for addresses.
If you have the new wording also invited everyone to share, thank you.
Reply:
Useless, not coding problem, I try to use a real machine, the National Bank machines, Chinese environment, return or English, really strange things
Reply:
Oh, this is not my wording is not right, I began to doubt.
I do not know there is no other way? ?
Reply:
This question can not sink the way
Reply:
Bangding attention. Also engage in the same problem.
There, MapView assembly open maps also half Chinese half English. . . .
The landlord did not notice this problem?
Reply:
I did not find that this temporary problem.
Unfortunately, this problem no one can actually help solve
Reply:
& Language = "zh-CN", add this, I remember like the
Reply:
With Baidu map, huh
Reply:
I also used a little before, this is right
Reply:
This problem finally solved yet
No comments:
Post a Comment