[ROM] MIUI | Stock | Language & Discussion Thread - Nexus One Android Development

MIUI ROM from the Far East​Official Links
MIUI English Site: http://en.miui.com/
MIUI Download Site: http://www.miui.com/download.html​Other XDA Links
MIUI General Discussion: http://forum.xda-developers.com/showthread.php?t=1060098
MIUI Guide: http://forum.xda-developers.com/showthread.php?t=1217527​
Other Sites
Russian Support: http://4pda.ru/forum/index.php?showtopic=197606
Spanish Support: http://miui.es/
Italian Support: http://www.nexus-lab.com/miui-rom-italian-packs/
Additional English Support: http://forums.miui-dev.com/
Some North American love: http://miui.us/​
Translation Instructions in Third Post​
PM me if this post needs updating!​

Translations
If you want to contribute to some translations try the initiative started here: >> CLICK HERE <<.
This is an unofficial effort, there is no assurance that any of this translation will ever make it to a final ROM.
Older Translation Packs
Mirror: http://djmcnz.batteryboss.org/MIUI/language/

[HOW TO] Create a MIUI Language Pack
Okay guys, there's a lot of demand for this rom and for language packs but not yet a lot of people who know how to make the packs. Whilst I set up the crowdin translation project I can not create or maintain language packs.
So, here's a summary of the instructions required to create a language pack for MIUI (indeed for any app/rom). You need a collection of tools and a little patience but the process isn't too difficult so do give it a go.
Also note that this summary includes generalisations for brevity. These instructions assume you have a deodexed rom.
Introduction
For the purposes of this post language information is stored in XML strings in files on the Android system. In the case of MIUI and these instructions we will be dealing with .apk files (applications).
Within the apk files is a resources directory (/res) and within this are various values directories, there is a default values directory (/res/values) and alternative language values directories (e.g. /res/values-DE and /res/values-IT).
If the rom is set to use it's default language it will read values from /res/values although these may NOT be in English. In MIUI, all of the common Android ASOP values in /res/values are English but the (additional) custom MIUI strings are in Simplified Chinese.
If you select a different language in the ROM than the default then the appropriate values directory will be searched. If a suitable string that matches your language selection is found in the alternative /res/values-xx directory then that string will be used instead. If an alternative does not exist then the default will be used.
Example:
Code:
/res/[COLOR="red"]values[/COLOR]/strings.xml
<stop_button_text>[COLOR="Red"]Stop[/COLOR]</stop_button_text>
/res/[COLOR="red"]values-DE[/COLOR]/strings.xml
<stop_button_text>[COLOR="red"]Halt[/COLOR]</stop_button_text>
/res/[COLOR="red"]values-IT[/COLOR]/strings.xml
<stop_button_text>[COLOR="red"]Basta[/COLOR]</stop_button_text>
In this example, if the language is set to the default the word "Stop" will be used, if it is set to German the word "Halt" will be substituted in, likewise "Basta" for Italian.
So, to add languages to a rom (or app) or to make an app multi-lingual you need to either change the default strings in /res/values/strings.xml to the ones you want to use or, and this is the preferable approach, add a /res/values-xx/strings.xml with the translations you want. The first approach will work (changing the default strings) but is not recommended because the Android Open Source Project and Android development in general, defaults to English. It's best to use the built in language substitution capabilities of Android rather than to work around them. Indeed, if the MIUI devs actually added their strings in English to /res/values/strings.xml and the Chinese equivalents in the appropriate directory this rom would already be in English!
Adding Languages
To add a translation file (strings.xml) to an apk you need to:
decode the apk
create a language directory
add the translation files
recompile the strings
add the new strings to the apk
Which all sounds a little daunting but it's really quite straight-forward, rewarding when you see the result and a good way to understand how parts of Android work. Here's how you can do it.
1. decode the apk
You will need the excellent apktool from brut.all which you can get from the link below. apktool is relatively easy to use but includes some little tricks so you will need to read the wiki and thread about it.
Do NOT just post problems about apktool if you can't get it to work. The tool DOES work so if it's not decoding (or encoding) your apps correctly then you're probably doing something wrong. If you start with this understand BEFORE you ask for support you'll get a lot more help...
apktool: http://code.google.com/p/android-apktool/
wiki: http://code.google.com/p/android-apktool/w/list
thread: http://forum.xda-developers.com/showthread.php?t=640592
Please make sure you run the following command to include the MIUI framework in apktool. You only need to do this once for each framework. If apktool works with one rom and not the next then (re)install the framework for that rom.
Code:
apktool if framework-res.apk
Where framework-res.apk is the one from the rom you are working with. Make sure apktool can find (the correct) framework-res.apk before you run this command.
This thread is not for apktool support.
Now, before you proceed, decode a simple app from MIUI (such as updater.apk) using apktool, do not make ANY changes, then re-encode it using apktool. For example:
Code:
apktool d Updater.apk ./decoded/
apktool b ./decoded/ new_updater.apk
Use the -v (verbose) flag in apktool if you have problems and need to diagnose further.
Remember, Android uses a case-sensitive file system, make sure your capitalisation is correct.
Typically you will not be able to install this apk because it is not signed so if you want to test the process further you can now just try step 5 below using the two apks you have.​
2. create a language directory
Assuming you can decode/encode now, this is the easy bit. For your decoded app, navigate to the directory it was decoded in, then to the /res/ directory and simply create an empty directory for your language (e.g. /values-FR/) - use international naming conventions.​
3. add the translation files
Again, not too difficult this. Download the appropriate language file for your apk from the crowdin project linked below and, using the same structure as exists in /res/values/strings.xml create a new file called strings.xml in your alternative language directory (e.g. /res/values-ES/strings.xml).
The news strings.xml may contain as many or as few translations as you like. Remember, if a translation does not exist the default value from /res/values/strings.xml will be used.
Crowdin: http://crowdin.net/project/miui-rom-translation/invite
The xml formatting and tag names need to match exactly with the default strings.xml in /res/values although the translated file does NOT need to be complete.
It is worth remembering here that unless your source apk is already translated to English then some of the default values in /res/values/strings.xml will still be in Chinese, it would pay to check these.​
4. recompile the strings
Now, if you've done everything carefully and correctly this step is really easy, all you need to do is recompile the apk with apktool using the b (for Build) switch.
Code:
apktool b ./<decoded_apk_dir>/ <output_apk_name>.apk
If this throws errors or does not work then use the -v switch to turn on verbose mode and diagnose your problem. If you did the test in step #1 and it worked then any problem at this step is likely related to your news strings.xml. Back out the changes one by one until you have found the problem and try again.
If you simply can't get it to compile with your changes then try just making a single change to the default strings.xml file in /res/values and see if that works for you.
Do NOT sign the apk!​
5. add the new strings to the apk
Easy. Open your new apk with a zip program (like 7Zip for Windows) and copy out the resources.arsc file in the root directory of the apk. Now take that file and copy it into the source apk from the rom overwriting the existing one. This process replaces the strings but keeps the integrity of the signatures on the files.
You can now push the modified file to your phone, replacing the stock one, reboot and you're translated. Push the file using "adb push" or copy it into place using a root file manager, do not "install" the new apk. Make sure you put it in the correct place (replace the original) and reboot.​
Conclusion
This process will help you add languages to any app including those in the MIUI rom. Because it's a rom the strings are contained in many different apps as well as framework-res.apk. To completely translate the rom you will need to edit every apk that has strings in it.
You will need to do this every time an apk in the rom changes. If a new version is released and say launcher2.apk is changed but updater.apk is not, then you can retain your updater.apk but you'll need to re-edit your launcher2.apk.
When an app changes the default strings.xml may also change. In this case you will need to make corresponding changes to your translations.
Good luck and if you get really stuck there's lots of people in this that have achieved success and may be willing to help!
kaobiore said:
HOW TO SPEED-UP THE TRANSLATION-PROCESS:
I've created a simple application (java-based) which tries to merge orginal-froyo-translation (taken from the official repository) into the miui-value-files. (only strings.xml are currently supported).
This program is available here:
http://www.multiupload.com/HVZXDBHIVU
djmcnz said:
Mirror Link
Click to expand...
Click to collapse
How it work / what you have to do:
1) Extract the Translator.tar.gz file (windows-users use winrar or whatever) - a directory named "Tanslator" will be created.
2) Extract the strings.xml file from the miui-package you want to translate.
This can be done with the apk-tool: apktool -d Contact.apk Contact_decoded
Copy the "res/values/strings.xml" to the created "Translator"-direcory. Open that folder and rename (the previous copied) strings.xml to "untranslated.xml".
3) Copy the strings.xml from the official froyo-sources for the package and the language you want to "merge" to the "Translator"-directory and rename the string.xml-file to "translation-file-from-froyo-repo.xml".
4) Run the program. Open a command-prompt/console. Change directory into the "Translator"-Directory and run:
java Translator untranslated.xml translation-file-from-froyo-repo.xml
This will generatre a file named "translated.xml"
For some safety reasons not all string which match "by key" are merged. (Stuff wich contains characters like '<' or '%'). You probably see some warnings printed in console (with the key) that needs to be translated manually.
If you want to override this "safety-featiure". Run the app with:
java Translator untranslated.xml translation-file-from-froyo-repo.xml psycho
(psycho at the end)
Hope this helps somehow.
Click to expand...
Click to collapse

