[Project] Incoming MMS Picture Size Fix - XPERIA X10 Android Development

Hey all, this would probably be only interesting to those who are receiving 2kb, 160x120 MMS messages. Using TMO-USA as an example, the X10 received large MMS images with 1.6, but I'm guessing it doesn't recognize the uaprofile of 2.1 and now are getting tiny mms images. This could also help others on other networks that have the same problem.
Cyanogenmod has an option to switch the profile. Someone else on XDA has posted some of the changes, and those can be found here.
I'm thinking that since I don't think we can compile a new mms.apk, maybe it's possible to edit the current mms.apk with the uaprofile from a different phone (probably the t717/equinox for the tmo users)? Hopefully it's not encrypted or anything either...
So off I go into root explorer and I can't find any mms.apk in my x10. hmm, so i adb shell into it and still no mms.apk. I can't get too far if I can't find the mms application, lol.
so does anyone know what SE uses for mms? or if I'm just simply not seeing it?
obviously, i'm new to working with android, i'll pick up more as time goes on thanks for any help!

Bah! Just in case anyone else looks, I think I found it... sigh.
I searched through the /data/data/ folder and found a reference to 'ericssson' (part of what would be the normal uaprofile text) in com.sonyericsson.converstations_preferences.xml... converstations, eh? makes sense... and yes, there's a converstations.apk
so far i've unzipped it and found 'mms_config.xml' that has max file size and dimensions... but i think this might be only for outgoing mms...

I could be wrong, but isn't it conversations.apk
EDIT: nevermind, looks like you already found it lol

Curious
Thanks for trying to work on it. I would love to have a fix to these small picture messages on T-mo US. But is it possible that the small picture sizes have something to do with T-mo's services somehow???

motibbs96 said:
Thanks for trying to work on it. I would love to have a fix to these small picture messages on T-mo US. But is it possible that the small picture sizes have something to do with T-mo's services somehow???
Click to expand...
Click to collapse
It was working fine with 1.6 but when the X10 jumped up to 2.1, mms images were small. So to me, that means that the tmobile no longer recognizes the phone and it goes automatically downsizing all incoming images.
What I'm not sure is if TMO checks the url of the phone's uaprof or if it just looks at the url and just checks it against their own database. I'm thinking the latter.
Another thought might be if TMO just looks at the specs that the phone gives. The reason for this last question is because X10 1.6 had a max size of 640x480 (not sure if this was receiving or sending) at 1 meg (tmo only handles 300k max). with X10 2.1, it states a max size of 1600x1200 and a max size of 1 meg. Maybe it thinks 1600x1200 is too big and it hits some trigger on TMO's side to only send the fallback size (160x120)
I would recommend emailing customer service (and for anyone else having the same issue with their respective provider) and seeing if they can add the uaprof of the x10i (url) to their database. I know this UAprof is from the v24 update. I'm not sure if it's any different for the DT update or the first 2.1 update. It's not a permanent solution but it's all we have for now.

I thought I'd also post an update, in case if anyone has any thoughts on what I might be doing wrong or helpful tips.
I searched the entire system directory for any text within the files that might relate to uaprof or udp or anything like that. Nothing. I think in 'normal' Android builds have a mm_property.conf file where we can change the uaprof info. So for now, I'm concentrating on converstations.apk and that specific file isn't located there (or anywhere). SE has to store this info somewhere so I think it's in a different conf file. But for the hell of it, I did a hex search for anything that might be related to uaprof (just in case a text search missed something). Again, nothing.
SE encrypted converstations.apk. So if it's in there somewhere, we have to decrypt it first. I'm looking into and reading on decrypting and repackaging the apk. Seems easy enough - I just need to learn a little more.

APN Settings
Name: T-Mobile US
APN: epc.tmobile.com
Proxy: 216.155.165.050
Port: 8080
Username: (leave this blank)
Password: (leave this blank)
Server: (leave this blank)
MMSC: http://mms.msg.eng.t-mobile.com/mms/wapenc
MMS Proxy: 216.155.165.050
MMS Port: 8080
MMS Protocol: WAP 2.0 (don't know if this is important)
MCC: 310
MNC: 260
APN Type: (leave this blank)
To create APN settings for your Xperia.
1. Go to 'Settings'
2. Select 'Wireless & networks'
3. Browse down to 'Mobile networks'
4. Browse down to 'Access Point Names'
5. Click the Menu (Left) button
6. Select 'New APN'
7. Key in the detail relating to your provider or carrier
8. Then press the radio button to select it
9. Save settings, reboot phone.
To test your network dial the following on your phone dial keypad to get into test mode: *#*#4636#*#*

Thanks for the help, but the issue isn't an APN setting. Just for giggles, I went ahead and changed the default APN settings to this and can confirm that it still receives small images.
So far I've decompiled the apk but haven't found the settings I need to change

Alright. So I've *properly* decompiled the apk (I'm working on the newest X10i build, v435). It references the UXprof url from framework-res.apk. I found where the url is in that file and changed it to the url for the Tmobile G2 (just to see if that change will work). Unfortunately, I need to recompile framework-res.apk and from everything I've read, it's recommended not to do that.
I'll keep on reading to see if I can do it, but has anyone recompiled framework-res.apk for the x10?

