yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] est_yasser:
No, your app supports the rtl already, but I'm looking for a way to keep your app monitoring the device layout status (LTR or RTL) and when it changes to RTL it changes a preference to "false" without even the need to open the app.

It would be like this [Rom control monitoring the layout status in background > The layout changed to RTL > Rom control overwrite a pref to "false" > when the user launch Rom control > The option is replaced with (this feature is not available in this layout)] << I know how to write the xml pref and make it conditional, but my problem is in executing the "false" status.

Alternatively, it would be much easier if there's a way to force LTR layout for the device < but I didn't addressed it as a main request cuz this thread isn't made for such request.

Lastly, sorry if the post is too long and explained overmuch

Welcome :) and thanks for your kindness too :o

Keep up the creativeness :good:
[Android Apps and Games] daxgirl:
alright. I will have a look at it and see if we could add an observer for layout directionality.

it's a pickle... but interesting ;)
[Android Apps and Games] est_yasser:
Hi dax,

I'm trying to port another app to yours, and here's what i discovered..

The app comes to u as

headers

and when u click a header it calls a fragment (android:fragment="bla.bla.bla") inside smali folder, then the smali file calls it's related xml via ID (ID from public.xml) and the other operation is normal..

Firstly, I tried to copy smalis to your app and change the ids to

Phone Preferences

id

-Result was the app runs and functions, but when I click on Phone Preferences from nav bar it FC

Secondly, ... never mind it was totally a bad idea

Now I think if I could use nav bar elements as headers, (ui-prefs, phone-prefs ...etc) and I choose one it calls fragment(s)..

so is it possible? if yes, how?

Excuse me if my question is nooby, but I'm new in developing

Regards,
[Android Apps and Games] daxgirl:
hey, our app is forbidden to use as smali. you are given the source code so you can own the code and make changes. as mentioned in OP we will not chase and reports anyone who does, but decompiling android applications for the purpose of modification without the agreement of a developer is illegal. the fact that everyone is doing it doesn't excuse it. android and samsung don't care maybe. but we do. if you use whole or part of our app you must provide source code on git. if you decompile it and push smali into it you cannot provide source code. failure to provide source code will be reported to GPL and might be punishable in court bas violation of open source license.

if you provide the source code of the application you're trying to incorporate, I can have a look. without source code I cannot help you.
[Android Apps and Games] iKoLa_:
please please

please add Arabic language

Because in aryamod rom you choose arabic

language

status bar is reflect
[Android Apps and Games] daxgirl:
Status bar is supposed to be mirrored on Arabic. As it is an rtl language. This has nothing to do with our app. The rom developer can mod status bar xml to not be switched on rtl languages

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Er. Aditya:
i keep getting this error , i dont have anything installed yet
[Android Apps and Games] Wuby986:
maybe there are data for it..
[Android Apps and Games] Er. Aditya:
i had custom settings before this i uninstalled it before trying this one

so may be that ??

but its uninstalled
[Android Apps and Games] Wuby986:
no it has to have the same package name to get recognised to be the same app, anyway, if you tried to run the app from studio it will be installed.. check in data or simply give ok
[Android Apps and Games] Er. Aditya:
yes i am trying it via studio but its not getting installed

and when i press ok

this shows up and remains that way

DEVICE SHELL COMMAND: pm uninstall com.wubydax.romcontrol
[Android Apps and Games] Wuby986:
check in /data for the package name folder and delete it
[Android Apps and Games] Er. Aditya:
i guess this is the issue

Neither user 2000 nor current process has android.permission.INSTALL_PACKAGES.

it dsnt have permission ?
[Android Apps and Games] Wuby986:
could be related to something in your current system, something like permissions set via updater-script.. dunno actually never happend to me
[Android Apps and Games] Er. Aditya:
any other way i could test this ?
[Android Apps and Games] Wuby986:
pull the app compiled from the folder ( root_project/app/build/outputs/apk/app-debug.apk ) and move to the phone manually, then install it, but is not comfortable and doesn't solve the problem! try google your problem..
[Android Apps and Games] Er. Aditya:
yes it worked that way , but not via studio

also how i change the name 6thgear to my rom ??

edit : aah thankyou got it :)
[Android Apps and Games] est_yasser:
Dear Anna,

I was trying to add a PreferenceScreen to launch ES File explorer with this key

