[TUT/GUIDE]Make your own On Screen Buttons{OSB}[08-06-2013]

Aneel

Senior Member
Nov 23, 2012
1,013
2,044
153
Manhattan, New York, NY
A guide how to add OSB for your ROM...!!!








Credits:

1. Attitude.SSJ for the DIY of OSB
2. LoneWanderer for the tut for HDPI devices
3.atticus182 for the beautiful icons of OSB
4. Serajr for the superb system UI mod
5. Tickle Fish for TICKLE MY ANDROID


Before we begin ask yourselves a question..!!

1.Do we really need OSB for mdpi devices??
Ans: i feel yes, "PREVENTION IS BETTER THAN CURE" its better we use our touch rather than using the soft keys for such along time and eventually get them busted! :silly:

2. Do we really need to follow this guide to make my own OSB??
Ans: Well it depends on your requirements......

3. will it support ICS, JB and even CM???
Ans: Hell yeah..!! it does work!!! sorry GB users :eek:

Tools Required:
1.framework-res.apk
2.SystemUI.apk
3.Winrar or 7zip
4.Notepad++
5.Apktool or Apkmanager or Apkmultitool
6.JAVA & JDK already installed in your PC

last but not the least required thing is a fully functioning human brain..!!


STEP1:

Framework Part:

1) Take the framework-res.apk and SystemUI.apk from rom and paste it in "place-apk-here-for-modding" folder in Apktool
2) Decompile the framework-res.apk using
Code:
apktool d framework-res.apk
3)Once decompiled you'll obtain a folder "framework-res"
4) Open it ..goto 'res\values' folder...find bools and right click to edit with notepad++ and by using ctrl+f search for
Code:
<bool name="config_showNavigationBar">[COLOR="Red"]false[/COLOR]</bool>
5)Rename falseto true...save file.
6) Open 'dimens' file in the same folder res\values and using ctrl+f search for navigation bar height and width and change them to whatever dpi you want and save file
7) Thats it!! compile the framework-res using the code
Code:
apktool b framework-res
8)Now you will get the new apk file of framwork-res.apk in the dist folder of framework-res folder if you are using the apktool and for other tools it will be in the respective output folder
9) Now we have to sign the framework-res.apk using any apk signing software or simply use TICKLE MY ANDROID by TICKLE FISH to sign your apk by placing it in the out folder of Tickle my android and sign it by pressing button 15 to sign apk file under theming menu(2)
10)thats it now your rom will have OSB

Note: If you dont want OSB in landscape view also..then type 0.0dip like this... in res\values\dimens
Code:
<dimen name="navigation_bar_height_landscape">0.0dip</dimen>


STEP2:

System UI part:

1. using 7zip or winrar OPEN the SystemUI.apk and navigate to res>drawable_mdpi (if drawable_mdpi is not present go to drawable_hdpi) and just drag and drop this folder "drawable_mdpi (or) hdpi"where you are working
2. search for these png files in the folder
Code:
ic_sysbar_back
ic_sysbar_back_ime
ic_sysbar_home
ic_sysbar_menu
ic_sysbar_recent
if they are present thats done if they are not present you'll have to add them into the folder with dimensions of your choice
3. Thats it NOW you have OSB in your ROM


WANT TO ASK ANYTHING???


  • How do i add them man...??
Well that's very simple go to this page http://forum.xda-developers.com/showthread.php?t=1413582 and download the required OSB styles you want to add to your ROM
but hey this brother who is a Recognized contributor @atticus182 should deserve a THANKS for such beautiful icons

Once downloaded you must re-size the pngs as far as i know for mdpi devices in portrait mode the image should be scaled around width:80px and height:48px (80x48) and in landscape mode width:48px and height:80px (40x80) is recommended

after they are re-sized they should be copy pasted to the folder we dragged and dropped from SystemUI.apk

once they are copy pasted again open SystemUI.apk in 7zip or Winrar and open the res folder and now just drag and drop the folder in which we added the png files and save the compression level to store if asked and now decompile SystemUI.apk and check whether the files which we drag and dropped are present in the res folder and even check for the png files the res>drawable mdpi(or)hdpi folder... if they are present then it is well and good if they arenot present then you have done something wrong post your problem i'll help you out or there are lot of devs here in XDA they'll help
STEP3:

CREATING A FLASHABLE ZIP
1) Download Sample.zip but dont extract it..just open the sample provided with winrar...you will see 2 folders META-INF and system.
View attachment Sample.zip
2) In system there will be two folders framework and app...
Drag the new framework-res.apk to framework folder...
and the SystemUI.apk folder to app..

3) META-INF has info about flashing...goto com..google..android and open update-script file with notepad++...you can edit whatever you want in
ui_print (" ") ...it will be displayed while installing...Save file..


Done your flashable zip is also ready to be flashed using CWM recovery


