Virtual buttons allows for the buttons (Home, Back, etc) to be incorporated in the bottom of the screen.
The Input system in Android provides special features for implementing virtual soft keys.
There are three cases:
1. If the virtual soft keys are displayed graphically on the screen, as on the Galaxy Nexus, then they are implemented by the Navigation Bar component in the System UI package.
2. If the virtual soft keys are implemented as an extended touchable region that is part of the main touch screen, as on the Nexus One, then the input system uses a virtual key map file to translate X / Y touch coordinates into Linux key codes, then uses the key layout file to translate Linux key codes into Android key codes.
3. If the virtual soft keys are implemented as capacitive buttons that are separate from the main touch screen, as on the Nexus S, then the kernel device driver or firmware is responsible for translating touches into Linux key codes which the input system then translates into Android key codes using the key layout file.
This article targets for the devices which are running on Gingerbread (2.3.6) without the hardware buttons.
I Back-ported the "Virtual Soft keys / Navigation Bar from ICS (4.0.3) to Gingerbread (2.3.6) .
The animation changes of ICS have been discarded in Gingerbread and the Functionality of 'Recent Applications list ' of ICS hasn't been taken into GB.
Follow these steps to get the Virtual soft keys on Gingerbread (2.3.6).
Prerequisites :
a) AOSP Gingerbread code (2.3.6) -- Get it from here
b) AOSP ICS source code (4.0.3) -- Get it from here
Source File Changes:
All the source file changes are in '/frameworks/base' module.
Addition of source files : New source files have been added from ICS to GB.
a) NavigationBarView.java: Copy this file from ICS to GB.
ICS Location : /frameworks/base/packages/systemui/src/com/android
/systemui/statusbar/phone/
GB Location : /frameworks/base/packages/systemui/src/com/android
/systemui/statusbar/
Note : Ignore out all the animator related stuffs in this source file.
Change the package name also.
b) KeyButtonView.java: Copy this file from ICS to GB.
ICS Location : /frameworks/base/packages/systemui/src/com/android
/systemui/statusbar/policy/
GB Location : /frameworks/base/packages/systemui/src/com/android
/systemui/statusbar/
Note : Ignore out all the animator related stuffs in this source file.
Change the package name also.
Modification to source files :
a) core/java/android/view/KeyCharacterMap.java :
b) core/java/android/view/View.java
c) core/java/android/view/ViewGroup.java
d) core/java/android/view/WindowManager.java
e) include/ui/InputDispatcher.h
f) packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java
g) policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Resource File Changes :
Addition of Resource Files : New Resource files have been added from ICS to GB
a) Copy these files from /frameworks/base/packages/SystemUI
/res/drawable-hdpi to
/frameworks/base/packages/SystemUI/res/drawable
/res/layout/ to
/frameworks/base/packages/SystemUI/res/layout/
c) attrs.xml : Copy this file from /frameworks/base/packages/SystemUI/res/values/ to /frameworks/base/packages/SystemUI/res/values/
Modifications to Resource Files :
a) core/res/res/values/dimens.xml
b) packages/SystemUI/res/layout/status_bar.xml
c) packages/SystemUI/res/values/dimens.xml
d) packages/SystemUI/res/values/strings.xml
Will be updating the complete patches list of the modifications soon !!!
Happy Navigating !!
Modification to source files :
a) core/java/android/view/KeyCharacterMap.java :
b) core/java/android/view/View.java
c) core/java/android/view/ViewGroup.java
d) core/java/android/view/WindowManager.java
e) include/ui/InputDispatcher.h
f) packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java
g) policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Resource File Changes :
Addition of Resource Files : New Resource files have been added from ICS to GB
a) Copy these files from /frameworks/base/packages/SystemUI
/res/drawable-hdpi to
/frameworks/base/packages/SystemUI/res/drawable
- packages/SystemUI/res/drawable/ic_sysbar_back.png
- packages/SystemUI/res/drawable/ic_sysbar_back_land.png
- packages/SystemUI/res/drawable/ic_sysbar_highlight.png
- packages/SystemUI/res/drawable/ic_sysbar_highlight_land.png
- packages/SystemUI/res/drawable/ic_sysbar_home.png
- packages/SystemUI/res/drawable/ic_sysbar_home_land.png
- packages/SystemUI/res/drawable/ic_sysbar_lights_out_dot_large.png
- Packages/SystemUI/res/drawable/ic_sysbar_lights_out_dot_small.png
- packages/SystemUI/res/drawable/ic_sysbar_menu.png
- packages/SystemUI/res/drawable/ic_sysbar_menu_land.png
- packages/SystemUI/res/drawable/ic_sysbar_recent.png
- packages/SystemUI/res/drawable/ic_sysbar_recent_land.png
/res/layout/ to
/frameworks/base/packages/SystemUI/res/layout/
c) attrs.xml : Copy this file from /frameworks/base/packages/SystemUI/res/values/ to /frameworks/base/packages/SystemUI/res/values/
Modifications to Resource Files :
a) core/res/res/values/dimens.xml
b) packages/SystemUI/res/layout/status_bar.xml
c) packages/SystemUI/res/values/dimens.xml
d) packages/SystemUI/res/values/strings.xml
Will be updating the complete patches list of the modifications soon !!!
Happy Navigating !!

Nice work! Could you make a flashable zip of it because i don't know how to compile these stuff but I'd really like to try it out.
ReplyDeletehow about a flashable zip........ cant understand all the programming part.....
ReplyDeleteI'd like to do this too... but won't pester you for a flashable zip as I know that there won't just be a systemfile or 2 to replace that will fit every device and ROM. Would be nice to get a detailed "how to" for technically literate non-programmers though. Can you point us at some resources or guides to read that will help?
ReplyDeleteDo you think it would be possible to add the soft keys wothout any interference with the current theme???
ReplyDeletePlease, made it!!!
Thank you.
Thanks for this tuto.
ReplyDeleteDo you think modifications can be made without source files but by searching in system/framework/ jar files, smali files and systemui.apk ?
Thank You for this!!
ReplyDelete==>>> CLICK HERE TO WATCH Game Of Thrones Finale Online
http://nowshowinglive.blogspot.com/2012/06/watch-game-of-thrones-season-2-episode.html
ReplyDeleteHello, nice tut, but could you please add the details on the modifications you made to the single files? That info would really be helpfull! Thanks in advantage, have a good time!
ReplyDeleteHi
ReplyDeleteThanks for the awesome tutorial. Can you provide some more details on the source file modifications, though? Or can you put the modified source files online somewhere? That would be great!
Thanks and regards
Hi
DeleteThanks for the inputs.
Please provide more inputs on the source file modifications required.
Hope to get the details.
It also goes on gingerbread 2.3.4? Fw. 62
ReplyDeleteNice and after update it's ready to compile?
ReplyDelete