totalundone said:
Alright. So I've *properly* decompiled the apk (I'm working on the newest X10i build, v435). It references the UXprof url from framework-res.apk. I found where the url is in that file and changed it to the url for the Tmobile G2 (just to see if that change will work). Unfortunately, I need to recompile framework-res.apk and from everything I've read, it's recommended not to do that.
I'll keep on reading to see if I can do it, but has anyone recompiled framework-res.apk for the x10?
Click to expand...
Click to collapse
I've dealt with framework-res.apk before. It was just to add the Super Circle Battery, but I can tell you what works.
Compiling the APK seems to encrypt the XML files one by one. If you change any of the resources (like adding images), then you also need to compile a new resources.asrc. Fortunately, since it's a system file, you don't need to sign the APK.
Check this thread for lots of good info on modifying framework-res.apk (thanks to _calum_ and MrRusch):
http://forum.xda-developers.com/showthread.php?t=834806
Important points:
- The XML files and resources.asrc need to be compiled.
- The APK doesn't need to be signed.
- You can compile the XML and resources.asrc with APK Manager, then extract them from the "unsigned" APK it creates, and then reinsert them into a copy of the original APK using WinRAR (or your favorite zip tool).
- Compression should be set to "store" (a.k.a. no compression).
Be sure to have a backup copy of your original framework-res.apk. It's best to leave a copy on your SD card somewhere.
Be careful when replacing framework-res.apk. Copying it with Root Explorer isn't a good idea. I think the permissions get screwed up or something, and you don't have time to change it because it reboots right away. It's better to copy it onto your SD card and use the dd command through ADB.
adb shell dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk
Click to expand...
Click to collapse
If you mess up, then you may not be able to boot the phone. Don't panic. ADB is still available even when it hasn't booted yet, so just use dd to replace it with your old one.

wow, i never would've thought the picture sizes had to do with my phone. hope you find a fix for this!

Thanks Grospolina! That info should help me a lot.
I actually tried to use root explorer at first... LOL. Stuck at the SE screen and I thought I bricked the phone but found out that my USB port on the monitor has quit working... Wasted a couple hours there. Sigh, lol.
I was using apktool since it's supposed to be framework-res.apk friendly but it kept on compressing the apk. I tried to adb push the file but it kept on saying I didn't have permissions. So I ended up using xrecovery to 'restore' the file in update.zip. I did a test mms but it was still small so I went ahead an cleared the davlik cache. I checked the file size of the modified framework-res.apk but either clearing the cache brought the original apk back or xrecovery update didn't work because the file size was the same as the original (apktools shrunk it down to nearly half).
anyways, I'll try it with that adb line.
There is one issue though. If I open up the original framework-res.apk file in 7zip, the file I need to edit doesn't appear. I'll try this but am not sure what to do if the xml file I need to replace doesn't appear.

bah, i can't ever get adb to replace a file. it always says that it's not writeable and then when i get su permission set, some other error happens. I'll figure it out... still reading... typical adb newbie issue, haha.
I don't have enough time right now (or in the next day) to keep on working on this but if anyone on tmobile usa with an xperia x10 wants to give it a shot, I've linked the apk below. The only change I've done so far is change a couple lines in style.xml. I'm not sure this is it for sure, but I can't rule it out yet.

sorry not trying to be rude or nething but i think you should say that this post is about the picture size...cuz a lot of times iv noticed that when you flash it erases your apn settings which is what you need to receive mms messeges in in the first place... just a thought

No offense taken!
I edited the title to reflect that it's to fix incoming picture mms size.
I hope you don't take offense, but this ISN'T an APN settings issue. I explained it several times earlier and it's been brought up before. It's a problem that been mitigated with custom roms because they have the ability to change their uaprof to something the network recognizes.
Several networks, one of which includes TMobile USA, default to a MMS picture size of 160x120 if it doesn't recognize the phone. This project's intention is to change the default uaprof in order for Tmobile USA (and eventually any other providers) to a uaprof of a supported handset.

