Make the browser’s native back-button not exit out of the application. An easy way of doing this is changing the url hash randomly on every screen call. Then, when the hash is changed by the user this is interpreted as going back (this only fixes the back button, not the forward button).

Submitted by Zef Hemel on 14 March 2011 at 20:49

On 14 March 2011 at 21:13 Derek Payton commented:

I can’t say I’m entirely enthused with the random hash idea. Working with Django for so long has given me an appreciation for clean URLs, and I think that the URL hash should be relevant to the page being displayed.

My first thought was that the URL hash could look something like “#/[screen]/[key1/val1[…]]”, but that could become unwieldy if you’re passing many or large parameters to your screen. In that case, a better option may be something like “#/[screen]/[optional hash of serialized parameters]” which.

This would also solve the forward button problem, as the URL hash would remain consistent between screen views.

Disclaimer: I’m a Python developer, and don’t speak Java. My experience with mobl is limited to playing with the demos and reading the demo source and documentation. I have no idea if this is even feasible within mobl, so disregard as needed.


On 14 March 2011 at 21:21 Zef Hemel commented:

As an aside: It doesn’t matter that you don’t speak Java. Mobl has barely anything to do with Java ;) It’s not Java nor is it compiled to Java, only the compiler and IDE run on the JVM.

Of course the random hash idea is basically a hack. However, I’m afraid that encoding the entire user interface state in the URI will be very difficult for mobl, if not almost impossible the way it works now. It would require some serious rethinking of the whole architecture to make this work, with relatively little pay off IMO. Ideally mobl apps run in full-screen mode with no browser buttons at all.


On 15 March 2011 at 13:00 Zef Hemel tagged 0.4.2

On 15 March 2011 at 13:01 Zef Hemel commented:

A naive implementation (as described in the issue) will be in 0.4.2.


On 15 March 2011 at 13:01 Zef Hemel closed this issue.

Log in to post comments