I am trying to figure out how to use the <selector> resource to change custom button images depending on the state of the button. I have created button_up.9.png, button_down.9.png, button_disabled.9.png and put them in the drawable folder.
I then created this button.xml file in the drawable folder:
Code:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_enabled="false"
android:drawable="@drawable/button_disabled" />
<item
android:state_pressed="true"
android:state_enabled="true"
android:drawable="@drawable/button_down" />
<item
android:state_focused="true"
android:state_enabled="true"
android:drawable="@drawable/button_up" />
<item
android:state_enabled="true"
android:drawable="@drawable/button_up" />
</selector>
Eclipse does not like this xml file and spits out:
Code:
error: Found tag selector where item is expected
This seems to be how all the examples I have found define their selector xml file, what am I doing wrong?
Edit:
Eclipse is no longer giving me the error above but is giving me this error on the closing </selector>:
Code:
Multiple annotations found at this line:
- error: Error parsing XML: not well-formed (invalid
token)
- Content is not allowed in trailing section.
Ok, this is really strange. I just took the xml code I had pasted above and copied it over the same code in button.xml. This time it didn't give me any errors and I can now use the selector in my layout without a problem. Does anyone know why Eclipse would have been showing these incorrect xml errors?
im working on a launcher app but have ran into a problem.
right now i am working on removing the title bar. in the res/values/ folder i have to create a styles.xml file containing this code: <?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme" parent="android:Theme">
<item name="android:windowNoTitle">true</item>
</style>
</resources>
i put that code in but im getting an error on the last line saying: Premature end of line. Error parsing XML: element not found.
any ideas to why?
Someone asked about how to change and edit the language settings for sense based roms, so I thought I'd write a small guide.
This seems to only work for Sense 2 roms
The language and locale settings for sense based roms have to do with the cid, which tells where the phone is from.
First off, we need to know your backup-cid, which can be found by putting:
Code:
dd if=/dev/block/mmcblk0p17 bs=1 count=8 2>/dev/null; echo
in either adb shell, or terminal emulator.
This will spit out an 8 character string, which will be something like "HTC__001"
Next, the cid files are stored in /system/customize/CID/ on the phone in xml format. They are not too hard to modify with a text editor, and you should be able to work out what values you want where.
Code:
<?xml version="1.0" encoding="utf-8"?>
<customization_form>
<category name="system">
<module name="locale">
<function>
<set name="single">
<item name="total_list">[COLOR="Red"]en_NZ;en_AU;en_GB;en_US;fr_FR;[/COLOR]</item>
<item type="boolean" name="[COLOR="Red"]en_NZ[/COLOR]">yes</item>
<item type="boolean" name="[COLOR="Red"]en_AU[/COLOR]">yes</item>
<item type="boolean" name="[COLOR="Red"]en_GB[/COLOR]">yes</item>
<item type="boolean" name="[COLOR="Red"]en_US[/COLOR]">yes</item>
<item type="boolean" name="[COLOR="Red"]fr_FR[/COLOR]">yes</item>
</set>
</function>
</module>
That is part of my modified cid.xml, the parts you want to change are in red.
Now, I don't know if we can just swap out the new cid.xml file, and re-run the setup after a reboot to get our language options.
What I did was create a flashable zip to replace the cid.xml file after installing a sense rom.
I have attached a zip, so you just open it up, and swap out the file in zip/system/customize/CID/ with a modified cid.xml, and then flash the zip after flashing a sense rom.
-Nipqer
Nipqer said:
Someone asked about how to change and edit the language settings for sense based roms, so I thought I'd write a small guide.
This seems to only work for Sense 2 roms
The language and locale settings for sense based roms have to do with the cid, which tells where the phone is from.
First off, we need to know your backup-cid, which can be found by putting:
Code:
dd if=/dev/block/mmcblk0p17 bs=1 count=8 2>/dev/null; echo
in either adb shell, or terminal emulator.
This will spit out an 8 character string, which will be something like "HTC__001"
Next, the cid files are stored in /system/customize/CID/ on the phone in xml format. They are not too hard to modify with a text editor, and you should be able to work out what values you want where.
Code:
<?xml version="1.0" encoding="utf-8"?>
<customization_form>
<category name="system">
<module name="locale">
<function>
<set name="single">
<item name="total_list">[COLOR="Red"]en_NZ;en_AU;en_GB;en_US;fr_FR;[/COLOR]</item>
<item type="boolean" name="[COLOR="Red"]en_NZ[/COLOR]">yes</item>
<item type="boolean" name="[COLOR="Red"]en_AU[/COLOR]">yes</item>
<item type="boolean" name="[COLOR="Red"]en_GB[/COLOR]">yes</item>
<item type="boolean" name="[COLOR="Red"]en_US[/COLOR]">yes</item>
<item type="boolean" name="[COLOR="Red"]fr_FR[/COLOR]">yes</item>
</set>
</function>
</module>
That is part of my modified cid.xml, the parts you want to change are in red.
Now, I don't know if we can just swap out the new cid.xml file, and re-run the setup after a reboot to get our language options.
What I did was create a flashable zip to replace the cid.xml file after installing a sense rom.
I have attached a zip, so you just open it up, and swap out the file in zip/system/customize/CID/ with a modified cid.xml, and then flash the zip after flashing a sense rom.
-Nipqer
Click to expand...
Click to collapse
ooohhh yeeees, it works great
thx
---------- Post added at 10:13 PM ---------- Previous post was at 10:06 PM ----------
Do you know how I can change the hardware keyboard language? Can I disable the spelling or set it to german?
I'm not sure exactly, but look under Language & Keyboard settings, and I think it's under the dafault soft keyboard settings that the Hardware keyboard settings are kept.
I'm running cyanogen at the moment, so this is only from memory for sense.
-Nipqer
Nipqer said:
I'm not sure exactly, but look under Language & Keyboard settings, and I think it's under the dafault soft keyboard settings that the Hardware keyboard settings are kept.
I'm running cyanogen at the moment, so this is only from memory for sense.
-Nipqer
Click to expand...
Click to collapse
thats not possible, I can only select englisch ...
should I delete some files with the rootexplorer , under system/usr .. ?
hi,
in different customization of the same device for region or operator , we find some option in system configuration enabled in some and other no then we can do it by changing variable value in application files in system by decompiling and recompiling after modifying ( bools or arrays...etc ) it take a lot of time
so customization Sony has choose to make a little files for a region customization or enabling or disabling option in system app without modifying the original app file by using {real_application_name}-res.apk what will be adding in /system/vendor/overlay
in 4.0.4 and before sony ericsson used /system/etc/customization/ folder for enabling and parameterizing apps, so in JB 4.2 and 4.3or 4.4 these files are incompatible only 4.3 and 4.4 are compatible (attached files)
for JB 4.2
4.3 and 4.4
How to use ??
example :
for enabling data traffic notification and status icon in status bar we must change in or semcphone.apk phone.apk this line after decompiling Phone.apk or SemcPhone.apk in res/value/bools/xml we find a default value of application :
Code:
<bool name="data_connection_except_mms_can_clear_icon">true</bool>
<bool name="data_connection_except_mms_show_icon_when_disabled">true</bool>
<bool name="data_connection_except_mms_show_icon_when_enabled">false</bool>
Click to expand...
Click to collapse
they must be change to :
Code:
<bool name="data_connection_except_mms_can_clear_icon">false</bool> ----->[COLOR="red"] icon always visible can't be removed[/COLOR]
<bool name="data_connection_except_mms_show_icon_when_disabled">true</bool>
<bool name="data_connection_except_mms_show_icon_when_enabled">true</bool>
Click to expand...
Click to collapse
then it can be inserted in com.phone-res.apk and injected in system/vendor/overlay and rebooting after that the options are activated.
just know what value to want be activated in the main application apk
Another exemple :
in this post http://forum.xda-developers.com/showthread.php?t=2703113 to have mod for activating low cost in conversations.apk but with decompiling main apk conversations.apk but the simple one is using -res.apk
default value are :
Code:
<bool name="character_conversion">false</bool>
<bool name="character_conversion_visibility">false</bool>
Click to expand...
Click to collapse
and must be changed to
Code:
<bool name="character_conversion">true</bool>
<bool name="character_conversion_visibility">true</bool>
Click to expand...
Click to collapse
then modifing com.sonyericsson.conversations-res.apk
after decomiling
we have
Code:
[CODE]
[/CODE]
res
|-------> bools.xml -------------> to be modified
|-------> public.xml ---------------important contains all variable defined
bools.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="three_digit_number_linkify">true</bool>
<bool name="delivery_report">true</bool>
<bool name="mms_retrieval_during_roaming_visibility">true</bool>
[COLOR="Red"]<bool name="character_conversion">true</bool>
<bool name="character_conversion_visibility">true</bool>[/COLOR]
</resources>
public.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="bool" name="three_digit_number_linkify" id="0x7f020000" />
<public type="bool" name="delivery_report" id="0x7f020001" />
<public type="bool" name="mms_retrieval_during_roaming_visibility" id="0x7f020002" />
[COLOR="red"]<public type="bool" name="character_conversion" id="0x7f020003" />
<public type="bool" name="character_conversion_visibility" id="0x7f020004" />[/COLOR]
<public type="bool" name="enable_send_empty_message" id="0x7f020005" />
<public type="integer" name="max_recipients" id="0x7f030000" />
<public type="integer" name="mms_max_size" id="0x7f030001" />
<public type="integer" name="sms_max_segments" id="0x7f030002" />
<public type="integer" name="mms_trigger_sms_segments" id="0x7f030003" />
</resources>
and recompile , push it in system/vendor/overlay and done.
All,
steps to enable speed dial on Sony Xperia Z1 compact
Speeddial is enabled on D5503_14.4.A.0.157_R4C_RU
But disabled on D5503_14.4.A.0.157_Baltic
After I have copied "com.sonyericsson.android.socialphonebook-res.apk" to system/vendor/overlay folder I got speeddial with 99 positions.
This apk file must have the following files:
\res\values\bools.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="enable_speed_dial">true</bool>
</resources>
and \res\values\public.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="bool" name="enable_speed_dial" id="0x7f020000" />
</resources>