mms - framework-res.apk - custom
I was totally on the wrong track with APN settings. Admit I saw MMS and jumped the gun without searching on anything. Had just been through all the baseband compatibility issues and APN setting seemed related
http://forum.xda-developers.com/showthread.php?t=830102 - theeedy - good job working with the settings on the Semc Camera Application, related in the compression of images taken by the default camera.
http://forum.xda-developers.com/attachment.php?attachmentid=355818&d=1278461264
This is MMS.apk - it's an interesting modification, couldn't find it easily within my phone.. decompiling it broke with Unknown Resources, which of course is referencing - /system/framework/framework-res.apk
I think it's related to someone's custom Framework-res.apk and used the default Android MMS app for ease of modifications. I'd say that could be the way to go about this and using the Android SDK in Eclipse or Netbeans is probably the right track.. not APN settings... sheesh! - Grospolina is on the money
package="com.android.mms"
Here are permission sections - might make sense..
Code:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECEIVE_MMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_DRM" />
<uses-permission android:name="com.sonyericsson.android.permission.SEMC_BACKUP_SERVICE" />
<uses-permission android:name="com.sonyericsson.android.permission.SEMC_CUSTOM_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_WAP_PUSH" />
<uses-permission android:name="com.android.mms.wap.permission.READ_PUSH" />
<uses-permission android:name="com.android.mms.wap.permission.WRITE_PUSH" />
<permission android:name="com.android.mms.wap.permission.READ_PUSH" android:protectionLevel="signatureOrSystem" />
<permission android:name="com.android.mms.wap.permission.WRITE_PUSH" android:protectionLevel="signatureOrSystem" />
Now your creating your own Framework-res, you need to know the parts that your looking for and what to do with them.. roughly..
Code:
<service android:name="MmsService" android:permission="com.sonyericsson.android.permission.SEMC_CUSTOM_SETTINGS">
<intent-filter>
<action android:name="com.android.mms.MMS_CUSTOM" />
<action android:name="com.android.mms.MMS_SERVICE" />
</intent-filter>
</service>
From here you can define the properties that you need in the RES layout.. you need something along the lines of this in a file called - image_attachment_view.xml - which would define the image properties you are discussing.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<com.android.mms.ui.ImageAttachmentView android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/image_attachment_view" android:background="@drawable/attachment_editor_bg" android:paddingRight="5.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:id="@id/image_content" android:layout_width="fill_parent" android:layout_height="150.0dip" android:layout_weight="1.0" />
<LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content">
<Button android:id="@id/view_image_button" android:layout_width="100.0dip" android:layout_height="50.0dip" android:text="@string/view" style="\?android:attr/buttonStyleSmall" />
<Button android:id="@id/replace_image_button" android:layout_width="100.0dip" android:layout_height="50.0dip" android:text="@string/replace" style="\?android:attr/buttonStyleSmall" />
<Button android:id="@id/remove_image_button" android:layout_width="100.0dip" android:layout_height="50.0dip" android:text="@string/remove" style="\?android:attr/buttonStyleSmall" />
</LinearLayout>
</com.android.mms.ui.ImageAttachmentView>
EDIT: There are also some better MMS applications out there.. before reinventing the wheel perhaps a bit of window shopping?

