Howto: Enable Autorotate for your G1 Browser!

Posted on Thursday, December 11, 2008
Filed under

I'm not sure why the Android Browser doesn't auto rotate by default. Instead they have a "Flip Orientation" menu item that lets you toggle your default orientation. Pretty useless overall. Anyhow, a quick hack in the Browser source code let me enable auto rotation via the G-Sensor.

The change is really trivial. In the BrowserActivity.onCreate, I hard coded the orientation to ActivityInfo.SCREEN_ORIENTATION_SENSOR instead of pulling it from a preferences setting.

The downside is that the flip orientation menu item no longer works. Not that I care: I (and probably most people) never used it. So it is a hack, but oh well. If I'm motivated I'll put in a proper fix.

Installation Instructions (you must have root access):

  • Download the updated Browser.apk
  • Run the following from the command prompt to back up your current Browser file to your sdcard and install the new one:
    • adb remount
    • adb pull /system/app/Browser.apk BrowserBackup.apk
    • adb push BrowserBackup.apk /sdcard
    • adb shell rm /system/app/Browser.odex
    • adb push Browser.apk /system/app

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

Comments

5 Responses to "Howto: Enable Autorotate for your G1 Browser!"

  1. Chanequa on December 13, 2008 2:46 PM

    how do i use this? how do i get root access? im not really tech-savvy (at least cellphone pda devices) but would like to perform this feature. also will tampering with a root feature change future apps which try to use it. thanks!

  2. Josh DeFelice on December 21, 2008 12:24 PM

    Seems like using the flip orientation button actually causes the autorotate to stop working until a restart? anyone else experience this?

  3. joshua on January 10, 2009 5:19 AM

    I Say Just Download Steel app in the market. its simple and comes with an on screen keyboard

  4. michael on February 20, 2009 8:09 AM

    once you get root access to your phone using the "telnet" app you cant use it again it wont connect and you cant do the prompts

  5. Beshoy on March 17, 2009 2:30 PM

    WTF. It won't let me copy the new Browser.apk over.

    failed to copy 'c:/temp/Browser.apk' to '/system/app/Browser.apk': No space left on device

    somehow it deleted the Browser.apk and then filled the space or resized the partition in system so that I can't put back the new Browser.apk....

    e-mail me at odslabs@gmail.com if you can help, thanks.

Leave a Reply

Recently Written