android:key="com.estrongs.android.pop.view.FileExplorerActivity"

but whenever I switch to "Useful Apss" screen the romcontrol app FC, and here's the logcat

Process: com.wubydax.romcontrol, PID: 2142
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.preference.PreferenceScreen.removePreference(android.preference.Preference)' on a null object reference
at com.wubydax.romcontrol.HandlePreferenceFragments.allGroups(HandlePreferenceFragments.java:134)
at com.wubydax.romcontrol.HandlePreferenceFragments.getAllPrefs(HandlePreferenceFragments.java:108)
at com.wubydax.romcontrol.HandlePreferenceFragments.onResumeFragment(HandlePreferenceFragments.java:98)
at com.wubydax.romcontrol.AppLinksFragment.onResume(AppLinksFragment.java:20)
at android.app.Fragment.performResume(Fragment.java)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java)
at android.app.BackStackRecord.run(BackStackRecord.java)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java)
at android.os.Handler.handleCallback(Handler.java)
at android.os.Handler.dispatchMessage(Handler.java)
at android.os.Looper.loop(Looper.java)
at android.app.ActivityThread.main(ActivityThread.java)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:115)

I've done this to many other apps and it worked perfectly, and I found the problem comes because of highlighted red word in the key

android:key="com.estrongs.android.pop[COLOR="Red"].view[/COLOR].FileExplorerActivity"

When I removed this word only (.view), I could then switch to Useful Apps screen without FC but ofcourse couldn't launch ES File Explorer form there.
[Android Apps and Games] Kamy:
Check post #246, that solved some of issue regarding to linking other apps to rom control
[Android Apps and Games] Er. Aditya:
i am trying to call a script for blocking ads ,

i added scripts in assets

and in prefs

<Preference android:title="Block Ads" android:key="script#blockhost.sh" />

<Preference android:title="Revert" android:key="script#stock_host.sh" />

but when i click tst on block ads

nothing actually happens, any help
[Android Apps and Games] Kamy:
Make sure script works fine on your phone first.
[Android Apps and Games] Er. Aditya:
it was working well on custom settings
[Android Apps and Games] Wuby986:
make sure you didn't put it into a nested preference screen

---------- Post added at 06:11 PM ---------- Previous post was at 06:07 PM ----------

you have a null object, so you are pointing to something is not certainly there, or missing the default value for it.. just a thought on the fly :)
[Android Apps and Games] Er. Aditya:
this is the code

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen android:icon="@drawable/ic_ads" android:summary="Choose Your Prefrence">
<Preference android:title="Block Ads" android:key="script#blockhost.sh" android:summary="Block Your Ads" />
<Preference android:title="Revert" android:key="script#stock_host.sh" android:summary="Naah Revert Back" />
</PreferenceScreen>
</PreferenceScreen>
[Android Apps and Games] est_yasser:
Interesting, but I'd like to mention that it's not a new fragment, it is a native fragment "AppLinksFragment" with a native xml "app_links_prefs" it worked for other apps like SuperSU, UPSManager and Termenal Emulator, but when it comes to ES File Explorer it sucks, and it happens because that ES has ".view" in their launch Activity and it's not because of calling icon...

Thank you for your reply,
[Android Apps and Games] Wuby986:
remove a preference screen tag
[Android Apps and Games] Er. Aditya:
i tried it with category tag but still nothing happens

sorry for the trouble caused here
[Android Apps and Games] Wuby986:
sorry my fault i overlloked you adddd .sh to the script name inside the key should be script#block_ads
[Android Apps and Games] est_yasser:
I guess I found what's happening..

I'm sure that the key is correct and valid and it calls the launch activity of ES File Explorer app, but the problem is ES app has this package name "com.estrongs.android.pop" and it's launch activity is ".view.FileExplorerActivity"

so when I make the key "com.estrongs.android.pop.view.FileExplorerActivity" the romcontrol translates it as "com.estrongs.android.pop.view" < is the package name and "FileExplorerActivity" < is the activity. while it's obvious there's no app with this package name "com.estrongs.android.pop.view"

ES File Explorer is the only app I found that has this way to call activities 'til now.

I guess that's all related to this method in wubydax app