Feel free to ask questions if you have any coz this tutorila/guide is n-o-o-b friendly :victory: :angel:
P.S add me to your credits if you manage to get OSB working in your rom using this GUIDE/TUT
Dont ever forget to Click :good:button
 
Last edited:

Vineel

Senior Member
May 7, 2013
52
24
0
Superb guide

Grrrr... i'm jealous now how are managing to work with engineering projects and XDA dude...?? Awesome work man keep up the good work :good: :highfive:




Sent from my ST15i using xda premium
 
  • Like
Reactions: Aneel

Aneel

Senior Member
Nov 23, 2012
1,013
2,044
153
Manhattan, New York, NY
Grrrr... i'm jealous now how are managing to work with engineering projects and XDA dude...?? Awesome work man keep up the good work :good: :highfive:




Sent from my ST15i using xda premium
hehe... thanks alot man!! try yourselves and show me tomorrow morning at your place.. will be happy to see if you understand and be successful in adding the OSB
 

Mo7mD.ZaYOnA

Senior Member
Mar 2, 2012
300
53
0
Baghdad
www.tiraq.com
@Aneel

Hi Bro.
this is my first editing :fingers-crossed:
has been successfully :highfive: Thank you very much

EDIT

i can't hide OSB on landscape i make it 0dpi but still big i think 48 !


Code:
    <dimen name="navigation_bar_height">34.0dip</dimen>
    <dimen name="navigation_bar_width">48.0dip</dimen>
    <dimen name="navigation_bar_height_landscape">0.0dip</dimen>
 
Last edited:

Aneel

Senior Member
Nov 23, 2012
1,013
2,044
153
Manhattan, New York, NY
@Aneel

Hi Bro.
this is my first editing :fingers-crossed:
has been successfully :highfive: Thank you very much

EDIT

i can't hide OSB on landscape i make it 0dpi but still big i think 48 !


Code:
    <dimen name="navigation_bar_height">34.0dip</dimen>
    <dimen name="navigation_bar_width">48.0dip</dimen>
    <dimen name="navigation_bar_height_landscape">0.0dip</dimen>
you must edit it in framework-res.apk bro

Decompile The Framework-res And Navigate To /res/values/dimens.xml
Then Find These Lines
Code:
<dimen name="navigation_bar_height">22.0dip</dimen>
<dimen name="navigation_bar_width">22.0dip</dimen>
 

Mo7mD.ZaYOnA

Senior Member
Mar 2, 2012
300
53
0
Baghdad
www.tiraq.com
you must edit it in framework-res.apk bro

Decompile The Framework-res And Navigate To /res/values/dimens.xml
Then Find These Lines
Code:
<dimen name="navigation_bar_height">22.0dip</dimen>
<dimen name="navigation_bar_width">22.0dip</dimen>
from framework-res.apk
/res/values/dimens.xml

i find these lines

<dimen name="navigation_bar_height">48.0dip</dimen>
<dimen name="navigation_bar_width">48.0dip</dimen>

Change height to 34dip

and add this line to disable in landscape

<dimen name="navigation_bar_height_landscape">0.0dip</dimen>

but it's still work in landscape :(
 

Aneel

Senior Member
Nov 23, 2012
1,013
2,044
153
Manhattan, New York, NY
from framework-res.apk
/res/values/dimens.xml

i find these lines

<dimen name="navigation_bar_height">48.0dip</dimen>
<dimen name="navigation_bar_width">48.0dip</dimen>

Change height to 34dip

and add this line to disable in landscape

<dimen name="navigation_bar_height_landscape">0.0dip</dimen>

but it's still work in landscape :(
try using some on screen button app mod bro..... i think there is one in Xperia P forums where it works with no issues for all phones
 
  • Like
Reactions: Mo7mD.ZaYOnA

Ticklefish

Recognized Themer
Oct 27, 2011
6,743
8,534
263
Hampshire, UK
This is a very cool tutorial and thanks for saying thanks for Tickle My Android. :thumbup:

However, I should point out that you can use Tickle My Android for more than just signing the apk. It can be used to take the file from your phone, decompile it, recompile it and put it into a flashable zip.

Saves having to download lots of different programs when you can do what you need with just one...;)

Sent from my C6603 using XDA Premium 4 mobile app
 
  • Like
Reactions: Aneel

Aneel

Senior Member
Nov 23, 2012
1,013
2,044
153
Manhattan, New York, NY
This is a very cool tutorial and thanks for saying thanks for Tickle My Android. :thumbup:

However, I should point out that you can use Tickle My Android for more than just signing the apk. It can be used to take the file from your phone, decompile it, recompile it and put it into a flashable zip.

Saves having to download lots of different programs when you can do what you need with just one...;)

Sent from my C6603 using XDA Premium 4 mobile app
Yes it is an awesome tool that i ever found for theming,decompiling,signing and what not! i use it for porting few apps too :highfive: :angel:
 
  • Like
Reactions: Ticklefish