yashsingh1/xdaforums huggingface dataset:
[Android General] Ticklefish:
Sometimes the answer to that question is just "because it's there". A trite answer but true. Sometimes we mod when we could achieve the same results without messing about with code. Some of the mods I put on my phone I could achieve with Xposed but there's something so...satisfying...about doing it myself.

But that's just me. I'm weird that way.

A more practical answer could be that modding can sometimes give you more control. Looking at the two apps mentioned, they both put the traffic information on the status bar by using overlays. Personally I'd want the information next to the WiFi and signal icons, and to move dynamically. So the location changes according to whether I have the WiFi on or not.

To be fair I haven't tried the apps yet and I could be completely wrong. Maybe they can allow for this and I'm going to look like a prat. But, if I'm right, it proves my point. Modding takes longer but it can give you more flexibility.

It's nice to have the option to do both though.

Oh, as for risk, there isn't any. If you have a custom recovery and you know what you're doing, you can easily fix any FC's this will give you.
[Android General] Sinistertensai:
been at this for a bit, adding to htc sense settings on nougat, ive isolated it down to the method and line.(tfg for logcat lol) im a little rusty at this and all the errors that cause activity of mod force close. (I see the panel to tap for mod, cant launch its settings) heres the method and my log cat. any tips or pointers?

NetworkTraffic.smali trimmed it down lin 71= Const/v4 v3, 0x0

.method private NetworkTrafficColorReset()V
.locals 5

.prologue
const/4 v4, -0x1

.line 177
invoke-virtual {p0}, Lcom/android/settings/temasek/NetworkTraffic;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

const-string v2, "network_traffic_color"

invoke-static {v1, v2, v4}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

.line 180
iget-object v1, p0, Lcom/android/settings/temasek/NetworkTraffic;->mNetTrafficColor:Lnet/margaritov/preference/colorpicker/ColorPickerPreference;

invoke-virtual {v1, v4}, Lnet/margaritov/preference/colorpicker/ColorPickerPreference;->setNewPreviewColor(I)V

.line 181
const-string v1, "#%08x"

const/4 v2, 0x1

new-array v2, v2, [Ljava/lang/Object;

const/4 v3, 0x0

invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

move-result-object v4

aput-object v4, v2, v3

invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

move-result-object v0

.line 182
.local v0, "hexColor":Ljava/lang/String;
iget-object v1, p0, Lcom/android/settings/temasek/NetworkTraffic;->mNetTrafficColor:Lnet/margaritov/preference/colorpicker/ColorPickerPreference;

invoke-virtual {v1, v0}, Lnet/margaritov/preference/colorpicker/ColorPickerPreference;->setSummary(Ljava/lang/CharSequence;)V

.line 183
return-void
.end method

Logcat

E/AndroidRuntime( 5943): at com.android.settings.temasek.NetworkTraffic.onCreate(NetworkTraffic.java:71)
E/AndroidRuntime(10109): at com.android.settings.temasek.NetworkTraffic.onCreate(NetworkTraffic.java:71)
D/SubSettings(12130): Launching fragment com.android.settings.temasek.NetworkTraffic
E/AndroidRuntime(12130): at com.android.settings.temasek.NetworkTraffic.onCreate(NetworkTraffic.java:71)
[Android General] JT1510365:
hey morning star thanks for sharing this awesome mod it works great on my tab 4 but i have a little problem i want the traffic indicator to be next to the ringer silent icon as shown in the first pic and where its next to the location icon in the other pic where would i put that line code specifically in the status bar xml i have attached my status bar xml and the pics i dont want it on the far left but anyways i hope you can help me your awesome:)

please see both pics too so you know what im talking about:)

View attachment 4213955

View attachment 4213957

Edit: Never mind i found out how to fix it and i got it fixed:):)
[Android General] arvindgr:
Hi [MENTION=293887]Morningstar[/MENTION], Thanks a ton for this mod. I badly wish to see this in all my phones but since its not that easy to implement same in various devices, How about implementing the same via Magisk module?

Anyway Thanks a ton for mod, Shall try out in near future..
[Android General] arvindgr:
This Status Bar Network Traffic (Separate In/Out) - is simply most accurate and keeps displaying activity of all networks, even on WiFi hotspots or USB Tethering. It doesn't also get killed by battery saver apps/does not take up any active memory -RAM..

