[Guide]Add Your Own Category To Settings - It's Different For Lollipop | Newbies Come - Sony Cross-Device Development Themes and Apps

Hello everyone, In Lollipop Settings things are different, we used to add key in Settings_Header.xml file and link it with our category.xml file, Now in Lollipop Settings, you need to make a smali file and do some other changes, in this guide i explain to you how.
I Will Only Explain How To Link Category Tab With Category Content, You Need To Know How To Make The Content ( Already Posted, No Need To Re-Post ) .​
What You Need :
Ability To Make In-Category Content .
PC.
Notes :
Smali File Name is up to you, Same for XML Section.
You Can Change Smali Path, You Can put it inside your own custom folder, or place it in other folder, it's up to you.
How-To :
Download Smali File From HERE.
Place your Category-Content XML File in res/xml folder .
Recompile Settings.
Sign It.
Decompile It.
Open Public.xml.
Search For Your Category_Content_XML_File_Name .
Open "Smali_File", Replace "0x22" with the hex code.
rename " Smali_File" to Your_Custom_Name.smali .
Create a new folder, name it "Your_Custom_Folder"
Copy the smali file to smali\com\android\settings\Your_Custom_Folder
Open the smali file again, replace "Your_Custom_Folder" with "Your_Custom_Folder" .
Replace "Your_Custom_Name" with "Smali_File"
Now,Navigate to res/values/strings.xml, Add the following, replace between >< with your text :
HTML:
<string name="your_string">Category Name</string>
Navigate to res/values/ids.xml, Add the following :
HTML:
<item type="id" name="your_id">false</item>
Finally, Open dashboard_settings.xml, add the code and change the values .
Open dashboard_categories.xml, located in res/xml folder.
Add This Line in the place you want, replace the
HTML:
<dashboard-tile android:icon="@drawable/your_icon" android:id="@id/your_id" android:title="@string/your_string" android:fragment="com.android.settings.your_category_folder.Your_Custom_Name" />
Don't Forgot to make your own Category icon, "your_icon", place it in drawable/yourdpi folder.​
Examples :
Smali File Name : iamcategory.smali .
Custom Folder Name : myromsettings .
Drawable Name : custom_settings.png .
String : custom_settings_string .
ID : custom_settings_id .
Dashboard_categories code :
HTML:
<dashboard-tile android:icon="@drawable/custom_settings" android:id="@id/custom_settings_id " android:title="@string/custom_settings_string " android:fragment="com.android.settings.myromsettings .iamcategory" />
Example So you can understand, if it's hard to you, Don't forget the thanks .​

androidexpert35 said:
Great as usual mate thank you!! I now used this guide to add my own menu into my ROM
Inviato dal mio Xperia Z utilizzando Tapatalk
Click to expand...
Click to collapse
@abo hani its very useful
thanks a lot

Great Guide from Master Abo Hanni:good:

gamzekal said:
Great Guide from Master Abo Hanni:good:
Click to expand...
Click to collapse
Hamidreza2010 said:
@abo hani its very useful
thanks a lot
Click to expand...
Click to collapse
androidexpert35 said:
Great as usual mate thank you!! I now used this guide to add my own menu into my ROM
Inviato dal mio Xperia Z utilizzando Tapatalk
Click to expand...
Click to collapse
Thanks guys!

@abo hani , nice
But something miss , Still settings app can't add these new entries in Search
Can you find how to add new categories in search entries ?

wolfmannight said:
@abo hani , nice
But something miss , Still settings app can't add these new entries in Search
Can you find how to add new categories in search entries ?
Click to expand...
Click to collapse
Search use the strings i guess, So what's the problem ? when using the search in Settings you can't find your category ?

abo hani said:
Search use the strings i guess, So what's the problem ? when using the search in Settings you can't find your category ?
Click to expand...
Click to collapse
Yup can't find category and its sub-category (those we added newly)

