Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
View Poll Results: Was it Helpful?
Yes! 25 92.59%
No. 2 7.41%
Voters: 27. You may not vote on this poll

Post Reply

[Tutorial] Adding new Activity Header/Sub Menu to Settings.apk

OP Madaditya

30th September 2014, 01:23 PM   |  #41  
Madaditya's Avatar
OP Recognized Themer
Flag No where
Thanks Meter: 1,027
 
957 posts
Join Date:Joined: Jul 2012
More
Quote:
Originally Posted by Murali dharan

Logcat of my settings when choosing my header "murezhi"

Smali error? Check your smali file and make sure u made an entry in ids.xml
30th September 2014, 01:53 PM   |  #42  
Murali dharan's Avatar
Member
Thanks Meter: 2
 
40 posts
Join Date:Joined: Jun 2014
More
Quote:
Originally Posted by Madaditya

Smali error? Check your smali file and make sure u made an entry in ids.xml

I made id in ids... Here is my smali file(change txt to smali)
Also in public xml..
Ps: Adding apps in settings_header.xml also shows error (unbound prefix)
Attached Files
File Type: txt Murezhi.txt - [Click for QR Code] (897 Bytes, 17 views)
Last edited by Murali dharan; 30th September 2014 at 02:00 PM.
2nd November 2014, 06:40 AM   |  #43  
Md.Shafikul.islam's Avatar
Member
Flag Narayanganj,Dhaka
Thanks Meter: 28
 
58 posts
Join Date:Joined: Jul 2014
Donate to Me
More
Facing problem in adding apps in submenu...
Hello Sir... @Madaditya
I am mtk user...
I am following your guide and successfully add submenu...But i cant add app in submenu...
I tried my best to solve this problem...but failed...Can you help me Sir?!!
Here is my created Xml...Please have a look and give me solution...

Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/cayno_settings_customization"
  xmlns:android="http://schemas.android.com/apk/res/android">
  xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
    <PreferenceCategory android:title="@string/cayno_settings_customizations" android:key="tools_category" />
    <com.android.settings.IconPreferenceScreen android:title="@string/cayno_title" android:icon="@drawable/ic_settings_cayno" android:key="light_effects" android:key="cayno_x" android:summary="@string/cayno_summary">
        <intent android:targetPackage="com.adhi.quantum" android:action="android.intent.action.MAIN" android:targetClass="com.adhi.quantum.activities.UserInterface" />
    </com.android.settings.IconPreferenceScreen>
</PreferenceScreen>
Edit:Sorry Sir Problem Fixed... Here the new xml which i created... Thanks a lot for this awesome guide... :*
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2014-11-02-16-49-04.png
Views:	203
Size:	31.6 KB
ID:	2995539  
Attached Files
File Type: zip cayno_s_customization.xml.zip - [Click for QR Code] (446 Bytes, 4 views)
Last edited by Md.Shafikul.islam; 2nd November 2014 at 12:31 PM. Reason: Got the solution.
16th December 2014, 09:52 PM   |  #44  
_MutantX_'s Avatar
Senior Member
Flag Troyes
Thanks Meter: 125
 
134 posts
Join Date:Joined: Feb 2014
More
Hello,

I followed carefully well all the procedure, but I obtain every time an error during the recompilation.

Can you help me?
Attached Thumbnails
Click image for larger version

Name:	error smali.png
Views:	208
Size:	70.3 KB
ID:	3067601  
The Following User Says Thank You to _MutantX_ For This Useful Post: [ View ]
17th December 2014, 12:10 PM   |  #45  
milocj's Avatar
Senior Member
Flag Valencia
Thanks Meter: 204
 
252 posts
Join Date:Joined: Nov 2012
More
Nice guide, great work!
@milocj by devSXSTeam
17th December 2014, 12:15 PM   |  #46  
_MutantX_'s Avatar
Senior Member
Flag Troyes
Thanks Meter: 125
 
134 posts
Join Date:Joined: Feb 2014
More
Hello,

I found how to modify the error.

Code:
.class public Lcom/android/settings/Cpu;
.super Lcom/android/settings/SettingsPreferenceFragment;
.source "Cpu.java"


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 17
    invoke-direct {p0}, Lcom/android/settings/SettingsPreferenceFragment;-><init>()V

    return-void
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 1
    .param p1, "savedInstanceState"    # Landroid/os/Bundle;

    .prologue
    .line 21
    invoke-super {p0, p1}, Lcom/android/settings/SettingsPreferenceFragment;->onCreate(Landroid/os/Bundle;)V

    .line 23
    const v0, 0x7f050065

    invoke-virtual {p0, v0}, Lcom/android/settings/Cpu;->addPreferencesFromResource(I)V

    .line 24
    return-void
.end method

Thank you again for the guide
The Following 3 Users Say Thank You to _MutantX_ For This Useful Post: [ View ]
25th December 2014, 10:24 PM   |  #47  
samadipoor2's Avatar
Member
Flag Sabzevar
Thanks Meter: 73
 
74 posts
Join Date:Joined: Dec 2012
More
hi dear @Madaditya
i just done everything you said
but i get FC
even i Tried to use About Phone Xml
but i get FC
what Shoud i Do?
the sub menu is not app!!!

ps: i think the problem is here!!!

Quote:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.SubSettings}: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.android.settings.acco: make sure class name exists, is public, and has an empty constructor that is public

and here is full logcat:
https://docs.google.com/file/d/0Bx8D...RFYTVxZ28/edit



edit: Problem solved and it work Perfect
thanks for your TUT
Last edited by samadipoor2; 25th December 2014 at 11:24 PM.
27th December 2014, 03:04 AM   |  #48  
Naufal Sidik's Avatar
Senior Member
Flag Bandung
Thanks Meter: 57
 
102 posts
Join Date:Joined: Jun 2014
More
Can anyone solve this?

..\3-Out\Settings.apk\smali\com\android\settings\Siruz. smali[21,4] Error for input '.parameter': Invalid directive
..\3-Out\Settings.apk\smali\com\android\settings\Siruz. smali[21,15] mismatched input '"savedInstanceState"' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/settings/Siruz.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuil der.java:72)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder. java:56)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder. java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib. java:342)
at brut.androlib.Androlib.buildSources(Androlib.java: 303)
at brut.androlib.Androlib.build(Androlib.java:289)
at brut.androlib.Androlib.build(Androlib.java:262)
at brut.apktool.Main.cmdBuild(Main.java:236)
at brut.apktool.Main.main(Main.java:88)

Thanks
27th December 2014, 03:49 PM   |  #49  
samadipoor2's Avatar
Member
Flag Sabzevar
Thanks Meter: 73
 
74 posts
Join Date:Joined: Dec 2012
More
Quote:
Originally Posted by Naufal Sidik

Can anyone solve this?

..\3-Out\Settings.apk\smali\com\android\settings\Siruz. smali[21,4] Error for input '.parameter': Invalid directive
..\3-Out\Settings.apk\smali\com\android\settings\Siruz. smali[21,15] mismatched input '"savedInstanceState"' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/settings/Siruz.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuil der.java:72)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder. java:56)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder. java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib. java:342)
at brut.androlib.Androlib.buildSources(Androlib.java: 303)
at brut.androlib.Androlib.build(Androlib.java:289)
at brut.androlib.Androlib.build(Androlib.java:262)
at brut.apktool.Main.cmdBuild(Main.java:236)
at brut.apktool.Main.main(Main.java:88)

Thanks

use post 46

Post Reply Subscribe to Thread

Tags
add, edit, header, settings.apk
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes