Google Play Newsstand 3.3 Brings Material Design Makeover

In a clear break from the previous practice of delivering nearly weekly Google … more

App Review: Calculating Your Android Calculator Options

Sure, everyone has a default Calculator and its something that you dont think about … more

MultiROM Once Again Available for the Galaxy S4

Multiboot, or the ability to select betweenmultiple operating systems on a single device at … more

Build an Impractical But Awesome Lego Mindstorm Dock

The vast majority of what we cover here on the XDA-Developers News Portal relates to … more
Post Reply

[GUIDE][HOW] Add Battery Percentage On Lockscreen Permanently

2nd August 2014, 01:55 PM   |  #1  
OP Senior Member
Flag hamirpur h.p
Thanks Meter: 60
 
149 posts
Join Date:Joined: Dec 2013
More
Here's A New Guide To Add Battery Percentage On Lockscreen

By Me [Kartik Verma]


Requirements -:


1. android.policy.jar

2. framework-res.apk


PHP Code:
First,We Edit "framework-res.apk"  present here (system/framework/framework-res.apk)

Decompile framework-res.apk Through Apktool (if you dont know how to decompile,See on XDA How to Decompile,Recompile Or Ask Someone)

After Decompiling -> Go Here 
framework-res/res/values/string.xml

PHP Code:
Open String.xml in Notepad++

After Opening -> Hit These Two Keys (ctrl+f)

And 
Copy This____  Charging  ____  Then Hit Enter

Change The Charging Text To____  Charge Status _____ 
-> After Changing -> Save it

Now,Main Work Here in Smali

PHP Code:
Decompile "android.policy.jar" present here (system/framework/android.policy.jar)

After Decompiling -> Open This smali file Through Notepad++

android.policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.smali

Open   KeyguardUpdateMonitor
.smali

Search 
For This Line Through Notepad++ By Hitting Ctrl+
PHP Code:
.method public shouldShowBatteryInfo()
The Whole Code Looks Like....


PHP Code:
.method public shouldShowBatteryInfo()Z
    
.registers 2

    
.prologue
    
.line 1000
    sget v0
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryInfoState:I

    
if-eqz v0, :cond_6

    
const/4 v00x1

    
:goto_5
    
return v0

    
:cond_6
    
const/4 v00x0

    
goto :goto_5
.end method 

After Editing It Looks Like....

PHP Code:
.method public shouldShowBatteryInfo()Z
    
.registers 2

    
.prologue
    
.line 1000
    sget v0
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryInfoState:I

    
if-eqz v0, :cond_6

    
const/4 v00x1

    
:goto_5
    
    
const/4 v00x1
    
    
return v0

    
:cond_6
    
const/4 v00x0

    
goto :goto_5
.end method 

ENJOY.......!!!!!!!!!!
Last edited by kartik verma; 2nd August 2014 at 01:57 PM.
The Following 3 Users Say Thank You to kartik verma For This Useful Post: [ View ]
3rd August 2014, 05:45 AM   |  #2  
Member
Thanks Meter: 13
 
58 posts
Join Date:Joined: Mar 2013
Thanks Dude , its working 100%
Attached Thumbnails
Click image for larger version

Name:	SC20140802-074131.png
Views:	239
Size:	116.5 KB
ID:	2881574  
3rd August 2014, 05:57 AM   |  #3  
OP Senior Member
Flag hamirpur h.p
Thanks Meter: 60
 
149 posts
Join Date:Joined: Dec 2013
More
Quote:
Originally Posted by ZindaqI

Thanks Dude , its working 100%

Adding more stuffs after some tym.
3rd August 2014, 03:28 PM   |  #4  
Member
Thanks Meter: 13
 
58 posts
Join Date:Joined: Mar 2013
Quote:
Originally Posted by kartik verma

Adding more stuffs after some tym.

you can change charge icon to battery icon .. also you can make lockscreen transparent
3rd August 2014, 03:46 PM   |  #5  
OP Senior Member
Flag hamirpur h.p
Thanks Meter: 60
 
149 posts
Join Date:Joined: Dec 2013
More
Quote:
Originally Posted by ZindaqI

you can change charge icon to battery icon .. also you can make lockscreen transparent

sorry sir , but i know all about these things.
5th August 2014, 03:01 AM   |  #6  
tjbearX's Avatar
Senior Member
Flag Balanga, Bataan Philippines
Thanks Meter: 401
 
395 posts
Join Date:Joined: Dec 2012
More
Thumbs up
nice guide bro. keep it up the good work
10th August 2014, 10:10 AM   |  #7  
jasper~'s Avatar
Senior Member
Flag Laguna
Thanks Meter: 6
 
123 posts
Join Date:Joined: May 2014
More
Quote:
Originally Posted by kartik verma

[COLOR="Blue"][SIZE="5"]

PHP Code:
First,We Edit "framework-res.apk"  present here (system/framework/framework-res.apk)

Decompile framework-res.apk Through Apktool (if you dont know how to decompile,See on XDA How to Decompile,Recompile Or Ask Someone)

After Decompiling -> Go Here 
framework-res/res/values/string.xml

PHP Code:
Open String.xml in Notepad++

After Opening -> Hit These Two Keys (ctrl+f)

And 
Copy This____  Charging  ____  Then Hit Enter

Change The Charging Text To____  Charge Status _____ 
-> After Changing -> Save it

I didnt Get this mate. Can you explain?
10th August 2014, 10:54 AM   |  #8  
OP Senior Member
Flag hamirpur h.p
Thanks Meter: 60
 
149 posts
Join Date:Joined: Dec 2013
More
Quote:
Originally Posted by jasper~

I didnt Get this mate. Can you explain?

decompile framework-res.apk , open string.xml present in values folder (framework-res/res/values/string.xml)

open it with notepad++ after this Hit 2 button ctrl+f and than type the text "charging" only charging and than hit enter u see an xml line contain charging text change it to "Charge Status"

dont use inverted commas " " there i just use it for highlighting the things
The Following User Says Thank You to kartik verma For This Useful Post: [ View ]
10th August 2014, 03:40 PM   |  #9  
jasper~'s Avatar
Senior Member
Flag Laguna
Thanks Meter: 6
 
123 posts
Join Date:Joined: May 2014
More
Quote:
Originally Posted by kartik verma

decompile framework-res.apk , open string.xml present in values folder (framework-res/res/values/string.xml)

open it with notepad++ after this Hit 2 button ctrl+f and than type the text "charging" only charging and than hit enter u see an xml line contain charging text change it to "Charge Status"

dont use inverted commas " " there i just use it for highlighting the things

Oh thanks bro. I have 1 question, is the battery percent still there when I charge my phone?
10th August 2014, 04:56 PM   |  #10  
OP Senior Member
Flag hamirpur h.p
Thanks Meter: 60
 
149 posts
Join Date:Joined: Dec 2013
More
Quote:
Originally Posted by jasper~

Oh thanks bro. I have 1 question, is the battery percent still there when I charge my phone?

it always on your device lockscreen ,if u charge ur device or if not.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Galaxy Y Duos S6102 Android Development by ThreadRank