Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,781,851 Members 47,598 Now Online
XDA Developers Android and Mobile Development Forum

[Guide][Noob Friendly with Photos]Make Your Own Settings Section +Add Apps in it 28/4

Tip us?
 
abo hani
Old
(Last edited by abo hani; 28th February 2014 at 04:57 PM.) Reason: Adding Photos Samples & Changing the Name of the thread .
#1  
abo hani's Avatar
Recognized Contributor - OP
Thanks Meter 1,586
Posts: 971
Join Date: Jan 2013
Location: Latakia
Talking [Guide][Noob Friendly with Photos]Make Your Own Settings Section +Add Apps in it 28/4

Hello There ... And Welcome to my new GUIDE

What is this guide for ? Explain please

Guide Explain : You will make a section in Settings.apk and add what ever you want

Sample :
 

Note 1 : You Need to know how to decompile & compile ... See Here Pree Me
Note 2 : Download "Honami.xml" sample , Press Me .

..: Additional Edit :..


..: First Part :..

 
Adding Section id .

Go to res/values , and open ids.xml .
Go to last line , and add this :
<item type="id" name="honami">false</item> Change "honami" to section id name ...."you ROM name" whatever you want ... but without BIG LETTERS !! & spaces ! .

Photo :
 


..: Second Part :..
 

Adding Section name .
Go to res/values , and open strings.xml .
Go to last line , and add this :
<string name="honami_category">Personalization</string> replace between > < with your section name .


Photo :
 


..: Third Part :..
 
Adding Section icon .

Go to res/drawable-xhdpi and add icon with 72 x 72 .... and name it as you want without BIG LETTERS & Spaces !!

Photo :
 

=============

..: Adding Section :..


 
Ok ... Lets begin the hard work

First Thing see highlighted text ...

 

This is the section ....

Lets start ... Go to res/xml/settings_headers.xml
open it and see above " <header android:title="@string/header_category_advanced" /> "
Add this code
This is " Section Code "
Quote:
<header android:icon="@drawable/honami" android:id="@id/honami" android:title="@string/honami_category1" android:fragment="com.sonymobile.settings.GenericS ettingsFragment">
<extra android:name="extra_after_title" android:value="data_usage_settings" />
<extra android:name="extra_fragment_preference_xml" android:value="honami" />
</header>
Ok for now .. we named the "Section" and we put an 'id" for it ... and we added an "icon" for it ...
Now we have to name the "Section Header"

Go to res/values/strings.xml
open it and go to the last line ... and add this :
Quote:
<string name="header_name">Honami Style Mode</string>
Change between > < to whatever you want ...

Photo :
 


and go back to "Settings_Headers.xml" and add this code above "Section Code" :
<header android:title="@string/header_name" />

We have named the "header" now its time to edit the "Section Code"

android:icon="@drawable/honami" change after " / " with section icon name that you have added .
android:id="@id/honami" change after " / " with section id that you have added .
android:title="@string/honami_category1" chnage after " / " with section name ... section name not header name ! that you have added in Strings.xml .
android:value="honami" change after " / " with section code ... like i named it honami ... name it what ever code you want ...

Photo :
 

=============

..: Adding Apps in Section :..


 
Ok .... We are going to make section.xml file .... to put apps in it ...
You Remember that we put "id + name" those id + name for section.xml ....

So now lets start

I put a download link for sample.xml .... copy it and move it to xml folder ... and rename it to "id name" that you put in "values/ids.xml" file .

Now ... what to edit ?

<com.sonymobile.settings.preference.PreferenceCate gory android:title="@string/honami_apps_section1">
This is Section name .... first section name ...
You should add it to strings ... so go to strings.xml and add this code to the last line :
<string name="honami_apps_section1">Change it to apps section name</string> change it to whatever you want .

<com.sonymobile.settings.preference.IntentPreferen ce android:icon="@drawable/ic_sms" android:title="@string/app titl
<intent android:targetPackage="app package" android:action="android.intent.action.MAIN" android:targetClass="app activty" />

android:icon ... this is "app icon" ... you must add icon for the app .... add it to "drawable-xhdpi" folder ..
So .. change "ic_sms" to icon name ...

android:title .. this is app name ... as i explained above ... you must add string code to strings.xml .

android:targetPackage ... this is app package ... to know it .. you must decompile the app you want to add in the section ...
you will see it in AndroidMainFest.xml file ....

android:targetClass ... this is app activity ... it may be like "com.blabla.bla.MainActivity"
Or like this ".MainActivity"
If it like the second way ... you need to add "App package before it"
Example : "apppackage.mainactivity" ===> "com.blabla.bla.mainactivity" .

<com.sonymobile.settings.preference.PreferenceCate gory android:title="@string/honami_category2">

this is second apps section ... mode it as above ...

if you want only one section !

Delete this :