if (ps.getKey() != null) {
if (ps.getKey().contains(".")) {
int lastDot = ps.getKey().lastIndexOf(".");
String pkgName = ps.getKey().substring(0, lastDot);
try {
//if application package exists, we will set the icon successfully
Drawable icon = c.getPackageManager().getApplicationIcon(pkgName);
ps.setIcon(icon);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
/*In case of exception, icon will not be set and we will remove the preference to avoid crashes on clicks
*To find the parent for each preference screen we use HashMap to buil the parent tree*/
Map<Preference, PreferenceScreen> preferenceParentTree = buildPreferenceParentTree();
PreferenceScreen preferenceParent = preferenceParentTree.get(ps);
preferenceParent.removePreference(ps);

}
}
}

any suggestions for that?
[Android Apps and Games] Wuby986:
that makes more sense now :)

let me get home from work and i'll try to find out a way
[Android Apps and Games] Er. Aditya:
<Preference android:title="Block Host" android:key="script#block_host.sh" android:summary="Block Your Ads" />
<Preference android:title="Stock Host" android:key="script#stock_host.sh" android:summary="Naah Revert Back" />

??
[Android Apps and Games] est_yasser:
alright, I'm looking forward to your reply.

Thank you :)

---------- Post added at 08:02 PM ---------- Previous post was at 07:58 PM ----------

Try to replace your code with this

<PreferenceScreen android:title="Block Ads" android:key="script#blockhost" />
<PreferenceScreen android:title="Revert" android:key="script#stock_host" />

and till me what happens
[Android Apps and Games] Wuby986:
as you can see in the quoted code this is what i meant.. the key is sopposed to be without .sh at end of file name
[Android Apps and Games] Er. Aditya:
huge thanks guys for your help and time....thankyou wuby for your patience :)

it finally wrked :D

[IMG="http://images.t-nation.com/forum_images/1/e/1e2f7_ORIG-bowdown_gif.gif"]http://images.t-nation.com/forum_images/1/e/1e2f7_ORIG-bowdown_gif.gif[/IMG]
[Android Apps and Games] daxgirl:
As pointed out in one of the first (if not THE first reply to you) by [MENTION=4819130]kmokhtar79[/MENTION] I have given a solution and explanation to your problem some pages ago. He also mentioned post number.
[Android Apps and Games] Er. Aditya:
hi anna , one thing i made thread and profile link in my about section but yet unable to click and open the thread
[Android Apps and Games] Martillero:
Put the lines you're using to see what's going on...:good:
[Android Apps and Games] Er. Aditya:
<PreferenceScreen android:icon="@drawable/ic_xda" android:title="ROM Thread" android:summary="Visit For More Info">
<intent android:action="android.intent.action.VIEW" android:data="http://xdaforums.com/note-4/snapdragon-dev/twrom-nameless-rom-t3123512" />
</PreferenceScreen>
<PreferenceScreen android:icon="@drawable/ic_aditya" android:title="Er.Aditya" android:summary="The ROM Dev">
<intent android:icon="@drawable/ic_aditya" android:action="android.intent.action.VIEW" android:data="http://xdaforums.com/member.php?u=5750672" />
</PreferenceScreen>

here thanks mate
[Android Apps and Games] daxgirl:
I am busy with work those days so if you guys don't find a solution in a mean while, I might be able to get to this code on Friday.
[Android Apps and Games] daxgirl:
When you implemented the fix I posted you forgot to remove the condition from the onClickListener. That's why nothing happens when you click.
[Android Apps and Games] Er. Aditya:
you mind correcting me on this anna , what exactly to change in this code ?
[Android Apps and Games] daxgirl:
It's not in this code. I posted a fix for this for the handle preference fragment class. I can't help you now since I am on my way to a night shift and I have no code and no IDE with me.
[Android Apps and Games] Er. Aditya:
Thats is more then enough to search the thread anna

Thanks aton
[Android Apps and Games] est_yasser:
I hope you fully read my last post, [MENTION=4819130]kmokhtar79[/MENTION] advised me to read post #246 and I read it carefully.

what that post points to is to create a new fragment (About Rom) and fix the icons issue, my problem is that wubydax app can not read the key exactly the way it expected to be, if it reads the key correctly everything will be fine.

anyways I've applied this edit

, and the result was the wubydax app does not FC when I click on "Useful apps" and ofcourse there are no icons, but as I mentioned (because it does not read the key correctly) it couldn't launch the desired app, saying (App not installed or intent not valid) and I'm pretty sure that the key is correct.

