Archive for category HTC
I’ve ordered this a few weeks ago for $15 on ebay and delivery from Singapore definitely took its time. Today it has finally arrived and I can tell this battery looks really mean with all the 3000mAh power hidden under the hood — it’s almost twice as thick as the regular one and does require the special back cover to accomodate this thickness (no worries, the new cover was included in the package). Now it’s time to recharge and I wonder how long it might take with the battery of this size.
DISCLAIMER: I don’t invent anything new here, but just summarise things I’ve read across different forums and web sites. I did not write any software mentioned here, but only copy the files and made them available in one easy to access place. I use the procedure described here to create ROM images I flash to my HTC Desire phone, and so far it worked for me perfectly. However I do not guarantee it will work on your system with your files and your phone — use it at your own risk and assume all responsibility. REFLASHING YOUR PHONE MIGHT GET IT BRICKED AND MIGHT VOID YOUR WARRANTY.
To be able to follow this explanation you will need the basic understanding of the command line, be able to enter commands with the parameters, to walk from one folder to another, to compile programs and to run the resulting binaries. To run Java programs you’ll need Java SE runtime installed. To compress and uncompress files you’ll need “zip” program or something similar.
Your phone should be rooted beforehand or allow the installation of custom ROMs.
The process of creating your own ROM update file is not very complicated. Basically it consists of three steps:
- Download and unpack the image you like
- Make the necessary changes
- Pack and sign the .zip file
The update can contain as much as the full system + boot + radio + recovery + extras, which completely overwrites everything you have in your phone, or as little as single .apk file if you want to make just small changes.
Download and unpack
There are plenty of images available on the internet, it’s in your best interest to find the one as much similar to what you need to reduce the necessary changes and introduce as few problems as possible. There are three types of images you may use:
- RUU images (.exe)
- OTA images (.zip)
- 3rd party .zip images
RUU images contain full system, including radio, system, boot and the whole nine yards. However you’ll need to unpack .exe file into .zip file before doing anything useful. I have explanation how to extract the .zip file in Linux but if you use Windows or MacOS your procedure might be different.
OTA images usually contain only the difference between the previous software version and the current one. Therefore you’ll need the previous software as RUU/.zip file with the exact version, and be familiar with bspatch utilty to apply patches, which is quite tedious process. I don’t usually use OTA files if there are any other options available.
.zip images are the easiest to work with, just unpack with your zip archiver to the folder you like.
If you have started with RUU image, you’ll have system.img, boot.img and radio.img files. System image can be further unpacked with unyaffs (requires compilation) to another folder, usually “system/”. Boot image can be unpacked with the perl script (requires perl to be installed on your computer) also to another folder, usually “boot/”. Radio images cannot be unpacked and are better to be left alone.
Make the changes
Most of the changes are done to the system image, which contains all software and data files visible on the phone. Boot image should be changed only if you have deep linux knowledge to modify linux kernel and related matters.
If you have unpacked system image and made some changes, the system.img file is supposed to be moved somewhere else, so it’s not used anymore. Same with the boot.img file. All other files (hboot, recovery) are usually not used, because they might lead back to unrooting the phone and should be deleted or moved as well.
If you have based your work on RUU file, you’ll have to create META-INF folder with the correct information and update scripts inside. If you have unpacked someone’s .zip, the META-INF folder should be already present. Update script might mention some files in the update, so if you have removed (or added new) files, the update script should be amended to reflect those changes. Please, get a few images from different developers and try to understand the correct internal structure.
Pack and sign .zip file
Once you’ve made all the changes, you may change to the folder where you extracted all files, it might now contain .img files, like boot.img and radio.img as well as folders, like “system/”. Zip everything together with the command:
zip -r9 update.zip *
-r9 tells the program to collect files recursively and use the maximum compression. If you omit “r”, the subfolders will not be included (bad, bad idea!), if you omit “9″ nothing bad will happens, but resulting file might be about 1% larger.
To sign zipped file you should download SignApk.zip (requires Java), there are three files inside:
- SignApk.jar is a tool included with the Android platform source bundle.
- testkey.pk8 is the private key that is compatible with the rooted recovery image
- testkey.x509.pem is the corresponding certificate/public key
and the signing command looks like this:
java -jar signapk.jar testkey.x509.pem testkey.pk8 [update.zip] [update-signed.zip]
update-signed.zip can be copied to the phone and installed using the traditional recovery procedure. Personally I’d recommend “ClockworkMod Recovery” from Koush and Paul O’Brien, but I’m not sure if it is available for your phone.
While the actual creation of your own ROM update file is not very complicated, the devil is in the changes you make. Most ROM updates fail at first try, please, have a fresh nandroid backup ready at all times.
Yesterday I’ve started the update process, getting a few ROM images from the Net and trying to make them work well with SoftBank. First, there was Aug,2010 version of Froyo ROM on MoDaCo, where Paul said he did not change anything except rooting the system. I’ve made a few changes in config files regarding SBM network settings and upgraded. Everything went fine, except the phone started to behave funny and today it even FC’ed its own Launcher (!). The version of ROM was 2.09.405.8 WWE.
Finally I gave up and downloaded official RUU with 2.29.405.5 WWE software. Extracted .zip file and applied all the same changes before flashing. The only difference was, I’ve decided to change
ro.wifi.hotspotUI=1 and see what happens. The results were interesting — I’ve got two extra menu items (1) in “Wireless and Networks” settings tab, which allow to setup and configure the wireless hot-spot and share internet connection wirelessly. Probably the cellular providers are not very happy with that, which resulted in these items being excluded away on most android phones.
Also, the interesting item was (2) “USB tethering”, allowing to convert the phone into RNDIS ethernet gadget and pour TCP/IP over USB link to the PC.
Finally I’ve got time to prepare my personal Froyo image for HTC Desire, which is supposed to be stock WWE image with some tweaks and changes, that should allow it to work flawlessly on SBM network and don’t consume too much battery. First, the emergency call codes are supposed to be changed to the following (110 — police, 119 — fire/ambulance, and it still beats me what 118 means):
Besides the radio options used in the previous versions, there are a few new ones, not found anywhere else except the Softbank ROM image:
Not particularly sure what do they do, I think I might change hotspotUI to “yes” someday later. Also, “ro.telephony.default_network=2″ does not agree to the following piece found later in the same file, I wonder which one takes precedence, and what is network #2 in this context:
# Default network type.
# 0 => WCDMA preferred.
There’s also a few things not found in SBM image, but present in WWE release:
Here’s official image from HTC, which may contain latest update for HTC Desire up to Froyo (version 2.2). Please, don’t forget to update radio, because Froyo requires at least version 5 and won’t work with outdated version 4.
I like Google Maps. What I don’t like — these maps are not available offline, which is exactly the time I need them most of all, far away from home and, probably, without a reliable phone data connection. Actiually, there might be some way to cache Google Maps, and I’m sure my phone does that, but I could not figure out how to get it working reliably, it feels like cache time is very limited, maybe hours or minutes — definitely not enough for real-life applications.
Recently I’ve found Maverick from Code Sector. It shows the map, works with GPS and compass and does pretty much everything Google Maps does, and also it can cache and use offline maps. There’s even explanation about how to download and where to save map tiles.
However, the map downloading software just downloads everything within the selected region and did not care much if there’s real map data or just plain sea (Japan consists of many islands), so I did not want to end up with numerous files with blue color inside and used my own downloader.
Fortunately, I have already downloaded plenty of Google Maps for offline use with some other software, so I did not want to redownload everything again, and just needed a way to reconvert and save map tiles appropriately for Maverick.
Maverick uses the following path for Google Maps : /sdcard/maverick/tiles/googlemaps/0/0/0.png.tile, I just need to figure out what are those numbers and how should I place my files there.
The first number is obviously zoom factor. Google Maps saves maps according to the zoom factor, the lowest zoom level is 0, which gives us 20 = 1 tile, covering the whole globe. Next zoom level 1 splits the globe into 2×2 = 4 tiles. Zoom level 2 results in 4×4 = 16 tiles. And for any given zoom level z we can calculate the number of tiles covering the whole globe as NxN, where N = 2z. Google Maps has only 17 zoom levels for maps, and maybe 19 for satellite images.
If we have latitude and longutide, the tile number can be calculated with the following code snippet (in Python) :
def coord2tile(lat_deg, lon_deg, zoom): lat_rad = math.radians(lat_deg) n = 2.0 ** zoom xtile = int((lon_deg + 180.0) / 360.0 * n) ytile = int((1.0 - math.log(math.tan(lat_rad) + (1 / math.cos(lat_rad))) / math.pi) / 2.0 * n) return(xtile, ytile)
And in the Maverick the X coordinate becomes the folder name (inside the zoom folder) and Y coordinate becomes the file name (sans ‘.png.tile’ extension), so the proper place for Google Maps tile is /sdcard/maverick/tiles/googlemaps/ZOOM/X/Y.png.tile
The whole world at zoom levels 4~6 does not take much space at all, whole Japan at zoom levels upto 13 is about 200mb, and some areas of interest, like Tokyo and Osaka at zoom levels up to 15 add about 800mb, so whole map of Japan takes about 1GB of map tiles and fits to 4GB of memory card (it takes more space on SD card because of large cluster size).
Predownloaded Google Maps
Whole world, zoom 4~6 (17mb) :
Japan, zoom 7~12 (140mb) :
Japan, zoom 13 (200mb) :
Levels 14 and beyond take too much space, so you may download partial maps around the places you like yourself.
Also, be careful, if your SD card is formatted with 16kb cluster size, maps tend to occupy 3-4 times as much space as their size. 1GB of maps took about 4GB of space on my device, so if your SD card is small, it might be a good idea to format with 2~4k cluster size.
Softbank has decided to stop accepting orders for HTC Desire from Jul, 29th. Instead they brought out a press-release about “Desire II”, with LCD screen instead of OLED (probably because of Samsung OLED display shortage).
There are SMS messages, which can contain about 160 characters. Japanese uses multi-byte encodings, so the actual character count is much lower. Also, people like to send pictures taken with the built-in cameras, music and other things which don’t fit well into 160 byte limit.
Therefore, MMS (multimedia messaging service) was born. It works like this: you get a short SMS message using SMS protocol, and then your phone has to use data connection to receive the rest of the message from the server. SMS messages work everywhere, but ways and protocols for retrieving the actual message are different from one provider to another. If these protocols are not followed, only “subject” line of MMS message will get through, which is actually delivered via usual SMS.
This is why we need specially tailored application to receive MMS messages on softbank, another specially tailored app to receive MMS messages on DoCoMo and so on. Also, this is the reason, why originally iPhone did not support MMS (it was added about a year later) and why HTC Desire still (oficially) does not support MMS, however there are a few versions of custom-made software, which, more or less, aleviate this problem.
It’s very distracting, but every time HTC Desire lost signal for a while, it tries to reacquire time information and for some unknown reason there’s no TZ info included. There’s no solution for this problem, except moving to the area of better reception quality. Native SB firmware has the same problem.
I’ve found wonderful gem on android forums:
Just took my A8181 which I got from HK to Softbank after flashing one of the ROMs above, shop people confused for a bit as IMEI wasn’t in their “stock database” but eventually caved in and gave me a sim w/smartphone data plan.
They spent about 30 minutes poking around the phone, comparing it with the plastic model they had in store “hey why it says softbank here and only says HTC on this one??” and had to make a few calls to their boss to confirm. I *think* i heard them mumble “rooted”? once before but I’m not sure the guy was too far.
I’m sure I would have to get a 2 year contract with a useless phone otherwise, just to use it’s sim.
Looks like there’s hope to get imported phones to work legally in SB network.