Android 4.04 problem med Google staticmap

CARTHO

Member
Licensed User
Longtime User
Hi guys,

Maybe you are moore skilled than I'm but here is a problem I can't understand!

One of my applications loads an url into Webview:

Webview.LoadUrl("http://maps.googleapis.com/maps/api/staticmap?center=57.72887095769152,11.9478305329214&zoom=12&size=1024x1024&maptype=roadmap&markers=size:medium%7Ccolor:blue%7C57.72887095769152,11.9478305329214&markers=size:medium%7Ccolor:red%7C57.70759185,11.9919125&markers=size:medium%7Ccolor:red%7C57.69727504,11.97070251&markers=size:medium%7Ccolor:red%7C57.702353275381,11.9616585317999&markers=size:medium%7Ccolor:red%7C57.69824672,11.98385687&markers=size:medium%7Ccolor:red%7C57.70807682,11.90621691&markers=size:medium%7Ccolor:red%7C57.69397837,11.98745878&sensor=false")

In Android 2.3.5 there is no problem.
In Android 4.04 there is only a picture showing "not available"

If I paste the string into the Web-Reader directly in Android 4.04 the static-map is shown as it should.
I also installed Google-Chrome and paste the string - perfect result.

Do you have any ideas why it doesnt work with Webview in Android 4.04 ?
 

warwound

Expert
Licensed User
Longtime User
Could be a problem with the length of the URL but i somehow doubt that is the problem.

Years ago URLs were limited to relatively short lengths, as browsers and the HTTP specification have advanced the maximum length of a URL has increased - but there is no technical/absolute answer to the question 'what length of a URL is valid?' as it all depends on the browser implementation.
(Or WebView implementation if that's what your problem is).

Try this:
Go to TinyURL.com - shorten that long URL into a tiny URL and create a tiny url from your large url.
Now try the tiny url in the WebView - does it work?

I've seen a few reports recently of problems in the ICS WebView.
The code that fails in the ICS WebView works on previous versions of android and also on jelly bean.
I suspect the ICS WebView has various bugs...

Martin.
 
Upvote 0
Top