No problem! Thanks for the info MrHassell. I enjoy reading your posts (chop full of interesting info, haha)
I'll definitely look into your tips there! SE mucked around with the messaging and they don't use mms.apk but conversations.apk. After decompiling conversations.apk, it references outside of converstions.apk (I'm 95% sure of that) for the uaprof. This (I think) makes sense in that the system needs to tell the network its uaprof.
Other MMS applications depend on this system uaprof to receive images and they too, receive small images. Custom roms get around this because they allow changing the uaprof. However, since SE changed the location of some of the interesting strings, I haven't been able to use AOSP or anything like that as a template to find the strings specifically.
I could use a custom rom, but I'm waiting until a stable, feature filled one is available without having to download X, Y, and Z to get features to work. I like messing with my phone but don't want to mess around with an entire rom (yet, I already did that with a Samsung i7500, lol).
So far, the interesting lines (2) is in framework-res.apk. /res/values/strings.xml
>> <string name="config_useragentprofile_url">http://wap.sonyericsson.com/UAprof/%R202.xml</string> (something like this) and h ttp://wap.sonyericsson.com/UAprof/%R101.xml
Which I changed to
>> <string name="config_useragentprofile_url">http://www.htcmms.com.tw/Android/TMO/Hero/ua-profile.xml</string>
Which is the uaprof for the Tmobile G2.
And just for background...
How I think this all works (if anyone works for tmobile usa and knows, please correct me!)
Phone connects to the network OR when the phone receives an MMS
Advertises it's uaprof capabilities to the network
Network looks at the url and either:
goes to the url and assigns those capbilities to that registered phone
or
looks at the url and looks for that url in a local database. Network finds info and assigns MMS values OR doesn't find it and assigns default 160x120 values. Doesn't go to the internet to find those values.
The X10 worked under 1.6. Why? It was rumored to come to the USA and 1.6 would have had the uaprof on their database for testing reasons. 2.1 comes and TMobile USA has already decided not to carry it so they don't add the new url to their database.

totalundone said:
bah, i can't ever get adb to replace a file. it always says that it's not writeable and then when i get su permission set, some other error happens. I'll figure it out... still reading... typical adb newbie issue, haha.
Click to expand...
Click to collapse
The /system directory is read-only by default. You need to mount it as read/write:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
Click to expand...
Click to collapse
If that doesn't work, you could try this:
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
exit
exit
Click to expand...
Click to collapse
Also, don't forget to check your phone for a "SuperUser" popup and allow it. In the SuperUser app, this shows up as "Unknown".

Thanks again Grospolina!
Evidently I didn't have it approved by superuser. I thought I did... but forgot that I lost it when I had to reflash a few days ago.
I tried the new framework-res.apk. It didn't crash my phone and it was the new size! unfortunately incoming mms photo sizes are still 160x120 max.
Well... I guess I need to get back to searching ...

just want to say thank you for looking into this. i really want to have the mms picture issues worked out.
thanks again

Related

[Q]how to add lines to xml

in order to get a mod to work in my theme i need to add a couple strings to my public.xml thats found in my framework-res.apk. i used ultracompare to compare 2 different xml files and i know what needs to be added to my xml file. i use notepad ++ to edit values but never added strings.
1. can i use notepad++ to add the strings to my public.xml?
2. does it matter what line they end up on?
I use Open XML Editor, but I am sure you can use whatever works best for you. Notepad would hurt my brain though.
As far as the Public.XML, I don't think you can just remove and add lines to it...
The way it was explained to me was that any extra or new pngs added to a theme will be added into the Public.xml by way of "aapt". So there is no need to add. As far as removing items... well the entries are all coded a specific way so if you remove line 100... then everything from 101 to the end will be off by 1 and cause a lot of problems. An example...
<public type="attr" name="exported" id="0x01010010" />
<public type="attr" name="process" id="0x01010011" />
<public type="attr" name="taskAffinity" id="0x01010012" />
<public type="attr" name="multiprocess" id="0x01010013" />
<public type="attr" name="finishOnTaskLaunch" id="0x01010014" />
So as you can see the id used increases and then is associated with a specific item from within your apk. So as far as I know the best way to modify something (like a theme or etc) is to work with a Public.XML that has less in it so you can add to it... or just keep all those items in there (pngs, etc) and just make them a 1x1 image. Not the best way... but from what I have seen it has been done by many a theme maker and ROM builder.
Hope that answers your question.
** edit **
I just realized that I may had confused you (not knowing your knowledge level) so... The items are added to the Public.XML when you build the APK back together after editing it. This can be done with the apktool, which uses the aapt to do it's job. At least that is how it has all been explained to me so far. I also need to modify a Public.XML for my framework-res.apk and ran into problems here.
You don't need to worry about adding pngs to the public.xml. just put the pngs in place in the decompiled apk along with the xml that's using the pngs. You can't add pngs that aren't being used, which is the only requirement.
Run 'apktool b' to rebuild the apk and the pngs should be added to the public.xml. that data will be in the resources.arsc file in the new apk if you had no errors. Copy that to your original apk and you're set.
You can decompile your recompiled apk if you want to see the newly added entries to the public xml. But that's just for fun.
Note; I found in the framework 21 for backflip that there was no more room for draw9.png images, just regular pngs.
Also, if you copy any1 else draw9.pngs from their apk make sure you copy the png from an unzipped apk and not a decompiled apk. Decompiles adds the 1 pixel ring around the image that wont go away unless recompiled. And you can't replace draw9 images to recompile or apktool will try to add it as a new draw9.png to public xml and error out. Just insert to your original apk.
That should cover all bases.
Im sorry, the second post threw me off. You said strings specifically. I would think the rule should apply the same. Use the string in an xml and the string is declared in another xml in the values folder, I think its strings xml. The compiled string resources will be in the resources.arsc file in the new apk.
djstaid said:
I use Open XML Editor, but I am sure you can use whatever works best for you. Notepad would hurt my brain though.
As far as the Public.XML, I don't think you can just remove and add lines to it...
The way it was explained to me was that any extra or new pngs added to a theme will be added into the Public.xml by way of "aapt". So there is no need to add. As far as removing items... well the entries are all coded a specific way so if you remove line 100... then everything from 101 to the end will be off by 1 and cause a lot of problems. An example...
<public type="attr" name="exported" id="0x01010010" />
<public type="attr" name="process" id="0x01010011" />
<public type="attr" name="taskAffinity" id="0x01010012" />
<public type="attr" name="multiprocess" id="0x01010013" />
<public type="attr" name="finishOnTaskLaunch" id="0x01010014" />
So as you can see the id used increases and then is associated with a specific item from within your apk. So as far as I know the best way to modify something (like a theme or etc) is to work with a Public.XML that has less in it so you can add to it... or just keep all those items in there (pngs, etc) and just make them a 1x1 image. Not the best way... but from what I have seen it has been done by many a theme maker and ROM builder.
Hope that answers your question.
** edit **
I just realized that I may had confused you (not knowing your knowledge level) so... The items are added to the Public.XML when you build the APK back together after editing it. This can be done with the apktool, which uses the aapt to do it's job. At least that is how it has all been explained to me so far. I also need to modify a Public.XML for my framework-res.apk and ran into problems here.
Click to expand...
Click to collapse
I am getting same problem as OP. You said that new PNGs or something are automatically added in public.xml right? But I am not able to see them. Actually, i added 5 more indeterminate progress bars and edited the animator xml for it too. The app compiled with apkmanager, but after decompiling the same, I don't see the new indeterminate PNGs declared in the public.xml.!! Plz. help me! I can't just flash and test immediately!! cause i don't have that phone!!
No they are not added automatically you have to add it yourself.
Only add or change lines don't remove.
For public.xml
Everything is grouped
Each group has an order
Drawable will be
0x7......00
0x7......01
................
0x7......ff
Remember they use letters also
You can add a new item
0x7.......g0
They have to be in order by resource type
String would start with ex...
0x6......00
Find the last string id that was used and add the next id.
Remember they are not always in order so actually use the text search to be sure.
Not sure if you already added the string to the strings.xml
That has to be done also.
For that open strings.xml
Copy the last line
Paste it to next line
Change string name (must match public.xml) and than value (what text is displayed)
Let me know if you need more help.
Sent from my PG86100 using Tapatalk
Here is a write up i was planning on doing for my site
decided to start it now.
Add resources to an android apk
Its just a start but should be able to do it with out problems
wes342 said:
Here is a write up i was planning on doing for my site
decided to start it now.
Add resources to an android apk
Its just a start but should be able to do it with out problems
Click to expand...
Click to collapse
Oh mahhnn!! Thanks a lot for that!! Now I don't need to depend on crappy tools for adding resources any more!!!
Once again, thanks a lot for that!!
So when i understand it right i made it like that.
I wanna add "ab_bottom_solid_dark_holo.9.png" to mms.apk.
I copy it to "drawable-xhdpi". I open "public.xml" and scroll to the end of "<public type="drawable" ". Last string is:
"<public type="drawable" name="stat_notify_sms_9" id="0x7f020254" />"
Click to expand...
Click to collapse
So i make a line under that and that would be that:
<public type="drawable" name="ab_bottom_solid_dark_holo" id="0x7f020255" />
Click to expand...
Click to collapse
In the whole xml is no other "7f020255". So that would be all? No other changes to do?
Basian Mile said:
So when i understand it right i made it like that.
I wanna add "ab_bottom_solid_dark_holo.9.png" to mms.apk.
I copy it to "drawable-xhdpi". I open "public.xml" and scroll to the end of "<public type="drawable" ". Last string is:
So i make a line under that and that would be that:
In the whole xml is no other "7f020255". So that would be all? No other changes to do?
Click to expand...
Click to collapse
Everytime I've added a drawable, or a string, to my apps, I've never had to put them into public.xml
All I do is compile and they're added automatically. The only time I need to touch public.xml is if I want to remove something.
That would be nice. iam on JellyBean on my Galaxy Nexus and use apktool cmd. And it just gave me errors.
What do u use to compile. Maybe its a nice Tool with more Functions.

Weather Bug - got it working

I installed Weather Bug today and to my dismay I could not get it working using location services. It worked fine if I removed the location services check boxes during setup and manually entered the location.
I was not happy with having to use a manual entry for my current location and every time I went into settings and turned on location services the app would force close. I figured it was the lack of location services.
adb remount
adb pull /data/data/com.aws.android/shared_prefs/com.aws.android_preferences.xml
change the line using notepad++ to:
<boolean name="prefs_use_gps" value="true" />
to
<boolean name="prefs_use_gps" value="false" />
push the file back:
adb push com.aws.android_preferences.xml /data/data/com.aws.android/shared_prefs/com.aws.android_preferences.xml
now you can enter settings and enable location services. Just do not enable GPS,
I attached a already modified file. Just rename the txt to xml.
Thanks. Any idea how to get the elite version to work? I added the string from your file, <boolean name="prefs_use_gps" value="false" />, and it did prevent the force close with Location enabled; however, it couldn't find my location. Attached is my com.aws.android.elite_preferences file
I just enable the TetherGPS client when running such apps which crash when trying to access GPS.
richard98 said:
Thanks. Any idea how to get the elite version to work? I added the string from your file, <boolean name="prefs_use_gps" value="false" />, and it did prevent the force close with Location enabled; however, it couldn't find my location. Attached is my com.aws.android.elite_preferences file
Click to expand...
Click to collapse
This is the line that tells it to use the network location. I did not see this line in your file, so I do not know if it will work in your version.
<boolean name="prefs_use_network" value="true" />

Center Clock mod - Guide up / Flashable .Zip

Has anyone tried/managed to get the clock on the CM7.1 rom to display in centre
Iv followed instuction from here:
http://forum.xda-developers.com/showthread.php?t=1174202 By Taine0
And also from here
http://forum.xda-developers.com/showthread.php?t=1202866 By ZduneX25
But run into Error whilst decompiling the SystemUI.apk
Anyone had any luck with this, or advice/help
Iv added a Flash-able .zip which is at the bottom of this post,
This works on my CM7.1.0 - FXP041 so should work with yours.
Please do a back-up in case it messes things up.
If is does mess things up and you didnt back up, just reflash the CM7.1.0 - FXP041.Zip over the top you retain all data.
EDIT:
Ok im getting better at learning XML editing, its been a long night.
but iv been using this guide here with some good effects.
Still a few problems that i need to work out.
Big thanks to member: K Dotty for helping me out.
&
TheGrammarFreak - for guide below.
TheGrammarFreak said:
Hokay, I'll explain the way I make the edits.
I use APKTool to manage decompiling and rebuilding the apk, simply because I like it. I'm also on Linux and apkmanager doesn't work too well.
So I have apktool in my path, so I can be anywhere on my system and use it.
Code:
cd Android
mkdir StatusBarMOD
cd StatusBarMOD
Copy the SystemUI.apk there, then
Code:
apktool d SystemUI.apk
APK Tool does its thing, then I go to the status_bar.xml and open it up in gedit.
Editing status_bar.xml
Centre the clock
For the clock you need to find this line:
So CTRL+F, search for "clock" then select the whole line. Your text editor might break it into 2 lines, make sure you get the whole XML tag (between ").
Delete that, then copy this line to your clipboard:
Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="15.0sp" android:typeface="normal" android:textStyle="bold" android:textColor="#ff000000" android:gravity="center" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
</LinearLayout>
If you're using an HDPI phone change this bit
Code:
android:paddingTop="2.0px"
to
Code:
android:paddingTop="3.0px"
and if you're using an LDPI phone change it to
Code:
android:paddingTop="1.0px"
If you're as cool as me, you'll have an MDPI phone, so you can leave it as it is.
So, line copied to clipboard you need to past it to just BELOW this line:
Code:
xmlns:android="http://schemas.android.com/apk/res/android">
Clock = centred.
Centre the date
Find this line (it's right at the bottom):
Now, for this MOD I won't give you a premade version, but I'll tell you what to change (that way we learn ).
To centre the clock you need to change the android:gravity property. At the moment it's set to "left|center". All you need to do is change it to "center". If you have a semi transparent status bar and you want to avoid it looking ugly you may also want to extend the date's background across the whole status bar. To do that you need to change the "android:layout_width" property. Instead of "wrap_content" it should say "fill_parent"
Date = centred
Flip the status bar icons around
Ok, so this one is a little weird. You need to change the alignment, the gravity and the order of 2 elements. Each XML tag has an ID, which we'll use to identify the bits we need to move. The ID can be found next to the property "android:id". The battery, signal and 3G icons are part of
Code:
android:id="@id/statusIcons"
So find the tag with that in it (CTRL+F is your friend) then select the whole tag. It's between the bit that says "" The whole thing will look something like this:
You need to cut it out (CTRL+X), and move it to just BELOW the LinearLayout with the ID
Code:
android:id="@id/icons"
So once moved, we need to change the alignment and the gravity. Near the end of the line you just moved it has this property:
Code:
android:layout_alignParentRight="true"
You need to change it to
Code:
android:layout_alignParentLeft="true"
You also need to change the android:gravity to
Code:
android:gravity="left"
Part one sorted.
To move the notifications over to the right you need to do this:
In the tag ID'd
Code:
android:id="@id/icons"
you need to change the alignment to right (alignParentLeft to alignParentRight) and change the gravity to "right"
Rebuilding the apk
Go back to your command line and issue this:
Code:
apktool b SystemUI
In the folder you decompiled in you will see a folder named SystemUI. Once you rebuild your apk using apktool you'll notice that 2 new folders are in that folder (the SystemUI one): build and dist. Go into the build folder, then apk --> res --> layout. Also, make a backup of your original SystemUI.apk, then open the original using 7zip, winrar or the archive manager on linux. DO NOT EXTRACT THE ARCHIVE, JUST OPEN IT! Now, within the archive, navigate to res --> layout. Go back to the folder you just opened, and drag the status_bar.xml found there into the archive window, overwriting the status_bar.xml already there. Close everything, then push the now modified SystemUI.apk to your phone using ADB and reboot. Job done!
I may edit this post after I publish it, to fix typos and the like.
Hope this helps y'all!
I might also add that, as an Englishman, spelling "centre" as "center" is a nightmare. Oh so often my compile fails because I spelt centre correctly.
Click to expand...
Click to collapse
Added a zip for people on CM7.1.0 - FXP041 to try out !!
It worked! Thanks for this!
Hi mate
Worked for me
Thanx
Sent from my LT15i using xda premium
but the font should be bold hours!
can u make the same for .283 also?
muzontnt said:
but the font should be bold hours!
Click to expand...
Click to collapse
Iv changed all system fonts on my phone, might be why it's not bold., can't remember.
Sent from my Arc to your eyes.
punkmonkey1984 said:
Added a zip for people on CM7.1.0 - FXP041 to try out !!
Click to expand...
Click to collapse
It's only a few days ago since you were asking how to change images, and now you've posted this.
Life's about learning, so i ask people for advice and work things out.
I really want to try getting in to coding then hopefully making roms like miui.
Sent from my Arc to your eyes.
punkmonkey1984 said:
changed all system fonts on my phone
Click to expand...
Click to collapse
: D but the date is displayed in bold
muzontnt said:
: D but the date is displayed in bold
Click to expand...
Click to collapse
Very true.
try this
Decompile your systemUI.apk
go to
SystemUI.apk\res\layout
Open status_bar.xml
Find
Code:
<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="15.0sp" android:typeface="normal" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="center" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
change to
Code:
<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="15.0sp" android:typeface="bold" android:textStyle="bold" android:textColor="#ffffffff" android:gravity="center" android:paddingTop="3.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_weight="1.0" />
Re-compile
over write original systemUI.apk in /system/app
reboot.
should working, not tested.
Can I flash the zip file if I'm using CM7.1.0-Ba2tF-Olympus? If so, how do I do that? Can I just use ROM Manager?
Sorry. I just unlocked bootloader and installed CM7 a few days ago so I'm still getting used to all of this. Thanks for your patience!
Will this working on stock ROM?? 42 fw
Sent from my Anzu using xda premium
punkmonkey1984 said:
Has anyone tried/managed to get the clock on the CM7.1 rom to display in centre
Iv followed instuction from here:
http://forum.xda-developers.com/showthread.php?t=1174202 By Taine0
And also from here
http://forum.xda-developers.com/showthread.php?t=1202866 By ZduneX25
But run into Error whilst decompiling the SystemUI.apk
Anyone had any luck with this, or advice/help
Iv added a Flash-able .zip which is at the bottom of this post,
This works on my CM7.1.0 - FXP041 so should work with yours.
Please do a back-up in case it messes things up.
If is does mess things up and you didnt back up, just reflash the CM7.1.0 - FXP041.Zip over the top you retain all data.
EDIT:
Ok im getting better at learning XML editing, its been a long night.
but iv been using this guide here with some good effects.
Still a few problems that i need to work out.
Big thanks to member: K Dotty for helping me out.
&
TheGrammarFreak - for guide below.
Click to expand...
Click to collapse
how to center clock in lockscreen?

Editing AndroidManifest.xml .. formatting / localized to Chinese(?), Go SMS Pro Theme

Hi everyone,
I've created a GO SMS Pro theme using their webtool,
but it appears to have yet to implement various common aspects of functionality. I want to be able to modify the AndroidManifest.xml file myself, primarily to add Airpush (the presence of which I let people know of from the beginning), but the formatting is quite garbled. I'm guessing this may be due to the localization to Chinese that the Google Play developer console reports. Does anyone have a functional, readily editable version in English with all the required information for a GO SMS Pro Theme? I want to be assured I have all the required information, rather than hacking together another xml file with Eclipse. I figured I'd install the Chinese language on my computer, but it appears Microsoft did not include such functionality in Windows 7 Premium (64-bit). I've download other GO SMS Pro themes with Airpush, figuring I could use their AndroidManifest.xml and mail.xml files as templates, but found the same formatting / editability issue. Thank you for your help!
I've since found kantbstopped519's post at the end of page 3 in the following thread: http://forum.xda-developers.com/showthread.php?t=1125626&page=3
and used what was posted:
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="5" android:versionName="1.0" android:installLocation="auto" package="com.jb.gosms.theme.kxnt.dark"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" android:icon="@drawable/jb_smsmms">
<activity android:theme="@android:style/Theme.Dialog" android:label="@string/app_name_desc" android:name=".GoSmsInstallDialog" android:excludeFromRecents="true" android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.INFO" />
</intent-filter>
<intent-filter>
<action android:name="com.jb.mms.theme.others" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
Click to expand...
Click to collapse
It appears this functioned for kantbstopped519.
I used this as a template (made no additions of Airpush or anything such) and made the supposedly appropriate changes, also changing anything referencing @string to plain text directly in AndroidManifest.xml. Now I'm getting that informative "The server could not process your apk. Try again."
I've been making various changes, deletions, and resigning after each change, to repeatedly the same message. Only re-adding my original garbled-de-goop AndroidManifest.xml file and resigning has thus far resulted in a successful processing upon upload. Could this have something to do with the resources.arsc and/or classes.dex files in the root of the apk?
If the APK is already compiled then you will need to decompile it with apktool to get the XML readable.

Help needed with json URL

I am following geeksforgeeks app building tutorial. Totally new to building apps with android studio and I have hit a couple of snags which I solved.
I have got to the point where I now have a working json URL and the next step is to gue the URL to get the data in to the app and to copy & paste code in to app>res>layout>activity_main.hml file.
I do not know where to put the URL and the code and when I try it does not work.
This is the working json call
https://spreadsheets.google.com/feeds/cells/1puaF3Z9eJxlnyW1-sjwHZlJah9DXmY18Ol2i6S3Drr4/1/public/full?alt=json
Text saying what to do
After copying this id paste the id in the below URL and run the URL in your browser. You will get to see all the excel data in JSON format. Now we will use this data in JSON format inside our app. Make sure that you have published your Excel sheet. Otherwise, this method will not work. Now we will use this URL in our app to get the data in JSON format.
Which now works in browser (their example did not)
Then I am supposed to do this
Step 5: Working with the activity_main.xml file
Navigate to the app > res > layout > activity_main.xml and add the below code to that file. Below is the code for the activity_main.xml file.
XML
<?xml version="1.0" encoding="utf-8"?>
<!--in this we are displaying a nested scroll view-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/idNestedSV"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<!--recycler view for displaying our list of data
and we are making nested scroll for our
recycler view as false-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/idRVUsers"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@Layout/user_rv_item" />
<!--we are adding progress bar for thepurpose of loading-->
<ProgressBar
android:id="@+id/idPBLoading"
android:layout_width="wrap_content"
android:layout_centerInParent="true"
android:layout_height="wrap_content" />
</RelativeLayout>
I think the URL has to be in somewhere for the above to work.
can anyone help?
I may have figured out what I was doing wrong with the code but the emulator is just sitting there spinning as if wait for the data in json format.
The only thing that I may not be doing right is I have not added the URL, I think I have all the parts added other than that but the error suggests to me that the class UserModal is empty. error reports all point to UserModal which is there and as I understand it is used to store the json format data.
I think I found the correct place to put the URL but the app will not run in the emulator.
The app I'm working with is found here
How to Read Data from Google Spreadsheet in Android? - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
www.geeksforgeeks.org
I have included a snapshot of the screen showing the errors I now get trying to run the app.
MakemOne said:
I think I found the correct place to put the URL but the app will not run in the emulator.
The app I'm working with is found here
How to Read Data from Google Spreadsheet in Android? - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
www.geeksforgeeks.org
I have included a snapshot of the screen showing the errors I now get trying to run the app.
Click to expand...
Click to collapse
I'm still struggling with these errors, as this code is copied & pasted as per the instructions in the tutorial unless AS has changed and some of the commands are not in the newer version then I would expect the code is correct and it is something I have done wrong.
I have attached a PDF of the tutorial. Can anyone give me some help?

Categories

Resources