The app should read the key like this (while Blue color is the package name and the Green color is the activity) "com.estrongs.android.pop.view.FileExplorerActivity"

but what happens is that it reads it this way "com.estrongs.android.pop.view.FileExplorerActivity" and ofcourse it won't find any package with this name and then tell me (App not installed or intent not valid)

I hope it's clear to you now :)

thank you
[Android Apps and Games] Er. Aditya:
got it and now the click is working thanks aton anna :)
[Android Apps and Games] Martillero:
Anna and kmokhtar79 point you out to that post, just for that part, if you got problem with the key linking, just remove that part of the java code as rompnit did.

After the java edit posted by rompnit, launching the app should'nt be a problem...in fact i just donwload the app, put the lines on rom control and no problem at all:

<PreferenceScreen
android:title="Es file manager"
android:summary="blablablabal"
android:icon="@drawable/develop">
<intent android:targetPackage="com.estrongs.android.pop" android:targetClass="com.estrongs.android.pop.view.FileExplorerActivity" />
</PreferenceScreen>

Regards
[Android Apps and Games] Wuby986:
yep in fact i talked to anna about it and we both agree that is definitely your issue, the code you posted about the activity of ES , which is using a non standard folder tree for activities, shows that our app cannot pull the icon from package name because it is supposed to be retrieved removing only the part after the last dot in the activity name, but since the app you are trying to open has a non standard structure ,removing the part after last dot points to a package name wrong and gives you exception..

so in the end acting like suggested, removing the part of the code suggested in the above mentioned post by rompnit is a solution for now
[Android Apps and Games] Er. Aditya:
i am trying to add auto call record

got the options up but have to add smali's into customs settings

where shall i do this in android studio + rom control ?
[Android Apps and Games] Wuby986:
i think in custom setting's smali what you do is make the app able to write a value (0 or 1 f.e. ) into the db from where the modded phone app will read to enable or not the auto record, so what you have to do is understand which value the modded app checks for in the db (if 0/1 or true/false, just an example) and make our app to write the value into the db
[Android Apps and Games] Er. Aditya:
started yesterday and all i can say is you and anna have done a marvelous work mate

this thing as beast as it is damn cool...awesome my friend...i am getting used to it and it feels awesome :D

thankyou again for all your help and work guys

i never knew if one gets started with rom control this gets on realy easy :D

il might bug you soon again for few more stuff mate , hope you wont mind :)
[Android Apps and Games] Wuby986:
glad you enjoy it [emoji2] that was basically the purpose.. let people enjoy doing something new [emoji6]
[Android Apps and Games] Er. Aditya:
ofcourse bro i am loving it :D

between how to move name nameless into middle or right corner ??

edit : got that one too :D thanks mate

edit 1: bro i set <com.wubydax.romcontrol.prefs.MyEditTextPreference for custom carrier text and i had set default:value=nameless but still shows blank in rom control
[Android Apps and Games] Wuby986:
you have 2 choices..

using gui

open the fragment_navigation_drawer.xml and the _light one as well select the design tab on bottom and move manually the TextView on position you like

using text

instead of open the design tab you open the text one and edit the TextView tag from alignParentStart to alignParentEnd
[Android Apps and Games] Er. Aditya:
that i did with fragment_navigation_drawer.xml

but now i am stuck here bro

edit 1: bro i set <com.wubydax.romcontrol.prefs.MyEditTextPreferen ce for custom carrier text and i had set default:value=nameless but still shows blank in rom control
[Android Apps and Games] Wuby986:
check again the code or post it! without seeing the edit code is impossible get the error!
[Android Apps and Games] Er. Aditya:
<com.wubydax.romcontrol.prefs.MyEditTextPreference android:title="Carrier Custom Text" android:key="custom_carrier_text" android:summary="Leave BLANK to remove" android:defaultValue="NamelessRom" android:dialogTitle="Set Custom Text" />

this is the thing
[Android Apps and Games] Wuby986:
so once you open the fragment for this preference the default value is still blank?

go to check in /data/data/.../shared-prefs/xxx.xml if the value is set or not, if is not wipe data for the app and check again
[Android Apps and Games] Er. Aditya:
yes in its xml

<string name="custom_carrier_text"></string>