wolfmannight said:
Yup can't find category and its sub-category (those we added newly)
Click to expand...
Click to collapse
Here's the solution
Add this arrays.xml
HTML:
<array name="custom_category_settings_activity"><item>intent:#Intent;action=android.intent.action.MAIN;launchFlags=0x4000000;component=smalifolder/.SmaliName;end</item>
<item>@array/search_in_settings_customcategory</item>
<item>false</item>
</array>
HTML:
<string-array name="search_in_settings_customcategory">
<item>@string/your_category_string</item>
</string-array>
In First HTML, replace smalifolder with the smali file path, ex : com.android.settings.customfolder, and SmaliName with your smali file name .
In Second HTML, Replace "search_in_settings_customcategory" only replace customcategory with your category name, replace "custom_category_settings_activity" only replace "custom_category" with your custom category name.
Replace the strings with your Category & Sub-Category Strings like Main Section, App String, Sub-Menu String ..etc
Now you can search.

abo hani said:
Here's the solution
Add this arrays.xml
HTML:
<array name="custom_category_settings_activity"><item>intent:#Intent;action=android.intent.action.MAIN;launchFlags=0x4000000;component=smalifolder/.SmaliName;end</item>
<item>@array/search_in_settings_customcategory</item>
<item>false</item>
</array>
HTML:
<string-array name="search_in_settings_customcategory">
<item>@string/your_category_string</item>
</string-array>
In First HTML, replace smalifolder with the smali file path, ex : com.android.settings.customfolder, and SmaliName with your smali file name .
In Second HTML, Replace "search_in_settings_customcategory" only replace customcategory with your category name, replace "custom_category_settings_activity" only replace "custom_category" with your custom category name.
Replace the strings with your Category & Sub-Category Strings like Main Section, App String, Sub-Menu String ..etc
Now you can search.
Click to expand...
Click to collapse
@abo hani you are awesomeeeee , Thanks

wolfmannight said:
@abo hani you are awesomeeeee , Thanks
Click to expand...
Click to collapse
Welcome bro ?
Sent from my C6903 using Tapatalk

wolfmannight said:
@abo hani you are awesomeeeee , Thanks
Click to expand...
Click to collapse
Forgot one thing, You need to add the main array, There are 2 arrays to add .. right ?
One with String, the other with smali .. the smali one is the main, copy the array name and search for "search_in_settings_activity_list"
Below that add your array like the provided ones.

yup

Bro your SUPER AWESOME! Worked well

@abo hani
I Will Only Explain How To Link Category Tab With Category Content, You Need To Know How To Make The Content ( Already Posted, No Need To Re-Post ) .
Click to expand...
Click to collapse
i will try to make my own category under settings.
can you give me the link of the post you explained how to make a Category Content file?
Thx

moonryder said:
@abo hani
i will try to make my own category under settings.
can you give me the link of the post you explained how to make a Category Content file?
Thx
Click to expand...
Click to collapse
There's a new guide : http://forum.xda-developers.com/che...-permanent-t3253326/post63923793#post63923793

Hello, can teach how to make the settings as well as in the Annex? Thank you

Marília de Oliveira said:
Hello, can teach how to make the settings as well as in the Annex? Thank you
Click to expand...
Click to collapse
Can you upload the Settings ?

abo hani said:
Can you upload the Settings ?
Click to expand...
Click to collapse
wow, Yes, attached.
Settings.apk >> Download
My phone and a compact Xperia Z3. lollipop 5.1.1.

Sorry but I did not understand this part
>> Place your Category-Content XML File in res/xml folder <<

Marília de Oliveira said:
Sorry but I did not understand this part
>> Place your Category-Content XML File in res/xml folder <<
Click to expand...
Click to collapse
Check the guide : http://forum.xda-developers.com/showthread.php?t=2184207
And you will understand .

Related

[Q] Themes & Roms Developers i need your help plz

