Android - HTML Query String Issue

It seems that from Android 3.0, passing value from query string from HTML is broken.

HTML query string is in the form of index.html?name=someone

http://code.google.com/p/android/issues/detail?id=17327
http://code.google.com/p/android/issues/detail?id=17535

Personally, I had tested it and I could not get it work for Android 3.0 and above platform. In the past, Android 2.XX work well. It seems that the issue persist on Android 4.0

To workaround this issue, you could use HTML5 Web Storage. There are plenty of information regarding how to use HTML5 web storage.

http://www.w3schools.com/html5/html5_webstorage.asp

But, using web storage only solve part of the problem. When we use HTML query string, what we want to achieve is load dynamic information on the same html page that have common code.

Web storage does solve our passing of information issue, now, we have to solve the displaying issue.

Why would I say displaying is an issue?

1. The html page is cached
2. HTML DOM object is loaded and does not refresh. (jQueryMobile does have this issue)

For HTML page is cached, you can use window.location.reload() to force a refresh

For inner HTML DOM reloading with jQueryMobile, you can use $.mobile.changePage with reloadPage: true as option.

Comments

  1. Useful article. I hope the bug will be fixed, at least in ICS...

    ReplyDelete

Post a Comment

Popular Posts