Help needed with json URL - Android Q&A, Help & Troubleshooting

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?

Related

[Q] iGO Primo POI icons

I put a new POI list into my iGO Primo. But they appear on the map all having the same symbol (a globe) and it's hard to differentiate one from the other. Is there a way to change the icons of POIs? Can I find somewhere a tutorial for that?
Thanks for replies.
Hi,
I have not yet found a way to alter the icons in the map providers .poi files but have managed on my own poi.
I have put kml file in userdata/poi and bmp in userdata/usericon.
If you are using Primo 1.1 you need to edit each kml file as follows
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="web.opengis.net/kml/2.2" xmlns:gx="web.google.com/kml/ext/2.2" xmlns:kml="web.opengis.net/kml/2.2" xmlns:atom="web.w3.org/2005/Atom">
<Document>
<name>BP</name>
<metadata><igoicon><filename>BP.bmp</filename></igoicon></metadata>
<Placemark>
<name>Dolans FS</name>
The line in red needs to be added and the name in blue changed according to the kml file.
Hope this helps
Keith
PS same change in Primo 1.0 but its in a different format which I do not have on this PC. Also as new member cant post with links so change web in yellow to http/www
I have tryed to prepare next for Primo 2.0...but no success
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2"><Document><name>UA-Pot-Hole</name><Placemark><name>Bump (20 km/h)</name><description><![CDATA[UA-Ukraine<br />
<br />
]]></description><metadata><igoicon><filename>Road roler.png</filename></igoicon></metadata><description><![CDATA[UA-Ukraine<br />
<br />
]]></description><metadata><telephone></telephone></metadata><Point><coordinates>37.90704,48.07130</coordinates></Point></Placemark><Placemark><name>Bump (40 km/h)</name><description><![CDATA[UA-Ukraine<br />
<br />
Could you help me?

[Project] Incoming MMS Picture Size Fix

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

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?

[Q&A] Need help with Admob

Hi,
I have been a part of XDA developers for a long time. I dont post (coz I dont know as much as ou guys). But I visit almost everyday.
I decided to make an App for Android and I have very close to 0 knowledge in programming. I made the app and it works However, I have incorporated the Admob SDK and done exactly like all the tutorials say but the ads dont show up on the device. It shows perfectly on the emulator through...
My "main.xml"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
androidrientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="<I have put my Publisher ID <-- I hope that is correct"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>
my Main Activily has the following
AdView adv = (AdView)findViewById(R.id.adView);
AdRequest re = new AdRequest();
adv.loadAd(re);
My Manifest has the following
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
my Project Properties has this
target=android-15
I have added external JAR GoogleAdMobAdsSdk-6.1.0.jar into the LIbrary.
When i run it, i cant see the ad on my device but I can see it if I run it on the emumlator.
https://play.google.com/store/apps/...sMSwxLDEsImNvbS5vdXRnb2luZy5kZXRlY3RjYWxscyJd
That's my app. ( If someone helps me solve this, I will give my app ADD FREE to XDA Developers)
Thanks
If it works on the emulator you have done it correctly. I think it is a "lack of inventory" problem, so you only have to wait, usually this problem disappears when the number of installations increase.
Thank you so much. I can see in AdMob that the number of Requests is increasing so...

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.

Categories

Resources