Hi everyone
sorry for posting the same theard twice
I posted my question here couz it is not a normal question
I have xperia arc 2.3.4 rooted
I am trying to make my own theme and here is what i done
1- i copied the framework-res.apk from my system
2- i decompile it useing Apktool last version
3- i changed a lot of pictures inside it with the same name and type (.png all)
4- i edit a xml file by adding more lines ( the battery xml )
5- i complied it useing apktool without any problems
6- i signed it with apksign without any problems
7- i replaced it with the one in my system with root explorer and it forcedclose and then i restart the phone
The phone booted to the locke screen and it was new with my new pictures and the new battery also was new with my pictures
But when i unlock the phone and type the pin code EVERY THING FORCED CLOSE ! And the phone rebooted with the same problem
Now what the f... I did wrong what is the problem ? I have been working all day on it with a big fail !!!!!!! Plz help plz plz
Are the permissions correct?
sinkster©
sinkster said:
Are the permissions correct?
sinkster©
Click to expand...
Click to collapse
yes
Mr.Smile said:
4- i edit a xml file by adding more lines ( the battery xml )
6- i signed it with apksign without any problems
Click to expand...
Click to collapse
Those are your problems right there...
Firstly, you cannot add anything to an apk, without adding a unique id in public.xml.
Secondly, you don't need to sign system apps.
iridaki said:
Those are your problems right there...
Firstly, you cannot add anything to an apk, without adding a unique id in public.xml.
Secondly, you don't need to sign system apps.
Click to expand...
Click to collapse
So what to do now ? How i maked work
i have used winrar to replace images and it work but without replaceing the xml
for xml i decompiled the file and edit the xml by adding few lines then i compile it and took the xml from it to the file i edit with winrar but it does't work i think the problem that i have edit the xml but did't add a unique id in public.xml couz i don't know how to do it
Mr.Smile said:
for xml i decompiled the file and edit the xml by adding few lines then i compile it and took the xml from it to the file i edit with winrar but it does't work i think the problem that i have edit the xml but did't add a unique id in public.xml couz i don't know how to do it
Click to expand...
Click to collapse
You need to count in hex and add the new drawables, being careful not to have duplicate ids.
Also you need to edit the battery display and animation files so that the new images are used.
I recommend UOT Kitchen if you are not that experienced.
iR¡[email protected]!* via Tapatalk 2

[Q] Problem with adding keyboard.