From the other thread: http://www.youtube.com/watch?v=Or-9T44Bt7M&feature=player_embedded

Is it english ready?

vegetaleb said:
Is it english ready?
Click to expand...
Click to collapse
Read rule #2

djmcnz said:
Read rule #2
Click to expand...
Click to collapse
Wow, thats was pleasant, way to slam a guy.
Did you really expect people not ask?

I ran the language file you posted above through Google Translate so we can get a better idea how the text should read... (For the people like me that don't understand Chinese )
Code:
<string name="breathing_light_color_title"> trackball color </ string>
<string name="breathing_light_color_summary"> received a new notification, tracking the ball indicator color </ string>
<string name="breathing_light_freq_title"> trackball flicker frequency </ string>
<string name="breathing_light_freq_summary"> trackball pause time between two flashes </ string>
<string name="trackball_wake_title"> trackball light up the screen </ string>
<string name="battery_settings"> power settings </ string>
<string name="battery_settings_title"> power </ string>
<string name="battery_indicator_style"> power status bar style </ string>
<string name="battery_low_level"> low battery warning value </ string>
<string name="battery_saving_rules_title"> Automatic power rules </ string>
<string name="battery_saving_rules_summary"> alert when the power is lower than the value of the operation will be applied when the </ string>
<string name="battery_auto_saving_category_general"> the page the next time all the changes will take effect when entering a low-power </ string>
<string name="battery_auto_saving"> value into the low battery warning when the automatic power saving </ string>
<string name="battery_setting_quick_entry"> power to set Quick Entry </ string>
<string name="battery_setting_quick_entry_summary"> when the low battery, the drop-down box in the status bar display the prompt, and click to enter the current settings page </ string>
<string name="battery_auto_saving_category_rule"> power rule </ string>
<string name="battery_auto_saving_rule_brightness"> reduce the screen brightness </ string>
<string name="battery_auto_saving_rule_brightness_summary"> brightness to a minimum, you can significantly reduce battery consumption </ string>
<string name="battery_auto_saving_rule_background_data"> disable the background </ string>
<string name="battery_auto_saving_rule_background_data_summary"> save power at the same time and save network traffic costs </ string>
<string name="battery_auto_saving_rule_auto_sync"> disable automatic sync </ string>
<string name="battery_auto_saving_rule_auto_sync_summary"> close contacts, messages and other account synchronization </ string>
<string name="battery_auto_saving_rule_apn"> disable the mobile network </ string>
<string name="battery_auto_saving_rule_apn_summary"> off GPRS, 3G and other data connections </ string>
<string name="battery_auto_saving_rule_wifi"> disable WiFi wireless network </ string>
<string name="battery_auto_saving_rule_wifi_summary"> can significantly reduce battery consumption </ string>
<string name="battery_auto_saving_rule_bluetooth"> disable Bluetooth </ string>
<string name="battery_auto_saving_rule_bluetooth_summary"> can significantly reduce battery consumption </ string>
<string name="battery_auto_saving_rule_gps"> disable the GPS satellite positioning </ string>
<string name="battery_auto_saving_rule_gps_summary"> prevent background programs using the GPS, power consumption </ string>
<string name="battery_auto_saving_rule_vibrate"> disable the vibration </ string>
<string name="battery_auto_saving_rule_vibrate_summary"> shock in general consumes little power, but in a time of low power consumption is to save a little bit </ string>
<string name="battery_auto_saving_rule_haptic"> disable tactile feedback </ string>
<string name="battery_auto_saving_rule_haptic_summary"> principle above </ string>
<string name="battery_auto_saving_rule_wallpaper"> disable dynamic wallpaper </ string>
<string name="battery_auto_saving_rule_wallpaper_summary"> wallpapers will consume a lot of power but also slow down the system speed </ string>
<string name="battery_auto_saving_rule_screen_time_out"> reduce screen timeout </ string>
<string name="battery_auto_saving_rule_screen_time_out_summary"> timeout to a minimum, you can reduce the battery consumption to some extent </ string>
<string name="battery_auto_saving_rule_cpu"> reduce the CPU frequency </ string>
<string name="battery_auto_saving_rule_cpu_summary"> can reduce the "cottage" lock screen when the program is produced by CPU power consumption </ string>
<string name="battery_auto_saving_category_practise"> want more power? </ string>
<string name="battery_auto_saving_practise"> saving tips </ string>
<string name="battery_auto_saving_practise_summary"> 1 usually minimize the program running in the background \ n2 unless the bright light, usually no need to use the highest brightness \ n3 sleep can be considered to set flight mode </ string>
<string name="battery_auto_saving_practise_more"> More energy saving tips to the forums> </ string>
<string name="sd_ext_memory"> A2SD </ string>
<string name="usage_type_power"> power consumption </ string>
<string name="current_ime"> the current input method </ string>
<string name="experimental_settings"> developer-specific settings, the average user to use at your own risk </ string>
<string name="experimental_category_control_title"> system control </ string>
<string name="overscroll_mode_title"> elastic default list style </ string>
<string name="menu_style_title"> menu style </ string>
<string name="experimental_category_launcher_title"> Desktop </ string>
<string name="app_icon_background_title"> enable the icon background </ string>
I'm going to work a bit on refining the language tonight.
Going to work backwards.
1) Uploading this language file in place of the Chinese language file.
2) Load up the ROM.
3) Start browsing the menus and figure out how they should read and make the text more accurate to English.
4) Make the changes needed to the language file.