And another important personal reason is, I always want my Notification space to be tidy and I never put any Persistent notification there. Is there anyway to achieve this with normal play store apps?
[Android General] dahawthorne:
Network Mini has a "hide when inactive" option. It occasionally flicks on to show zero in/out, but generally if there's no traffic the notification bar is clear. Give it a try.

One thing that I've noticed is that it reports rates that I don't believe my line supports (e.g. 13MB down when my line is nominally 7.5MB max), and I think that this is because I use an always-on VPN, so it's counting both the "normal" throughput and the VPN throughput. I saw the same on my laptop monitor graph, but that allows me to specify the specific adaptor to measure - Network Mini doesn't seem to have that option, but I'm not particularly bothered, since all I want is to know that my network is actually doing something rather than just spinning its wheels... :)

Ha... before I even post this, you've prompted me to look in the settings, and there actually is such an option - if you're using a VPN, divide the throughput by 2 to get a more accurate figure.

So thanks to you for prompting me... :)
[Android General] arvindgr:
Lol, Its ok..,

Still Hide when inactive doesn't reliably work like Mod. This is exactly like a 3rd party Torch app vs In built Torch QS. Also I hate to see it during games/youtube/videos. Manually adding them to ignore isn't quite convenient...
[Android General] ChandanC29:
Help

This is so hard and risky, please a Video tutorial for this. You can earn from YouTube also :D
[Android General] Droidtricks:
you can YouTube paras guglani ,he has made a video on this. Thanks
[Android General] Andry.dlv:
hey can you help me with my logs :D has done editing with my systemui but then i recompile your zip with my setting.apk got error , how should i do ?

ROM : Linage OS 14.1

OS : 7.x

thanks before ,sorry for my english :D
[Android General] edzamber:
Its simple, you have same strings twice times in your res/values/strings.xml.

Remove doubles and it will recompil correctly...
[Android General] Andry.dlv:
let me try first, thanks sir ;)
[Android General] Andry.dlv:
Nice guide sir :good:

finally I've finished it all, but when I open in the settings settings settings.apk I suddenly stopped. I'm confused to continue and what I should do next to fix it.

thanks in advance and sorry for my english. :)
[Android General] edzamber:
Do a adb logcat with :

adb logcat -v long >settings.txt

Then search for Fatal Exeption in settings.txt with notepad ++ and send results here please.

Adb logcat :

https://xdaforums.com/showthread.php?t=1726238
[Android General] Andry.dlv:
here is my logs , is there really an error in the line color preference XML?
[Android General] edzamber:
Did you recompil and decompil again your new settings.apk to match public ids in colorpicker.smali as its metionned in op ? You need to match your ids, not copy/past ids from guide ...
[Android General] Andry.dlv:
once again thanks for your answer sir.

if you mean to match "ColorPickerDialog.smali" from the guide to "Public Id's" I already do, then when I try to find my word log error in the search engine that is

" 1. Caused by: android.view.InflateException: Binary XML file line # 6: Error inflating class net.margaritov.preference.colorpicker.ColorPickerPreference"

" 2. Caused by: java.lang.ClassCastException: net.margaritov.preference.colorpicker.ColorPickerPreference can not be cast to android.support.v7.preference.Preference"

do I need to change the ColorPickerPreference smali from the guide above? then if i have to change it may i ask a guide for it .

thanks .
[Android General] edzamber:
Well it seems that ColorPickerPreference.smali is out to date with your Android version... Maybe dev need to update it or if you know how to to build Romcontrol, try this mod

https://xdaforums.com/showpost.php?p=68067070&postcount=8634

And add on

https://xdaforums.com/showpost.php?p=68153786&postcount=8902

Romcontrol

https://xdaforums.com/android/general/source-code-6thgear-romcontrol-v2-devs-t3411916
[Android General] Andry.dlv:
I am very grateful for your answer sir, your answer is very helpful. yes i am looking at it right now.

thank you very much Mr.edzamber: D
[Android General] arvindgr:
Just asking, it is possible to make a Magisk module for the same?..
[Android General] bcrichster:
Xposed already has this with the Gravitybox.apk...