Hi !
i'm trying to add a keyboard to S8500XXLD2 . i do every thing but there is no "ImeReg.ini" !!!! i'm also notice that this FW have less *.ini file .
what should i do now?
Take it from other firmware.And Also not forget to change
OpEuroIme and SettingLanguage
still nothing ! (
i get "ImeReg.ini" , "OpAsiaIm" , "OpAsiaImSetting" and "SettingLanguage" from elite V4.0 and delete OpEuroIm(etc.) when i use these 4 files with elite Strings everything is good. but when i delete some language from Strings and edit the OpAsiaIm(etc.) a problem shows up: there is NO keyboard in message or anywhere else !
in OpAsiaIm & Setting(After editing) :
Code:
#OpAsiaIME
Auto_capitaliztion=0
Auto_period=0
EDITAREA_INPUT_TYPE=7
EDITAREA_INPUT_MODE=0
EDIT_TRACE_MODE=0
Voice_input=1
Voice_lang_id=1
Current_language_id=1
#Supported Languages
Lang0=1
Lang2=43
Lang_count=2
#Selected Languages
Lang0=1
Lang2=43
Lang_count=2
in SettingLanguage:
Code:
#Version
Version=1
#TextList
Lang0=ENGLISH
Lang1=FARSI
Count=2
#T9List
Lang0=ENGLISH
Lang1=FARSI
Count=2
#T9UserList
Lang0=ENGLISH
Lang1=FARSI
Count=2
in ImeReg:
Code:
#Framework Version
Framework_Ver=1.0
#IM_Count
IM_Count=1
#IM_Profile_1
Default_Flag=1
Activate_Flag=1
Selected_flag=1
IM_Framework_Ver=1.0
IM_Ver=1.0
IM_Name=Samsung keyboard
IM_Lib_Name=OpAsiaIME
Support_Lang=kr_KR:en_US
Setting_Cfg_File=OpAsiaIME.ini
Setting_Lib_Name=OpAsiaIMESetting
Because XXLD2 has no OpAsia.so and OpAsiaSetting.so
Well
This explains everything
Add those files and your CFW will be fine
Best Regards
hero355 said:
Because XXLD2 has no OpAsia.so and OpAsiaSetting.so
Click to expand...
Click to collapse
mylove90 said:
Well
This explains everything
Add those files and your CFW will be fine
Best Regards
Click to expand...
Click to collapse
i add these files before !
Don't know if this is necessary or not
But did you edit GeneralSoInfo.so.sig ??
It is in /SystemFS/Shp/data
You need to add/replace signatures of Asian files
Best Regards
mylove90 said:
Don't know if this is necessary or not
But did you edit GeneralSoInfo.so.sig ??
It is in /SystemFS/Shp/data
You need to add/replace signatures of Asian files
Best Regards
Click to expand...
Click to collapse
Yes ! i do this too!
I offer you to base your CFW on JVLC2.in This firmware you don't need opAsia.so or opAsiaSetting.so
You need to change Lang packs and OpAsiaIme and Settinglanguage file
hero355 said:
I offer you to base your CFW on JVLC2.in This firmware you don't need opAsia.so or opAsiaSetting.so
You need to change Lang packs and OpAsiaIme and Settinglanguage file
Click to expand...
Click to collapse
is there any solution ?
i don't want to change my base.
as i said before there is no problem when i use original elite files but when i delete some language and edit those files i get some error.

Question about ICS decompilation

Hi everyone,
I will like to know when you decompile ics apk especially systemui ,do you get in public.xml some resources id as : apktool dummy ?
If yes what does at means? It appears to me on some drawable and string id,so how should I know with id correspond to drawable ?
Thanks in advance
zozor said:
Hi everyone,
I will like to know when you decompile ics apk especially systemui ,do you get in public.xml some resources id as : apktool dummy ?
If yes what does at means? It appears to me on some drawable and string id,so how should I know with id correspond to drawable ?
Thanks in advance
Click to expand...
Click to collapse
ignore the apktool dummy stuff, just treat them like any other existing resources
Okay ,another question if an id with ''APKTOOL_DUMMY'' is involve in smali,how should I know what specific object is to perform editing ?
workaround ?
maybe I should really ignore some of them.

[Q] Problem with Strings (unusual problem)

Hello everybody!...
First than nothing, sorry for my english, but I'll try to be clear...
I have Xperia Play with this ROM:
http://forum.xda-developers.com/showthread.php?t=2286648
Very nice, very stable, very fast ... BUT, the string in contacts (And album) is weird...
See attached file...
this is very strange xD...
"Phone" is "Disable Cameras"
"Home" is "Prevent....."
How can I change that names?
I need to edit ROM?
Thanks for your time!
Kamihacker said:
Hello everybody!...
First than nothing, sorry for my english, but I'll try to be clear...
I have Xperia Play with this ROM:
http://forum.xda-developers.com/showthread.php?t=2286648
Very nice, very stable, very fast ... BUT, the string in contacts (And album) is weird...
See attached file...
this is very strange xD...
"Phone" is "Disable Cameras"
"Home" is "Prevent....."
How can I change that names?
I need to edit ROM?
Thanks for your time!
Click to expand...
Click to collapse
If yoy want to change it you must find proper lines at strings.xml and edit them. This is known problem which is caused by touchpad fix (i think).
Jecmenn said:
If yoy want to change it you must find proper lines at strings.xml and edit them. This is known problem which is caused by touchpad fix (i think).
Click to expand...
Click to collapse
Thanks for your answer . ..
But I have a question, where I can find the file strings.xml?
Thanks for your help and your time!
EDIT: I found a solutions, I edited XML Strings from framework-res.apk AND ALL IS OK!!! .. Thanks!!!

[GUIDE] Remove or Change "Swipe Screen to Unlock text" - Gingerbread

This is just simple guide
Requirements:
framework-res.apk
Step:
In here i will not explain how to decompile and recompile apk
First; you have to decompile your framework-apk
Second; open \framework-res\res\values-in\strings.xml
Note; why "values-in" because i'm using Indonesian language. if you're using another language, just change "values-in" with your language.
Click to expand...
Click to collapse
Third; find "lockscreen_unlock_guide_text"
Fourth; remove or change "Usap layar untuk membuka kunci"
"Usap layar untuk membuka kunci" in english "Swipe Screen to Unlock"
Click to expand...
Click to collapse
Fifth; if you're done, now recompile your framework-res.apk
After step fifth, now go to this site uot.dakra.lt/kitchen
First; select tab file upload, in this step you need to match with your smartphone.
Second; select upload system files, and select framework-res.apk who have edited
Third; now select tab summary and then click Submit work to kitchen, wait for kitchen. Dont forget your order number
Fourth; your flashable.zip will be show in "Your recently cooked files", and download it!
Finally; place your UOT-blabla.zip to sdcard, and flash it via CWM.
TESTED on Galaxy Y
Screenshot in Attachments​
Unsuccessful
MrPhamHpGYC said:
Unsuccessful
Click to expand...
Click to collapse
where your problem sir?
Nice tut :fingers-crossed:
Nice guide.

Categories

Resources