Quote:
<com.sonymobile.settings.preference.PreferenceCate gory android:title="@string/honami_category2">
<com.sonymobile.settings.preference.IntentPreferen ce android:icon="@drawable/ic_sms" android:title="@string/app titl
<intent android:targetPackage="app package" android:action="android.intent.action.MAIN" android:targetClass="app activty" />
</com.sonymobile.settings.preference.IntentPreferenc e>
</com.sonymobile.settings.preference.PreferenceCateg ory>
If you want another section ...copy this ...

Quote:
<com.sonymobile.settings.preference.PreferenceCate gory android:title="@string/honami_category2">
<com.sonymobile.settings.preference.IntentPreferen ce android:icon="@drawable/ic_sms" android:title="@string/app titl
<intent android:targetPackage="app package" android:action="android.intent.action.MAIN" android:targetClass="app activty" />
</com.sonymobile.settings.preference.IntentPreferenc e>
</com.sonymobile.settings.preference.PreferenceCateg ory>
And replace "string/honami_category2" with "string/honami_category3"

Photo :


 


=============

Another Related Guide ... you can try "How to add logo in About Phone" method .. and add logo to the section ...

See the Guide here : Press Me

IF you liked the Guide ... Hit thanks and share it between your friends ....
This is Awesome Mode will be in Honami Style V4 - Addons And many more
The Following 18 Users Say Thank You to abo hani For This Useful Post: [ Click to Expand ]
 
alkasser011
Old
#2  
alkasser011's Avatar
Member
Thanks Meter 24
Posts: 58
Join Date: Oct 2012
Location: Gaza
nice mate
keep it up
 
abo hani
Old
#3  
abo hani's Avatar
Recognized Contributor - OP
Thanks Meter 1,586
Posts: 971
Join Date: Jan 2013
Location: Latakia
Quote:
Originally Posted by alkasser011 View Post
nice mate
keep it up
Thanks bro ...
 
SammiSaysHello
Old
#4  
SammiSaysHello's Avatar
XDA Portal Team
Thanks Meter 1,563
Posts: 2,517
Join Date: Sep 2012
Location: Australia
Good job!

Some screenshots would be helpful for the visual learners out there
Want your work on the XDA Portal? Msg me

 
abo hani
Old
#5  
abo hani's Avatar
Recognized Contributor - OP
Thanks Meter 1,586
Posts: 971
Join Date: Jan 2013
Location: Latakia
Quote:
Originally Posted by SammiSaysHello View Post
Good job!

Some screenshots would be helpful for the visual learners out there
I will add some screenshots

Sent from my Xperia Acro S using Tapatalk
The Following User Says Thank You to abo hani For This Useful Post: [ Click to Expand ]
 
abo hani
Old
#6  
abo hani's Avatar
Recognized Contributor - OP
Thanks Meter 1,586
Posts: 971
Join Date: Jan 2013
Location: Latakia
Quote:
Originally Posted by SammiSaysHello View Post
Good job!

Some screenshots would be helpful for the visual learners out there


Added Bro
 
MT27i
Old
#7  
MT27i's Avatar
Senior Member
Thanks Meter 485
Posts: 225
Join Date: Feb 2014
Location: Brebes, Indonesia
Hey @abo hani, I'm following your guide.
Succesful, but my new section doesn't show anything (only blank section) :confused
Device : Sony Xperia Sola WHITE!
Kernel : Default
-------------------------------------------------------
Sorry for my English
 
abo hani
Old
#8  
abo hani's Avatar
Recognized Contributor - OP
Thanks Meter 1,586
Posts: 971
Join Date: Jan 2013
Location: Latakia
Quote:
Originally Posted by MT27i View Post
Hey @abo hani, I'm following your guide.
Succesful, but my new section doesn't show anything (only blank section) :confused
Send me screenshot of your settings_header.xml + section xml file

Sent from my Xperia Acro S using Tapatalk
 
Naufal Sidik
Old
#9  
Naufal Sidik's Avatar
Member
Thanks Meter 31
Posts: 80
Join Date: Jun 2014
Location: Bandung
Thanks for Helpful guide
My Device

 
Quote:
DEVICE : Sony Xperia M2 D2305
ROM : Stock ROM 18.3.A.0.31
VERSION : 4.4 Kitkat
KERNEL : Stock Kernel
BOOTLOADER : Unlocked
STATUS : Unrooted - Odex

My Works

 
abo hani
Old
#10  
abo hani's Avatar
Recognized Contributor - OP
Thanks Meter 1,586
Posts: 971
Join Date: Jan 2013
Location: Latakia
Quote:
Originally Posted by Naufal Sidik View Post
Thanks for Helpful guide
Welcome mate

Tags
add section in your settings, guide, how to edit settings.apk, mode your settings
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Make Your Calendar Widget Beautiful with Month

For some of us, summer vacation is alreadyover. For those getting ready to school, work, or … more

Integrate Social Networks Into Your Project With ASNE Library

Social network applications and services have developed into major parts ofour … more

Give Your Android Wear Device a Lock Screen with Lockable

Without a doubt,Android Wear is one of the most frequently talked abouttopics of … more

Forums Added for the LG G Watch R and Samsung Gear S

A little over a week ago, LG “inadvertently” let the world know about the … more