Running some Xper!meπts from my Moto E (4) Plus
[Android General] Aeti:
Hi, before I go on to follow the tut, wondering the following: can this be done by pulling SystemUI and Settings onto PC or do you absolutely have to do this "live" on a Android? Also, does this mean that you have to be performing a live surgery on both apks? (copy SystemUI SD card, decompile, modify, compile, copypaste back to system (replacing old SystemUI), copy back to SD card, decompile, modify, compile, paste it back to System - am I getting this right?)
[Android General] dahawthorne:
https://xdaforums.com/showpost.php?p=72218579&postcount=231
[Android General] Tulsadiver:
All of it is done on a PC....
[Android General] ozzyboy:
Can be founded this app like apk file? I need apk because I don't have a custom recovery and I don't know how to install zip file without custom recovery.
[Android General] uncinogb:
NOte 4 marshmalow Samsung TW

Hi, this mod is exactly what I have been looking for. Do you know if it works on a Samsung Galaxy Note 4 N910F running Marshmallow 6.0.1?

Many thanks
[Android General] Morningstar:
Ok, you don't have to worry about the ID for ic_action_set. It's only referenced in the dialog_color_picker layout, not in smali. My mistake. I'll update the OP shortly. Thanks for catching that!
[Android General] Morningstar:
Are you talking about the stock data indicator arrows?
[Android General] Morningstar:
I know I've seen it in a few different builds, and I could have sworn one of then was the official CM12, but I may be mistaken. If it's there, it'll either be under Display or Status Bar in you Settings.
[Android General] Hamidreza2010:
You mean not need to edit it ?

leave that?
[Android General] danieldmm:
It blow up my Settings when recompiling over CM12 for OnePlus, will try tomorrow again.

Enviado do meu OnePlus One
[Android General] Morningstar:
Correct. Just copy that image into your drawables folder, and that's it. That image has no reference to change in any of the smali files.

I updated the OP to reflect that. Thank you again for pointing out the mistake.

What do you mean by "blow up your Settings"? If you have a logcat, I can help you figure out where the problem lies...

Fantastic! I'm glad to hear that it worked for you! Thank you for your feedback!
[Android General] Hamidreza2010:
Your welcome dear.

I make it by get FC on 4.3

Tomorrow i,ll do it again , hope is work for me
[Android General] Morningstar:
Alright. If it doesn't work tomorrow, pull a logcat and I'll try to see what's going on!
[Android General] Hamidreza2010:
Yes of course

Thanks
[Android General] sawixso81:
Yes I was able to revert everything to the stock look I see the stock data arrows but not movement from them so Im not sure what is up or what I am missing

Thanks:highfive:
[Android General] Hamidreza2010:
[MENTION=293887]Morningstar[/MENTION] i make it again but get fc but i dont put this file in my files:

and

what is this? these should be in my files?
[Android General] Morningstar:
They're not part of the mod, but they're nothing to worry about. Those are hidden Mac files, and they're only there because when I added a line or two to the zip that I had forgotten, I did it on my Mac instead of my pc, and Mac automatically creates them. You can delete them if you're concerned about them or anything.
[Android General] Morningstar:
I think I know what you might've done. What type of device is it? Samsung?
[Android General] Hamidreza2010:
Ok thanks but how can i solve my FC?

This is my log:
[Android General] Morningstar:
It's not finding the com.android.settings.temasek.NetworkTraffic class, and it looks like it's because you have a space in 'Network' (ie. 'Net work'). Go through everything and make sure first of all, that there's no space in 'network' anywhere the name is used, and then make sure that NetworkTraffic.smali is actually in your com.android.settings.temasek folder.

[emoji4]

Edit: I can't tell for sure from the logs, but I'm betting the extra space is in one of the xmls...Either the one that you added from the zip, or the one that you added a line to....Check those first!
[Android General] happiness4u:
Not yet implemented on Official CM12 for hammerhead. Not included in the changelogs atm. ^_^
[Android General] sawixso81:
Yeah its a Samsung note3 sm-900t with goohs note 4 ported rom my status bar is stock with the exception of 3minit battery and a center clock mod

Thanks:highfive:
[Android General] churapa:
No luck here (Samsung I337 running TW 4.4.2).

Tried making the mod twice from scratch and nothing changes, no errors or anything, simply the mod doesn't even show anywhere in settings nor statusbar.
[Android General] Hamidreza2010:
[MENTION=293887]Morningstar[/MENTION] i try more and more but get FC but finally i understand where is problem.mistake is here:

in last part we should add this code in somewhere for example display_settings.xml in res/xml or ....:

Pay attention please between .NET and workTraffic is space and this is problem and make trouble for us

please correct it for solve all user problem.

this code should be like this:

:good:
[Android General] Morningstar:
Ahh...you're right...Funny, that space wasn't there in the text file I pasted from; XDA must've added it when formatting or something...I'll correct it in the OP shortly. Thank you!
[Android General] Ambor:
Thanks Bro working on xperia z2:D

Awesome:good::good:
[Android General] filchi756:
Mate you still haven't edit that NetworkTraffic " <PreferenceScreen android:title="@string/network_traffic_title" android:key="network_traffic_state " android:summary="@string/network_traffic_summary" android:fragment="com.android.settings.temasek.Net workTraffic" /> ". Please edit it so other wont have a hardtime finding a fix for that fc's like me:(.I didn't read the whole thread when I started doing your mod.:( .By the way I can confirm that this mod is working on Note3 lollipop roms.:good:
[Android General] OvrDriVE:
<public type="layout" name="dialog_color_picker”

this line isn't in my public.xml file. how do i get it there so it works. atm it crashs my settings app
[Android General] hodragon:
Add it by hand. It refers to SecSettings\res\layout\dialog_color_picker.xml
[Android General] OvrDriVE:
i found it. it's there. got it working.
[Android General] silentattack:
I am having an error when recompiling "SecSettings.apk". It's TW Lollipop for G900F. Logcat is the below.
[Android General] slimshouki:
Error

I am facing recompiling error "SecSettings.apk" for the first recompiling. Logcat is attached
[Android General] silentattack:
Any help? [MENTION=293887]Morningstar[/MENTION]
[Android General] Morningstar:
Sorry guys, haven't checked this thread in a while...

FYI, that isn't a logcat....Anyway...The problem is clearly stated: you already have some of the needed resources and are adding duplicates. Delete one of the ic_settings_backup files from drawable-xxhdpi, and delete lines 8257 and 8258 from strings.xml.
[Android General] Morningstar:
Same as above. Delete one of the ic_settings_backup files, and delete lines 8392 and 8393 from strings.
[Android General] Morningstar:
Those are just there because it was zipped on a Mac. They shouldn't affect anything...
[Android General] silentattack:
Can you specify the specific line which i have to remove from strings.xml. Because there are no lines like "8257" or "8258" but after adding process, its like this below. [MENTION=293887]Morningstar[/MENTION]
[Android General] Morningstar:
Look at the screenshot you just posted, all the way on the left-hand side...See those gray numbers? Those are the line numbers....

View attachment 3236518
[Android General] slimshouki:
Working perfect after removing space in network

---------- Post added at 06:20 PM ---------- Previous post was at 06:19 PM ----------

It would be better if you can add MB in units or none (will be calulated in kb) and arrows shape as well
[Android General] silentattack:
I have done as you said above but the network option didn't show up in display. Any idea? I am on XtreSoLite G900F.
[Android General] Morningstar:
Let me see the xml...
[Android General] silentattack:
There are 3 of them. Here.
[Android General] Morningstar:
Hmmm...have you tried adding it to all of them, or just display_settings_2013? If not, try putting it in display_settings....Also, just double check that the fragment it points to (com.android.settings.temasek.NetworkTraffic) is there, and in the same folder structure....
[Android General] silentattack:
wow thanks man it worked. :victory: For those who are doing this on stock TW Lollipop last step needs to be done for all named like display_settings and display_settings_xxx.
[Android General] Morningstar:
Yeah, that's one of those things where there's different versions of what is essentially the same file. Depends on the device which one is actually used. Glad you got it working.

[emoji106]

One of these days when I'm at my computer, I'll remember to edit the OP and remove that extra space. Doing it from tapatalk re-enables the emoji, and makes the code blocks look retarded.

edit:finally removed the space in the OP....
[Android General] intxeon:
Tried this mod and it works perfectly except for one thing.

When I turn off wifi or mobile data the traffic monitor on the status bar doesn't disappear.

I'm on S5 with lollipop.

Any idea?
[Android General] Morningstar:
Hmmm...I'm not sure. I haven't noticed that on my Note 3. Maybe ask Temasek in one of their threads, as they're the ones who created the mod. I simply dissected it to make it available on other ROMs.
[Android General] intxeon:
Did you set activity threshold?
[Android General] iedafarha:
Thnx , work well on lp rom :good:
[Android General] dhanch4:
plz help

plz help me, i do what youre saying, but may be i miss something i dont know

when i touch colour style, settings fc

data trafic monitor doesnt show in my status bar

im noob, so plz help

im using cm12.1 android 5.1.1 sprout

i really want to add this mood cause its look cool n awesome

thank you

**if frameworkres, sys ui, setting apk needed i will attach it to my dropbox
[Android General] Morningstar:
Please post a logcat. I'm guessing you missed an id pertaining to the color picker or something, but it's impossible to tell without a log.
[Android General] Tatsun0x0:
Apktool could not parse smali file

I can't get past the

"-Next, recompile your SystemUI, and once it's done, go ahead and decompile the one you just compiled (say that ten times fast)."

What do you think is the problem on why this is occurring?

-- edit --

Looks like using a different version fixed it
[Android General] Tatsun0x0:
Fixed the network traffic mod not appearing

Since I'm using an MTK device... I'm not really sure if this does apply to those others with MTK chipsets but how I fixed mine from not appearing to making it visible was editing the gemini_status_bar.xml along with status_bar.xml and made sure that it is consistent as possible so wherever I placed

<com.android.systemui.statusbar.policy.NetworkTraffic android:id="@id/networkTraffic" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="false" />

. I have to apply that on both files since they are essentially the same.
[Android General] Morningstar:
Ahhh....Good thinking. I forgot different devices may have additional xmls for various things....

[emoji106]
[Android General] hoangngocbang2009:
Help...View attachment 3356540
[Android General] Morningstar:
Something's wrong somewhere, but the actual error would have been above everything you posted in the log. Pipe the cmd output to a txt file, and upload the entire thing.
[Android General] Morningstar:
Lol right on. I couldn't tell you how many times I've done that. [emoji23]
[Android General] Aamirx27:
Thanks for the Guide Everything Working Fine.. No Issues at all
[Android General] dpoverlord:
hey having a hard time using this on a non root note 4 any ideas on hwo to view network traffic otherwise?
[Android General] sasiskas:
I got it running on Samsung Galaxy S4 dual sim, Lollipop TouchWiz.

Is there any way to change the location of the icon? At the left it is interfering with other icons.

EDIT. Ok I fixed it, in my phone I had to add the line in layout/msim_system_icons.xml instead of layout/status_bar.xml

Not the icon is at the right side, next to the rest icons.
[Android General] darioampuy:
spent 4 hours trying to make it work with no avail... compiles perfectly... no fc anywhere, but it doesn't display the icon in the status bar nor the settings... moved the settings in almost every settings xml i could find... and the starus bar too, i placed it in the same location in the status bar xml like every network meter i tried, i checked the smali locations, sintax problems, everything... idk what else it could be...

i'm using cm12S android 5.1.1 in a galaxy s3(9300), maybe it's incompatible?
[Android General] M...A...B:
HI!

thanks for guide....

i'm trying to make it work on samsung galaxy s4 i9500!

everything is fine with decompiling and recompiling systemui and setting!

but when i put them in the phone i get systemui FC and nothing shows in setting....

anybody got any idea?
[Android General] zakwanPHG:
Disable signature bro
[Android General] aljee77:
Big thanks to Morningstar for the instructions. Successfully applied to the Galaxy S6 SM G925F.:good:
[Android General] wkdurrani:
I modded systemui.apk so that i can get data network speed on status bar. Its working fine. But it updates the kb/s after every 5 seconds or so. I want to change this update rate so that it updates after every 0.5 seconds. Any help?
[Android General] Morningstar:
Did you mod SecSettings as well?
[Android General] thunder82:
I have a little problem i include this mod and centerclock mod but the clock is not correctly centered
[Android General] Morningstar:
Um...OK? You've got something weird going on in your layout, but nobody here is psychic, so if you want to try to get some help, post your layout xml....
[Android General] Morningstar:
So what exactly is the issue with your clock? Is it off to one side (of so, which side), or does it change position slightly, or....
[Android General] thunder82:
is the mod activated the centered clock goes to to the right side
[Android General] Morningstar:
Try changing the gravity on the clock to layout_gravity, or remove the padding at the start of the clock's view.
[Android General] thunder82:
can you tell me in which line you mean ?
[Android General] wkdurrani:
I only moded systemui.apk following another tutorial. But can't seem find any xml where i can change update rate.
[Android General] Morningstar:
Seriously? Read the OP...
[Android General] wkdurrani:
Ok. I was wondering if i can change update rate on my existing mod which only includes modding systemui and only shows download rate. Anyways, I'll redo the mod using this tutorial. Thanks.