djmcnz said:
all your base are belong to us
miui rom from the far east
if you've not heard about this rom yet then check out this excellent thread started by dai323 who deserves credit for bring it to our attention.
This is an excellent rom if for no other reason than it introduces the first non-cyanogenmod/carrier/manufacturer framework overhaul of android 2.2, and boy what an overhaul. It's hard to ignore the conspiracy theory that this includes leaked elements of gingerbread... The next android. Don't ask me, i have no idea...
de-odexed | themeable | ready for translation
i will pull this at the request of the devs, pm me if you wish.​
important notice
this is for advanced users only.
this is a no questions rom, you are not allowed to ask questions that you could work the answers out for yourself. Don't dare.
this is a no complaints rom, you are not allowed to complain if it does not work, breaks your phone or has sex with your sister.
please contribute to the enhancement of this rom in a constructive fashion, see the next post.
if you agree to all of the above then you may download the rom by clicking on the appropriate answer below.
yes, i deserve to use this rom | no, i'm a bit of a tool​changes from base rom
fully de-odexed
added adw.launcher
added launcherpro
added locale
added htc ime mod
updated apps2sd to 2.7.5 final
(mostly) updated gapps (including new gmail)
resigned (any recovery)
some other stuff perhaps (?)
installation
as per any other rom & remember no questions!
and if you got this far without finding the download link then you did not read the post!
md5 hash
27933619e3fa658a1db42286cd8f6c9c​
enjoy
Click to expand...
Click to collapse
where is the download link to this rom with english...?

salamandar said:
Wow, thats was pleasant, way to slam a guy.
Did you really expect people not ask?
Click to expand...
Click to collapse
In all fairness, it does say in the original post that there are no questions, and also the Title of the post says specifically that its "Ready to Translate." It hasn't been translated yet...
xghostyxjokerx said:
where is the download link to this rom with english...?
Click to expand...
Click to collapse
"Ready to Translate".... It's still in Chinese.
It's been DeODEXed, so people willing to help translate can do it much more easily.

I couldn't help but to follow the " No, I'm A Bit of a Tool" link Excellent !!!

I wish i had google translate when i was in highschool spanish sleeping. It really would have helped a lot more than my portable translator from CVS!

hahaha i liked the point when you say And if you got this far without finding the download link then you did NOT read the post.

malavan said:
hahaha i liked the point when you say And if you got this far without finding the download link then you did NOT read the post.
Click to expand...
Click to collapse
Cov niag tseejmuag tsov tom hauv nov! Xav noj quav aub diam.

@djmcnz,
seems like nobody is respecting ur post, man but i have to agree that it is very funny , the link to no i am a bit of a tool!
anyway, the reason of my post,
i saw that you didnt include modifications to the vendering_preferences for the market fix. this was just to remind you.
http://forum.xda-developers.com/showthread.php?t=689133
i can confirm that it did help improve speed greatly!

Is it english ready?
Click to expand...
Click to collapse
Then, four posts down:
where is the download link to this rom with english...?
Click to expand...
Click to collapse
Loled hard. I guess some people don't read.
EDIT: Went back to the "No, I'm A Bit of a Tool" link, this thread is hilarious.
Thanks djmcnz & Dai323. I'll have to try this guy out.