its blank
[Android Apps and Games] Wuby986:
ok so is not set, so please delete shared preference and open the app, then check it again there
[Android Apps and Games] Er. Aditya:
i deleted the app and reinstalled and this thing is freeky awesome thankyou great sir :)

---------- Post added at 05:39 PM ---------- Previous post was at 05:26 PM ----------

where can i change the default icon for the app ??
[Android Apps and Games] Wuby986:
in res/drawable folders as usual, put new icons in project folder tree
[Android Apps and Games] Er. Aditya:
awesome , just one last thing

i am getting fc with latest statusbar editing

into log i got this

09-24 18:10:18.407 3622 3637 I am_crash: [31639,0,com.wubydax.romcontrol,11058758,android.content.res.Resources$NotFoundException,File ff000000 from drawable resource ID #0x0: .xml extension required,Resources.java,3861]
09-24 18:10:18.427 3622 3637 I am_finish_activity: [0,85810462,2103,com.wubydax.romcontrol/.MainViewActivity,crashed]

attached is the complete log if you can check

also in mainviewactivity

i have public void onNavigationDrawerItemSelected(int position) {

to 10 counts , hope that has nothing to do with it ?
[Android Apps and Games] daxgirl:
Android studio > File > New> Image asset....

In general it's in mipmap ic_launcher.png
[Android Apps and Games] Wuby986:
use the log provided by studio.. it points you to which method is causing error

thanks :) always learning something new [emoji1]
[Android Apps and Games] daxgirl:
Sorry I just woke up and ended up quoting the wrong post. ... with one eye open that is. ?
[Android Apps and Games] Er. Aditya:
but i cannot run app via studio , i am using the method you told in build/app
[Android Apps and Games] daxgirl:
Why can't you run the app from studio? Just keep it installed as data app and it shall run directly on your device when you click run and your device is connected with usb debugging enabled.
[Android Apps and Games] Er. Aditya:
i get this error and yes its installed as a data app
[Android Apps and Games] daxgirl:
Delete it from system. Reboot device. And install as data using studio
[Android Apps and Games] Er. Aditya:
but its not installed as a system app anna
[Android Apps and Games] daxgirl:
Run the error you get as search on Google. I am not in front of pc now. But find out why and make sure you can run your app from your device when it's connected. You can't keep pulling the dumpstate log. Your best friend is actuall running well filtered live log.
[Android Apps and Games] Er. Aditya:
thanks anna il try it once i get home , i am leaving from office

i hope this sorts out good

only left is this fc ...rest i am ready with my new rom control :D

thankyou guys for making it possible and this easy :)

and one more thing i couldnt find ic_launcher in mdpi folder

il look more just had 1 min to look now
[Android Apps and Games] daxgirl:
In mipmap folder
[Android Apps and Games] Er. Aditya:
got it thankyou anna and sorted that fc as well :D

i am trying to add internet meter options options are added but it dsnt work

<com.wubydax.romcontrol.prefs.ColorPickerPreference android:title="Network Speed Color" android:key="network_traffic_color" android:defaultValue="\#ffffffff" alphaSlider="true" hexValue="true" android:summary="Color of network speed text" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="2"
android:entries="@array/traffic_entries"
android:entryValues="@array/traffic_values"
android:key="network_traffic_state"
android:title="Traffic Meter Type" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="2"
android:entries="@array/traffic_update_entries"
android:entryValues="@array/traffic_update_values"
android:key="network_traffic_period"
android:title="Meter Update Frequency" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="2"
android:entries="@array/traffic_unit_entries"
android:entryValues="@array/traffic_unit_values"
android:key="network_traffic_unit"
android:title="Display Unit" />
<SwitchPreference
android:defaultValue="true"
android:key="network_traffic_autohide"
android:summaryOff="Network traffic always shown"
android:summaryOn="Network traffic will autohide"
android:title="Autohide Meter" />
<com.wubydax.romcontrol.prefs.SeekBarPreference
min="0"
unitsRight="Kb/s"
android:defaultValue="10"
android:key="network_traffic_autohide_threshold"
android:max="100"
android:title="Autohide Threshold" />
[Android Apps and Games] Martillero:
In defaultValue for color picker u new to use color integer instead of hex string.

For white use "-1"

Or you can use the hex converter tool by wubydax team ?

(I think it is in the unified S5 mods thread)