<string name="breathing_light_color_title">跟踪球颜色</string> Trackball Flash Color
<string name="breathing_light_color_summary">在收到新通知时,跟踪球指示灯的颜色</string>Color of Trackball flash when new notifications are received
<string name="breathing_light_freq_title">跟踪球闪烁频率</string>Trackball Flash Frequency
<string name="breathing_light_freq_summary">跟踪球两次闪烁之间的停顿时间</string>Interval between consecutive flashes
<string name="trackball_wake_title">轨迹球点亮屏幕</string>Trackball Wake
<string name="battery_settings">电量设置</string>Power Settings
<string name="battery_settings_title">电量</string>Power
<string name="battery_indicator_style">状态栏电量样式</string>Battery Indicator Style
<string name="battery_low_level">低电量警戒值</string>Alarm Level for Low Battery
<string name="battery_saving_rules_title">自动省电规则</string>Power Saving Mode
<string name="battery_saving_rules_summary">当电量低于警戒值时将会应用的操作</string>Settings when battery level is below alarm level
<string name="battery_auto_saving_category_general">该页面所有修改将在下一次进入低电量时生效</string>All changes made will be effected the next time power saving mode is activated
<string name="battery_auto_saving">进入低电量警戒值的时候自动省电</string>Automatic Power Saving Mode
<string name="battery_setting_quick_entry">电量设置快速入口</string>Low Power Notification
<string name="battery_setting_quick_entry_summary">当低电量时,在状态栏下拉框中显示提示,并可点击进入当前设置页面</string>Notification will be shown when battery life is low. Click notification to enter Power Settings.
<string name="battery_auto_saving_category_rule">省电规则</string>Power Saving Options
<string name="battery_auto_saving_rule_brightness">降低屏幕亮度</string>Reduce Brightness
<string name="battery_auto_saving_rule_brightness_summary">亮度减少到最低,可以大量减少电池消耗</string>Screen Brightness is set to minimum. Can drastically decrease power draw
<string name="battery_auto_saving_rule_background_data">禁用后台数据</string>Disable Background Data Transfer
<string name="battery_auto_saving_rule_background_data_summary">节省电量的同时并可以节省网络流量费用</string>Reduce power draw and data charges
<string name="battery_auto_saving_rule_auto_sync">禁用自动同步</string>Disable Sync
<string name="battery_auto_saving_rule_auto_sync_summary">关闭联系人、邮件等帐户同步</string>Disable Syncing of Contacts, Mail, etc
<string name="battery_auto_saving_rule_apn">禁用移动网络</string>Disable Mobile Data
<string name="battery_auto_saving_rule_apn_summary">关闭GPRS、3G等数据连接</string>Disable mobile networks such as GPRS and 3G
<string name="battery_auto_saving_rule_wifi">禁用WiFi无线网络</string>Disable Wifi
<string name="battery_auto_saving_rule_wifi_summary">可以大量减少电池消耗</string>Can drastically reduce power draw
<string name="battery_auto_saving_rule_bluetooth">禁用蓝牙</string>Disable Bluetooth
<string name="battery_auto_saving_rule_bluetooth_summary">可以大量减少电池消耗</string>Can drastically reduce power draw
<string name="battery_auto_saving_rule_gps">禁用GPS卫星定位</string>Disable GPS
<string name="battery_auto_saving_rule_gps_summary">可以避免后台程序使用GPS的电量消耗</string>Disable background usage of GPS
<string name="battery_auto_saving_rule_vibrate">禁用震动</string>Disable Vibrations
<string name="battery_auto_saving_rule_vibrate_summary">震动在一般情况下消耗电量不多,但是在电量低的时候能省一点是一点</string>Vibrations do not consume much power under normal usage. (I took the liberty of leaving out the last part which basically says that "But when your battery is low it helps, however minimally."
<string name="battery_auto_saving_rule_haptic">禁用触感反馈</string>Disable Haptic Feedback
<string name="battery_auto_saving_rule_haptic_summary">原理同上</string>Refer to Vibrations
<string name="battery_auto_saving_rule_wallpaper">禁用动态壁纸</string>Disable Live Wallpapers
<string name="battery_auto_saving_rule_wallpaper_summary">动态壁纸会大量消耗电量还会拖慢系统速度</string>Live Wallpapers are significant sources of power draw and may cause system lag
<string name="battery_auto_saving_rule_screen_time_out">缩短屏幕超时设置</string>Reduce Screen Timeout
<string name="battery_auto_saving_rule_screen_time_out_summary">超时设置减少到最低,可以一定程度减少电池消耗</string>Reduce screen timeout interval to minimum. May help with battery life.
<string name="battery_auto_saving_rule_cpu">降低CPU频率</string>Reduce CPU Speed (Frequency?)
<string name="battery_auto_saving_rule_cpu_summary">可以减少“山寨”程序在锁屏时产生的CPU耗电</string>May reduce power draw from rogue applications when locking the screen
<string name="battery_auto_saving_category_practise">想更省电?</string>Want to save more power? (Direct translation. May be better as "Extending your battery life"
<string name="battery_auto_saving_practise">省电小技巧</string>Tips on Maximizing Battery Life
<string name="battery_auto_saving_practise_summary">1 平时尽量减少后台运行的程序\n2 除非强光下,平时没必要使用最高亮度\n3 睡觉时可以考虑设置飞行模式</string>1.Limit number of applications that run in the background. 2.Unless under bright light, there is no need for maximum brightness. 3.Consider activating Flight Mode at night.
<string name="battery_auto_saving_practise_more">到论坛查看更多省电技巧></string>Check out more power saving tips at the forums
<string name="sd_ext_memory">A2SD+</string>A2SD+
<string name="usage_type_power">耗电量</string>Battery Use (I have no idea what this actually does, but I'm guessing a battery usage breakdown by app)
<string name="current_ime">当前输入法</string>Current Keyboard
<string name="experimental_settings">开发人员专用设置,普通用户使用后果自负</string>Developer settings only. Use at own risk.
<string name="experimental_category_control_title">系统控件</string>System Controls
<string name="overscroll_mode_title">列表弹性缺省风格</string>Lists Overshoot
<string name="menu_style_title">菜单风格</string>Menu Styles
<string name="experimental_category_launcher_title">桌面</string>Homescreen (Launcher may work better here, I'd need to actually see what it does first)
<string name="app_icon_background_title">启用图标背景</string>Icon Backgrounds on Homescreen
Click to expand...
Click to collapse
I take it that you wanted these translated!
I have no experience with actually working with Android ROMs, however, so this is as far as I can go. But I'd be happy to translate others if someone posts them.
Edit: Ninja'd by Google Translate while I was working on this. I have to say I'm pretty darn impressed by the accuracy of Google Translate now, as opposed to like a year ago when it just spews out random crap.

djmcnz said:
...or has sex with your sister.
Click to expand...
Click to collapse
That'd be the only way she'd get a date...

Another great kang . Should be called 'miui-kang'
Has anyone verified darktremor a2sd works ?
Also are the trackball led alerts configurable?
(yes I dare!!)
hooray for the "enable the icon background" option

britoso said:
Another great kang . Should be called 'miui-kang'
Has anyone verified darktremor a2sd works ?
Also are the trackball led alerts configurable?
Click to expand...
Click to collapse
DT a2sd was included in the original Miui rom, so yeah it works.
Configurable alerts have no idea about

Related

[TIP][Guide]Change Default Home Button Color

Hi Guys.. I've been searching for ways to change the default color of Home Button of our Ray. Been on decompiling/compiling framework, settings... but got nothing or don't know exactly what xml/smali that controls the color of the buttons. So, by doing some trials-and-errors...:crying: Maybe this time I hit it.
First of all I want to thank:
JJDOCTOR for giving the hint to enable the light of Home button.
boy*racer*- max echo value is 20000
and all of you GUYS here on xda..
So here it is, navigate to system/etc/pre_hw_config.sh using ROOT EXplorer and find these lines:
echo 1000 > $dev/red/max_current
echo 1000 > $dev/green/max_current
echo 1000 > $dev/blue/max_current
and change to anything you want, I made it to
echo 1000 > $dev/red/max_current
echo 2000 > $dev/green/max_current
echo 9000 > $dev/blue/max_current
THE HIGHER THE VALUE, THE BRIGHTER THE LED.
Save changes....
For color preferences calculations: Go here. Thanks to Xtremy.
The above is nearly ICS Blue... You can put any values you want til 20000(?) except ZERO (0). By putting zero, that color will not be used by the system notifications ( I think)...
THIS WOULD NOT MAKE ALL OF THE NOTIFICATIONS COLOR TO THE COLOR YOU HAVE SET, ONLY THE DEFAULT HOME BUTTON COLOR IS AFFECTED. Sorry if the first flash of notification is not the COLOR you desired, only the succeeding flashes... I'm not a developer, I don't know how to do this correctly.
I THINK THIS WOULD NOT WORK ON CM-BASED ROM, BECAUSE THE HOME BUTTON LIGHT IS DISABLED (automaticbrightness is already set to FALSE). If somebody can make it to work, just apply it.
SOME DEFAULT COLOR WOULD NOT BE THE CORRECT APPEARANCE AFTER CHANGING THOSE LINES.. example, Violet is not violet when you use it as message notifications, still ICS Blue(?). Just raise the values.
REBOOT IS A MUST... Hope it won't bootloop...
adulfo said:
......................but got nothing or don't know exactly what xml/smali that controls the color of the buttons..........................:
Click to expand...
Click to collapse
XML is used to create user interface and the components used in app and java is used to create executable codes that will make apps functionality.
XML and smali are created automatically in app development.Though notepad++ is best to type XML.Best and easiest way to create a xml file is just write code in notepad++ and save it with extension of .xml.If you are developing an application of android then xmls are created by software itself. You will just need to specify name and add it to project as xml file...
thank you! i was just looking for this:good:
This is a nice mod adulfo! :good:
I wrote a little tutorial for finding your color value:
Go to this Color Wizard website.
Choose the color of your choice in de color bars.
In the #box you find the hex value for your color.
For this tut i use a nice orange E45F13 hex value.
Split de value in three pieces E4 5F 13.
1st byte E4 xx xx is for the Red value. (#FF0000)
2nd byte xx 5F xx is for the Green value. (#00FF00)
3rd byte xx xx 13 is for the Blue value. (#0000FF)
Open windows calculator set it in Scientific Mode.
1) Hit F5 to select HEX.
2) Type in your first hex (if HEX is 00, decimal is 0)
3) Hit F6 to convert to decimal.
Do this for all three hex values and write down the numbers...
1st byte E4 xx xx E4=228
2nd byte xx 5F xx 5F=95
3rd byte xx xx 13 13=19
As we know "max echo value is 20000" or 255 so:
20000 / 255 X 228 (your 1st above number)= 17882 for the Red Value
20000 / 255 X 95 (your 2nd above number)= 7450 for the Green Value
20000 / 255 X 19 (your 3rd above number)= 1490 for the Blue Value
Change the values in system/etc/pre_hw_config.sh for red, green and blue save & exit, reboot!
---------- Post added at 12:48 AM ---------- Previous post was at 12:37 AM ----------
I use the Tron Legacy Cyan color: 00DFFC
1000 for the Red Value.
17490 for the Green Value.
19764 for the Blue Value.
also note:
I set the first byte for Red to zero
after reboot it went to 1000 value,
so I think 1000 is the lowest value.
Thanks mate.. To those also having problems converting those values, you can google HEX to RBG converter.
wow it is very great and i change it
works perfect
4.0.4 587
psp1987 said:
wow it is very great and i change it
works perfect
4.0.4 587
Click to expand...
Click to collapse
Would be nice if you will read my signature...
what does this change ? the light shown when the phone is switched on and had no notification ?
-Jesco- said:
what does this change ? the light shown when the phone is switched on and had no notification ?
Click to expand...
Click to collapse
This would only change the default color of your Home button ( if only it is enabled), hitting any of your physical keys.
i changed all the values to 10000, all the colors are the same but a lot brighter, default 1000 is too dim for me.
@adulfo thanks for the tip buddy, can happily report that it is also working on my ray
Sent from my ST18i using xda premium
This values as depicted on the lines itself maybe clear, raising it, means raising LED current, more current more power,more power so much brighter... If you want color other than WHITE, don't make the values nearly equal.
Xtremy said:
also note:
I set the first byte for Red to zero
after reboot it went to 1000 value,
so I think 1000 is the lowest value.
Click to expand...
Click to collapse
Zero doesn't work, i try 0001, it works.
for RED color, the value is 10000,0001,0001.
Try again to see the values on your pre_hw_config.sh if it did not changed after reboot. Then all of your notifications will turn to RED.. By setting the lowest value to 1000, still the GB colors has still a good current value.
Flashable zip for Holo style Blue
Not made by me but jjdoctor...
had this zip tho
lokenok said:
Flashable zip for Holo style Blue
Not made by me but jjdoctor...
had this zip tho
Click to expand...
Click to collapse
I think this will make all of your notifications to LIGHT BLUE?.. Correct me if I'm wrong... Doing that also.. Better to put those values on pre_hw_config.sh..
adulfo said:
Try again to see the values on your pre_hw_config.sh if it did not changed after reboot. Then all of your notifications will turn to RED.. By setting the lowest value to 1000, still the GB colors has still a good current value.
Click to expand...
Click to collapse
so is there any value that change the LED to RED but not affect to other notification color???
luckkonku said:
so is there any value that change the LED to RED but not affect to other notification color???
Click to expand...
Click to collapse
Just don't put those values on hw_config.sh, only on pre_hw_config.sh I think....
hi guys this is my first comment so, i've changed these values in pre_hw_config.sh and of course i've got the color i want (nearly ICS blue). BUT here is my problem: other notifications like charging (instead of red it's nearly pink, instead of orange it's nearly green...) not working properly. I'm using light flow led and its notifications also miss the right color. Is there a solution for this? I'm not a developer but i think the phone calculates the values of notifications by this three values and must be an algorithm for this somewhere in the phone, so maybe we can manipulate that. Tell me if I'm wrong. Sorry for my english it's not my native language.
bobo023 said:
hi guys this is my first comment so, i've changed these values in pre_hw_config.sh and of course i've got the color i want (nearly ICS blue). BUT here is my problem: other notifications like charging (instead of red it's nearly pink, instead of orange it's nearly green...) not working properly. I'm using light flow led and its notifications also miss the right color. Is there a solution for this? I'm not a developer but i think the phone calculates the values of notifications by this three values and must be an algorithm for this somewhere in the phone, so maybe we can manipulate that. Tell me if I'm wrong. Sorry for my english it's not my native language.
Click to expand...
Click to collapse
Try to raise the values of the other color, I stated that on my OP last part that if you make the other values extremes (1000 and 20000), the the colors will be affected.. If for instance, Blue will have 20000 value, the notifications color that contains blue (violet...) will have dominant blue and other colors will be suppressed, so VIOLET will turn out to be more on BLUE.

[APP][ROOT] zTorch Adjustable and extremely bright Flashlight

EDIT: 11/15/2014
This post features version 2.x.x. It is a complete rewrite using Android Studio because importing the project from Eclipse didn't go too well.
For information on version 1.x.x , go to post #28
Downloads for both versions are at the bottom of this page.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
ZTORCH Features:
The goal of ZTorch is to be a extremely quick and lightweight app that does one thing and does it well without extra bloat or ridiculous permissions. ZTorch can vary the brightness of your phones LED and allow you to set brightness levels higher than possible anywhere else.
The Galaxy S4 is capable of 16 different levels of brightness (0-15). Compared to other Apps:
The stock "Assistive Light" that is featured with the phone only sets the level to 1.
The brightest AppStore Apps, such as TeslaLED, are able to set the brightness to a little less than half brightness, level 6.
Typically, flashlight apps take about a second to switch on the LED
ZTorch can adjust the LED in mere milliseconds.
ZTorch stays on when the screen is off and doesn't flicker when the screen switches off.
ZTorch works with the camera. Ever wanted to use the flashlight LED while recording a video or taking a picture? Now you can.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
ZTorch should work across all phones with root if the proper system file is on the phone. ZTorch scans for the following binaries below. If your device isn't supported and you know the path to the proper file, you can set that path in the apps preferences. This app has only ever been tested on the Galaxy S4, if you try it on a different phone, PLEASE let me know how it is!
Code:
"/sys/class/camera/flash/rear_flash", - For Galaxy s4
"/sys/class/camera/rear/rear_flash", - For Galaxy Note and maybe s3
"/sys/class/leds/flashlight/brightness," - HTC devices
"/sys/devices/platform/flashlight.0/leds/flashlight/brightness" - HTC devices
" /sys/class/leds/spotlight/brightness" - Motorolla Droid Devices
"/sys/class/leds/torch-flash/flash_light" - Motorolla Droid 2
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Screenshots from ZTORCH-beta-2.0.0.26.apk:
Main Activity as popup with widget shown in background.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Notification:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Permissions:
ACCESS_SUPERUSER - To set the LED
RECEIVE_BOOT_COMPLETED - Sets LED to 0, allows for persistent notification, notification on bootup.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Version Information:
Download attached at bottom of post.
LATEST: Version 2.0.3.50: (Feb 24, 2015)
Notification now appears on boot if that setting is enabled
Separated BootReceiver from main broadcast receiver so disabling the boot receiver won't break the rest of the app.
Notification icon changed to support Lollipop.
Renamed some app refs.
Somehow cut 50kb from the app, it's now 100.6Kb. Considering the Icons take up 89.5Kb I'm kinda amazed.
I haven't got around to making an actual Settings activity. So features are the same from prior version.
Version 1.2.2: (Mar 3, 2014) All the features work but is less refined.
Version 1.3.0: (June 16,2014) Added TorchPlayer to act similar to PWM. All Features work.
Version 1.4.0 (June 20,2014) Switching speed was the priority in this version; the brightness can be changed in <3ms. I abandoned the very comprehensive and powerful Stericson RootTools library in favor of a purpose built class that toggles the flashlight. Warning: The notification doesn't work on API-19 Android 4.4+. Clicking it does nothing. I need to build a new version sometime.
For more info on version 1.x.x such as the screenshots, see post #28
ZTORCH-beta-2.0.0.28: (November 15,2014) Beta version does not yet have a settings or preference activity implemented as well as other nonessentials. To change settings in this version, see below. Changes include:
Entirely new MainActivity that's now in a Popup window
Entirely New and Fully Working Notification
Widget now fills the entire 1x1 grid. (Let me know if there's problems, I set the left and right margins to -23dp to do this)
Added Warn feature and Torch Fireball icon for when the brightness is higher than the Warn value.
Slider no longer lags while trying to effectively "make a strobe light" by not sending broadcasts, updating views, or saving the brightness until after you take your finger off.
Slider changes color based on level.
ZTORCH-beta-2.0.0.33optimized: Technically should be: 2.0.2.33(November 16,2014) Changes:
Adds RECEIVE_BOOT_COMPLETE permission.
Ongoing Notification is available in AppPrefs.xml
TapGuard enabled by default. (Widget ignores first tap to prevent accidental taps)
ZTORCH-optimizedbeta-2.0.3.41: (November 17,2014) Changes:
New Notification AppPrefs.
ongoingNotif (Can't swipe away, Persistent).
onPriority and offPriority (levels: -2, -1, 0, 1, 2 where 2 is PRIORITY_MAX)
Shell Command Text and Toggle Button updated instantly while slider moves.
ZTorchReceiver enables you to send commands from other apps such as Tasker. Available broadcasts listed further down.
Fixed Force Close if the Main Toggle button is pressed and root was denied or the device is unsupported. (Not like you can use the app like this anyway, but still)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
BETA Version Settings
I'm still trying to figure out how android implements preferences and preference fragments. So in the beta, there is none! To change a setting, get a file browser with root access such as ES File Explorer, then navigate to the location below and edit the file "LEDPrefs.xml"
Code:
/data/data/derekziemba.ztorch/shared_prefs/
Additionally there is another file, "AppPrefs.xml" where you will find app specific settings and be able to configure the Notification.
"LEDPrefs.xml" will look like this on ZTORCH-beta-2.0.0.28. Later versions will be slightly different. I recommend uninstalling the app before installing a new beta.
default - The value the torch will turn on at when Toggled or Enabled.
inc - increment. Value the notifications "+" and "-" will increase or decrease by and the Widget will increase at if multitap = true;
multitap - If true, on successive widget taps the brightness will increase by the inc value. If false, brightness will toggle to default value;
wait - For multitap and tapguard. Time in milliseconds between successive widget taps to increase brightness. If more time than this has passed, the LED will shut off.
tapguard - To prevent accidental widget taps turning on the LED. If true, the widget ignores the first tap and waits for a second tap, unless the LED is already on.
min - just leave at 0, this is the "off" value, it is here in case some phones are reversed
max - maximum value on slider and the max value you can increment to. Only the first 3 digits of this will ever be used, giving a max possible value of 999.
warn - value at which the torch turns from yellow to a fireball and the slider begins changing colors from blue to yellow to red.
lvl - Current Brightness. There is no way to retrieve the current LED level, so the last value is stored here
sys - the system binary that controls the LED;
mask - bitmask. The brightness level is bitwise AND'ed with this value before executing the shell command to prevent invalid values. If you need help configuring this, use windows calculator and set it to programmer mode on Integer then click the bits you want to use, then use the integer value given.
"AppPrefs.xml" settings:
enableTorchOnAppLaunch - If true, opening the app will automatically set the brightness to the default value listed in "LEDPrefs.xml". Default is "false"
persistentNotif - If true, the notification will be persistent and it cannot be swiped away. Default is "false"
showNotifOnBootComplete - Posts the notification when BOOT_COMPLETE is received for easy access. Use with persistentNotif to prevent swiping away. Default is "true"
Notification Priorities. There are 5: MIN(-2), LOW(-1), DEFAULT(0), HIGH(1), and MAX(2). More info here: http://developer.android.com/design/patterns/notifications.html#guidelines
notifPriorityTorchON - Notification Priority when the LED is on. Default is "2"
notifPriorityTorchOFF - Notification Priority when the LED is off. Default is "-1". Versions before 2.0.3.41 including 1.x.x are hardcoded at "-2"
Important: Before changing any settings, be sure to kill ZTorch with a task manager. Otherwise the settings will not take effect and they will be overwritten when the app gets sent to the background.
If you mess up the settings ZTorch will force close on launch. Delete the XML file to restore defaults.
Strobe Light:
You can get some pretty cool stobbing effects by changing the "mask" and "max" settings.
If you set the "max" value to something like 200 with the mask set to 15 (0000-1111), when sliding the slidebar from 0 to 200, the actual brightness set will repeat 0-15 over and over.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Setting Brightness from other apps such as Tasker, using ZTorch's BroadcastReceiver
I still have to test if this works, but in theory it should. The ZTorchReceiver supports the actions below.
Code:
"derekziemba.ztorch.UPDATE_LEVEL"; //Service will check for extra Integer under the key "lvl" and set that brightness if it is valid.
"derekziemba.ztorch.WIDGET_TAP"; //Behave as if the widget was just tapped. MultiTap, TapGuard, and Wait apply.
"derekziemba.ztorch.STEP_UP"; //Increment Brightness by increment value
"derekziemba.ztorch.STEP_DOWN"; //Decrement Brightness by increment value
"derekziemba.ztorch.INCREASE"; //Increase Brightness by 1
"derekziemba.ztorch.DECREASE"; //Decrease Brightness by 1
"derekziemba.ztorch.ENABLE"; //Turn on torch at default level
"derekziemba.ztorch.DISABLE"; //Turn off torch
"derekziemba.ztorch.TOGGLE"; //Toggle the torch opposite its current state.
---------------------------------Internal---------------------------
"derekziemba.ztorch.UPDATE_FROM_MAIN"; //From main activity, prevents service from broadcasting UPDATE_FROM_SERVICE and cause an endless loop. Contains extra Integer under key "lvl"
"derekziemba.ztorch.UPDATE_FROM_SERVICE"; //Sent from the Service to Main, this one is Unregistered when Main is not visible. It is still sent by the service.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Important Note Regarding Brightness:
For default settings I have the max LED value set to 13 because I've experienced flicker. Values higher than 10 change the color of the slider to red and the widget and notification flame from yellow to fireball. Flicker occurs when your battery voltage is to low to support the current level of brightness.
To avoid LED flicker:
>3800+mV or ~50% is needed for Levels >=13.
> 3750mV or ~30% is needed for Levels > 9.
> 3600mV or ~10% is needed for Levels > 7.
I have used my app to work several hours in an attic at brightness 11. I used my phone because it's actually significantly brighter than every flashlight I own. That includes a flashlight with a 6V cell, a 3 LED headlamp, and a 4 battery AAA LED flashlight. My only light that beat it was my spotlight, but the spotlight's beam is too focused whereas the phone lights up everything.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note: Android displays the build version as 1 higher than the file name. So Android will show version 2.0.3.41 as 2.0.3.42. This is caused by some Gradle Build Config bug.
I use the torch a lot so I just downloaded this and I'll definitely let you know how it goes. Thanks!
Verizon S4
Liquid Smooth 4.4
Sprint S4
Negalite 4.4
Great app. Been using it for a few days with no issues. Love the incremental increases/decreases.
Anyway to get this to stay in the notification drop down?
Sent from my SCH-I545 using Tapatalk 2
rahilkalim said:
Great app. Been using it for a few days with no issues. Love the incremental increases/decreases.
Anyway to get this to stay in the notification drop down?
Sent from my SCH-I545 using Tapatalk 2
Click to expand...
Click to collapse
I might be able to implement that as a setting quick when I get home. And maybe add an option to make it half height too if it's going to be persistent.
DerekZ10 said:
I might be able to implement that as a setting quick when I get home. And maybe add an option to make it half height too if it's going to be persistent.
Click to expand...
Click to collapse
That would be great. Thanks.
Sent from my SCH-I545 using Tapatalk 2
rahilkalim said:
That would be great. Thanks.
Sent from my SCH-I545 using Tapatalk 2
Click to expand...
Click to collapse
Just updated it. Here's what's new:
Settings Activity has had a makeover. The question mark on the side will explain what the settings do. The image on the left shows what it looks like if the Persistent Notification and the Minimizing Notification toggles are enabled. The right shows what it looks like with the Minimizing Notification toggle off. Notice that when the Minimizing Notification toggle is disabled, zTorch's icon is in the notification bar.
Here is what zTorch looks like in the notification drop down with minimization enabled. The left screenshot is with zTorch minimized. In this state the icon is not in the notification bar. The screenshot ion the right shows the notification expanded with the minimize option enabled, In this state the icon will show up in the notification bar.
Disabling Notification minimization but keeping Persistent notification enabled will cause the notification to appear like the left and middle screenshots. When the Torch is off, only an Activate LED button is present. If there are a large number of other notification, the notification will shrink up. With the Torch on more buttons become available as seen in the middle screenshot. The rightmost screenshot is the notification with both the persistent notification and notification minimization disabled.
Note: This version 1.2.0 has some rough edges. I'll polish it when I have more time. In the future the Settings activity will also be changed to an actual Android Settings layout instead of a generic layout.
EDIT: Version 1.2.1 rounds out those edges.
Now that school is out, I'll be updating and posting the source code on github soon
DerekZ10 said:
Now that school is out, I'll be updating and posting the source code on github soon
Click to expand...
Click to collapse
Great job, works great!
This looks great. Do you have any plans to update this for nc5 4.4.2 compatibility?
Sent from my SCH-I545 using Tapatalk
klabit87 said:
This looks great. Do you have any plans to update this for nc5 4.4.2 compatibility?
Sent from my SCH-I545 using Tapatalk
Click to expand...
Click to collapse
This is why I wanna get the source code up. So others can compile it for their versions. I'm running Android 4.2.2 Eclipse 2.0 Rom. It's all customized and set up the way I like, and it's been very reliable. I'm not sure when I will get around to upgrading. Every rom I have tried as a replacement has had problems.
I haven't got around to posting the source code because there was suddenly some issues with the build? I opened the project the other day and was told I needed to upgrade things, I did and now every object and include directive is underlined in red. I looked at it for about a minute before deciding I'll figure it out some other day. Haven't got around to it since.
Oh ok. I was just wondering. Looking forward to the source so we can have it work for updated android versions someday.
Thanks.
Sent from my SCH-I545 using Tapatalk
klabit87 said:
Oh ok. I was just wondering. Looking forward to the source so we can have it work for updated android versions someday.
Thanks.
Sent from my SCH-I545 using Tapatalk
Click to expand...
Click to collapse
Here's the Source Code Everyone, Good Luck! Everything for the project should be on GitHub including external libraries and the .psd files for the icons.
https://github.com/DerekZiemba/zTorch
I haven't been able to build this or other projects since upgrading the SDK and the Eclipse ADT. I'm not getting any errors, I just get "export build failed." Not sure what to do, maybe reinstall everything. Hopefully someone here can get it working. I just really don't have enough time. In fact the whole project was born out of procrastinating a huge report I didn't want to do for school.
I have everything working again and the source code should build the most stable recent version. The 1.3 beta version is on my dropbox now. This version is a work in progress and the new TorchPlayer feature is not in a working state, but everything else works as usual.
I'm releasing this build before this new feature is working so people with newer versions of android can use the apps pre-existing features.
Here is basically what TorchPlayer is and how it will effect the app in future versions:
Once working properly it will be used to define increment steps for things such as rapid-tap and consecutive-tap (currently double-tap). The time element of these steps will define the max time the LED will stay lit before (likely) dropping down a step. It will be a way to prevent the LED being lit in your pocket all day and limiting the max LED brightness to a defined time.
TorchPlayer will eventually allow you to name and save sequences and have a repeat mode so you can use it as a strobe light. I'm not sure yet how fast the LED can be switched on and off. I might also look into having the sequence controlled by Morse code using dots and dashes.
For this to work I have to figure out, basically, multi-threading(handlers, runnables, threads) and a few other things such as Gson or SQLite.
NOTE: Installing this version messed up my widget. If it happens to you just delete it and re add it to fix.
Shown below is version 1.3 beta 4. I've found that I can strobe the led light ridiculously fast. I haven't encountered the limit yet at even the 5 millisecond intervals. At 5millis the LED is flashing so fast that it is almost becoming steady. With this it may be possible to set custom "LightTones" for certain things like you do with ring tones.
EDIT:
Beta 5 added ability to duplicate several values to save on typing as seen below: Also note, the parenthesis and spaces don't actually matter and are only there to make it easier on me to read. The input is sanitized using: String scheme = behavior.replaceAll("[^0-9/sm,.*&]+",""); So only numbers, the letters s and m, and the symbols / , . * & matter. If a brightness value is out of range that command is ignored.
Here is a video of what the above TorchPlayer string yields.
https://www.youtube.com/watch?v=c1lwTHZwr-M&feature=youtu.be
DerekZ10 said:
I have everything working again and the source code should build the most stable recent version. The 1.3 beta version is on my dropbox now. This version is a work in progress and the new TorchPlayer feature is not in a working state, but everything else works as usual.
I'm releasing this build before this new feature is working so people with newer versions of android can use the apps pre-existing features.
Here is basically what TorchPlayer is and how it will effect the app in future versions:
Once working properly it will be used to define increment steps for things such as rapid-tap and consecutive-tap (currently double-tap). The time element of these steps will define the max time the LED will stay lit before (likely) dropping down a step. It will be a way to prevent the LED being lit in your pocket all day and limiting the max LED brightness to a defined time.
TorchPlayer will eventually allow you to name and save sequences and have a repeat mode so you can use it as a strobe light. I'm not sure yet how fast the LED can be switched on and off. I might also look into having the sequence controlled by Morse code using dots and dashes.
For this to work I have to figure out, basically, multi-threading(handlers, runnables, threads) and a few other things such as Gson or SQLite.
NOTE: Installing this version messed up my widget. If it happens to you just delete it and re add it to fix.
Click to expand...
Click to collapse
For some reason the toggle doesn't show in my drop down now, any ideas?
shindiggity said:
For some reason the toggle doesn't show in my drop down now, any ideas?
Click to expand...
Click to collapse
Just confirmed it is a bug. To get the notification to show you need to switch the torch on once. It'll stay in the dropdown after.
I'll try to get a new build together soon. I learned a few things about Android the other day that made me realize my code was overly complicated and difficult to work with, much more so than it ever needed to be. So I actually started a total rewrite since that version that I want to get perfect.
The new version is a different app all together, the system and launcher will see it as zTorch-L. The L stands for it really being the "Lite" version, in app it will refer to it self as zTorch-Lightning. I decided that the TorchPlayer feature went against the whole purpose of making my own app in the first place. I created it to be fast, simple, no-bs or bugs, do one thing and do it well. What I wanted out of TorchPlayer would cause the app to loose focus of its goal, so I started this new version that would be just that.
Because I want it to be totally finished before releasing, I'm not going to post a link to it here. The code wouldn't even compile if I tried. But if you really rely on the notification being in the dropdown PM me. I have an alpha version I compiled before going to far in to rewriting the code. Everything works great AFTER some tweaking first.
Initially it is inoperable unless, starting from the root directory, you navigate to the following file:
Code:
/data/data/derekziemba.ztorchL/shared_prefs/derekziemba.ztorchL_preferences.xml
Open it, delete what ever is in it, then paste the below text :
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="flash_current_value" value="0" />
<int name="tap_time" value="900" />
<int name="brightness_increment_steps" value="3" />
<int name="default_value" value="8" />
<int name="flash_limit_value" value="13" />
<boolean name="rapid_tap" value="true" />
<boolean name="persistent_notif" value="true" />
<boolean name="mini_notif" value="true" />
</map>
I sent you a PM, be happy too.
DerekZ10 said:
Just confirmed it is a bug. To get the notification to show you need to switch the torch on once. It'll stay in the dropdown after.
I'll try to get a new build together soon. I learned a few things about Android the other day that made me realize my code was overly complicated and difficult to work with, much more so than it ever needed to be. So I actually started a total rewrite since that version that I want to get perfect.
The new version is a different app all together, the system and launcher will see it as zTorch-L. The L stands for it really being the "Lite" version, in app it will refer to it self as zTorch-Lightning. I decided that the TorchPlayer feature went against the whole purpose of making my own app in the first place. I created it to be fast, simple, no-bs or bugs, do one thing and do it well. What I wanted out of TorchPlayer would cause the app to loose focus of its goal, so I started this new version that would be just that.
Because I want it to be totally finished before releasing, I'm not going to post a link to it here. The code wouldn't even compile if I tried. But if you really rely on the notification being in the dropdown PM me. I have an alpha version I compiled before going to far in to rewriting the code. Everything works great AFTER some tweaking first.
Initially it is inoperable unless, starting from the root directory, you navigate to the following file:
Code:
/data/data/derekziemba.ztorchL/shared_prefs/derekziemba.ztorchL_preferences.xml
Open it, delete what ever is in it, then paste the below text :
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="flash_current_value" value="0" />
<int name="tap_time" value="900" />
<int name="brightness_increment_steps" value="3" />
<int name="default_value" value="8" />
<int name="flash_limit_value" value="13" />
<boolean name="rapid_tap" value="true" />
<boolean name="persistent_notif" value="true" />
<boolean name="mini_notif" value="true" />
</map>
Click to expand...
Click to collapse
shindiggity said:
I sent you a PM, be happy too.
Click to expand...
Click to collapse
So you guys don't have to keep using that version if you don't want to, try the zTorch-Lightning_v1.Alpha2 . There's a lot of stuff to do yet, but all the basics are working.
You'll notice the notification is way more responsive and that it no longer does that thing "refresh flash" when switching to different notification styles. It responds instantly to setting changes now too.
When tapping the 1x1 incremental widget, the LED is now set to turn on before the system broadcast and before the on screen widget lights up instead of the other way around.
http://db.orangedox.com/FBzt4wNNfVu1xIMc0W/zTorch-Lightning_v1.Alpha2.apk
This is just what i have been looking for!! So what kind of licensing is your code on git under?
Adjustable flash brightness is just what i want to look adding to my Camera app. I need something lower intensity than the stock.
Unfortunately, I am unable to test this app as my rooted devices don't have flash.
hotspot_volcano said:
This is just what i have been looking for!! So what kind of licensing is your code on git under?
Adjustable flash brightness is just what i want to look adding to my Camera app. I need something lower intensity than the stock.
Unfortunately, I am unable to test this app as my rooted devices don't have flash.
Click to expand...
Click to collapse
Free to use as long as you don't repackage it as is but with ads or put a price on the app. However if you are creating your own app and just want to use the flashlight feature, you can use the below code however you want. I think the git code is way out of date, I worked on it a bit a while ago and I don't think I comited it. I've gotten busy and haven't had a chance to work on it in months.
Here is the code for directly changing the brightness. Free to Use however you wish.
Here is the Shell Class. The Static Methods create and maintain the superuser shell. Therefor a command can be executed app wide on a single shell instead of creating multiple Shell instances.
Code:
package derekziemba.misc;
import java.io.*;
public class Shell {
private static Shell rootShell = null;
private final Process proc;
private final OutputStreamWriter writer;
private Shell() throws IOException {//Open with Root Privileges
this.proc = new ProcessBuilder("su").redirectErrorStream(true).start();
this.writer = new OutputStreamWriter(this.proc.getOutputStream(), "UTF-8");
}
private void cmd(String command) {
try{ writer.write(command+'\n'); writer.flush();}
catch(IOException e) { }
}
public void close() {
try {
if (writer != null) { writer.close();
if(proc != null) { proc.destroy(); }
}
} catch (IOException ignore) {}
}
public static void exec(String command) { Shell.get().cmd(command); }
public static Shell get() {
if (rootShell == null) {
while (rootShell == null) {
try { rootShell = new Shell(); }
catch (IOException e) { }
}
}
return rootShell;
}
}
}
Here is what is used for setting the flash brightness. I stripped out all the app logic. SetLevelCovertly is the actual method used for setting the brightness. It is what the TorchPlayer uses to directly change the brightness in just milliseconds. The stripped away normal SetLevel method records the brightness, triggers the broadcasts, sets the widgets, and fires the notification. There is no way of getting the current flashlevel brightness since my Shell implementation is just for blasting commands at the terminal. Anything more will slow it down.
The listOfFlashFiles is a bunch of different files different phones may use. I've only ever tested the samsung file.
Code:
import java.io.File;
import derekziemba.misc.Shell;
public class Torch
{
private static String FLASH_FILE = null;
private static final String[] listOfFlashFiles = {
"/sys/class/camera/flash/rear_flash",
"/sys/class/camera/rear/rear_flash",
"/sys/class/leds/flashlight/brightness",
"/sys/devices/platform/flashlight.0/leds/flashlight/brightness",
"/sys/class/leds/spotlight/brightness",
"/sys/class/leds/torch-flash/flash_light"
};
/**
* Bypasses all checks and settings and just sets the value. The app will not know what the level is because it is not recorded.
* Will not trigger broadcast, widget views, notification
*/
public static void setLevelCovertly(int value) { Shell.exec("echo " + value + " > "+ getSysFsFile()); }
public static String getSysFsFile() {
if (FLASH_FILE != null) return FLASH_FILE;
for (String filePath : listOfFlashFiles) {
File flashFile = new File(filePath);
if (flashFile.exists()) { FLASH_FILE = filePath; }
}
return FLASH_FILE;
}

One simple edit to enable the manual mode in the camera [6.0, maybe also earlier]

guys, when i was playing with the new 45A rom, i accidentally found an interesting file called camera_config.xml
this file is located in /system/etc/ and the name is quite self-explanatory. when looking into this file, i found one section that i can play with:
Code:
<!-- Manual mode *************************************************** -->
<item name="manual_mode_supported">
false
</item>
so what i did is simply change it into true and restarted my phone.
then the manual mode is available in camera. see the screenshot attached.
at least i can confirm, manual focus, exposure is working, and shutter timer is NOT working...
maybe someone can help to investigate the file or other files related
thanks it does enable the manual mode, but looks like the only thing that works is exposure +/-
Seems to ignore everything else even though you can change the settings.
You should move this to the general section so more people will be involved in working with this.
Sent from my LG-D855 using Tapatalk

replacing framework-res.apk without nuking my phone :)

Im working on modding the auto brightness values in framework-res.apk because i find the stock values to be too dim in a medium lit room and too bright in a dark room.
i find alot of tutorials but they are older so im trying to check in to see if this is still valid.
i used this guide http://forum.xda-developers.com/showthread.php?t=1806602 to decompile and then edited res/values/arrays.xml and then recompiled.
then i used 7zip to copy the META-INF folder and AndroidManifest.xml from the original framework-res.apk to the new one.
so now i want to swap them out and avoid bootloops and stuff.
so i see this guide. http://www.androidtablets.net/threads/how-to-manually-replace-framework-res-apk-on-stock-roms.43716/
should this work?
im not sure how to create a flashable zip... again i see alot of tutorials but they are older so im not sure they are valid and wont bork my phone.
thx
Brian
Ok I manned up and tried it especially since I had a nandroid bavkuo. it looks like it worked ok. It started crashing out after I replaced the file but after a reboot its working so far.
We'll see how it works in varying light conditions.
Brian
i didnt nuke my phone but the lowest brightness is still at 50.... which is too high.
back to the drawing board.... ie dig through the guys flashable zip that did it already here... http://forum.xda-developers.com/lg-g3/development/mod-lower-autobrightness-values-t3054000
Brian
this is more my ramblings and thinking outloud than a question.... but i think i may have found it.
i only edited arrays.xml to this:
Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>10</item>
<item>40</item>
<item>90</item>
<item>130</item>
<item>160</item>
<item>190</item>
<item>205</item>
<item>220</item>
<item>235</item>
<item>245</item>
<item>255</item>
</integer-array>
but i didnt change integers.xml
Code:
<integer name="config_screenBrightnessSettingMinimum">50</integer>
or this
Code:
integer name="config_screenBrightnessDim">50</integer>
so when logging a logcat and covering the sensor, i could see the brightness only get down to 50 after i paused it and scrolled through the log.
now i changed those values both to 10 and im going to test again.
Brian
ok i changed the values in arrays.xml as set above and in integers.xml set the above values to 10 and then followed the guides earlier in the thread and it worked.
while running catlog, i can see the display brightness be commanded down to 10 when i cover the sensors on the top of the phone.
i have the middle ambient light levels pumped up a bit and the low light alot less than stock and it seems to be just about where i can leave it on auto all the time and have good brightness.
if someone wants to move this thread to another section if it is applicable, go ahead.
Brian

How to increase the User accounts

Hello,
on a Note8 i can only create 5 User profiles
I change in build.prop fw.max_users=10
but it has no effects.
I read that:
As of Android 5.0, the multi-user feature is disabled by default. To enable it, device manufacturers must define a resource overlay that replaces the following values in frameworks/base/core/res/res/values/config.xml:
<!-- Maximum number of supported users -->
<integer name="config_multiuserMaximumUsers">1</integer>
Were can i change that?

Categories

Resources