Archive for category development

HOWTO :: Send and receive MMS on Galaxy Nexus / SoftBank

As usual, MMS support in the international version of Galaxy Nexus does not work on SoftBank network as is, and requires a bit of tinkering. We gonna need usual toolset: phone, USB cable, adb, apktool and a text editor. There are a few explanations on the web, but they talk about connecting Nexus to the iPhone APN, so it won’t work if your previous smartphone was not iPhone. Here’s a procedure if you had Android device before.

Copy files from the phone

$ adb pull /system/app/Mms.apk
$ adb pull /system/framework/framework-res.apk

Unpack the framework and Mms.apk

$ apktool if framework-res.apk
$ apktool d Mms.apk

Make changes

The file we are interested in is res/xml/mms_config.xml, you may want to change it directly, but your phone might stop working on some other network, so I prefer another approach. We can create separate file, which will work on SoftBank network only. This new file should be called res/xml-mcc440-mnc20/mms_config.xml, 440 is the country code for Japan, and 20 is SoftBank network. The file contents is the following:

<?xml version=”1.0″ encoding=”utf-8″?>
<mms_config version=”4″>
<bool name=”enabledMMS”>true</bool>
<int name=”maxMessageSize”>307200</int>
<int name=”maxImageHeight”>768</int>
<int name=”maxImageWidth”>1024</int>
<int name=”defaultSMSMessagesPerThread”>500</int>
<int name=”defaultMMSMessagesPerThread”>150</int>
<int name=”minMessageCountPerThread”>10</int>
<int name=”maxMessageCountPerThread”>5000</int>
<string name=”uaProfUrl”></string>
<int name=”recipientLimit”>-1</int>
<int name=”smsToMmsTextThreshold”>4</int>
<bool name=”enableMultipartSMS”>false</bool>
<bool name=”enableSlideDuration”>true</bool>
<int name=”maxMessageTextSize”>-1</int>
<string name=”userAgent”>SoftBank/1.0/X01T/TJ001</string>

You should not copy/paste the code snipped, just change the bold parts (URL and UserAgent) using your phone file as a boilerplate.

Rebuild .apk

First we run apktool to rebuild the resource files, and then zip contents of build/apk folder and sign the result

$ apktool b Mms
$ cd Mms/build/apk
$ zip Mms.apk *
$ java -jar signapk.jar -w testkey.x509.pem testkey.pk8 Mms{,-signed}.apk

Put results back to the phone

If you phone does not allow pushing files to /system/app, you have to download and use Superboot (see my previous post for details. Otherwise, its as simple as:

$ adb push Mms-signed.apk /system/app/Mms.apk
4760 KB/s (434346 bytes in 0.089s)

After reboot, please, don’t forget to input proper APN settings for Open SoftBank.


Just in case you don’t like to tinker with Android internals, here’s a ready-to-use download, SBM_Galaxy_Nexus_4.0.2_ICL53F_Mms.apk. This file should be put into your phone as described in “Put results back to the phone” part. It is intended to be used on Android 4.0.2, specifically version ICL53F, and may not work on other versions. As soon as I upgrade to 4.0.4, I will put a new file for download in this topic as well. Well, here’s SBM_Galaxy_Nexus_4.0.4_IMM76I_Mms.apk for version 4.0.4. And also SBM_Galaxy_Nexus_4.1.1_JRO03C_Mms.apk for Jelly Bean 4.1.1.

Final thoughts

There is still one problem left, Mms.apk requires working internet data connection to download MMS contents. As I have remembered from my previous HTC phone, it was possible (on Froyo) to keep data connection off, and Mms application will enable it for a short period of time just to download MMS messages. Unfortunately, this does not work on Galaxy Nexus yet.

, ,

No Comments

HOWTO :: Pull OTA upgrade file from Galaxy Nexus

Recently I’ve got Galaxy Nexus to play with, and as soon as I’ve entered Wi-Fi password, an OTA upgrade came my way. It was very tempting to upgrade immediately, but I’ve decided to pull upgrade file from the device to see what’s inside.

Unfortunately, the phone comes from the factory locked and there’s no way to access system files except unlocking the protection.

Regarding the root access

First we need the root access to be able to access files freely.

I don’t like to permanently root my phone, so I prefer the temporary method, which keeps the phone protected, but gives me the opportunity to access what I need if I really need it (I do not delve into details about how to use adb, hoping you already know that).

Unlock the phone

Reboot into fastboot mode by switching power off, and holding all three buttons (volume up/down and power) until Android logo appears. then issue ‘fastboot oem unlock’ command from your computer. This requires full memory wipe, so be careful and make a backup of any data you care to keep.

Download the superboot

Superboot is the bootoader image, which can turn the phone into a rooted one, but only until the next reboot. Handy and safe.

Reboot into superuser-enabled mode

While still in fastboot mode, the following command will restart the phone with the boot image we have just downloaded.

fastboot boot boot.superboot.img

Wait until the update comes

Since the phone was wiped clear during unlock, we have to wait again for upgrade to come, or request the upgrade check from Settings menu, if you are impatient.

Move upgrade file into the easy to access place

Since adb can not pull system files, we have to move the upgrade file somewhere we can access easily. I chose /sdcard folder for that purpose

adb shell
$ su
# cd /cache
# ls
[... file list skipped ...]
# mv /sdcard/

In your case the file name most probably will be different, but it’s quite easy to tell based on size (90MB in my case), which file to copy.

Extract the file from the phone

Finally we can use adb to get the file:

adb pull /sdcard/ .

, , , ,

No Comments

Auto-Update-Apk :: Automatic Update Deployment for Android Applications

auto-update-apk logo

First, I had an application. And a customer. And another customer. Actually, a few people wanted to use the application, but due to a specific nature of the software it is not intended for Joe Public, and I’m quite reluctant to put it on the Market.

Then comes the problem: I can tell the customer to install the program from a given URL, but how do I deploy updates to the software? Unfortunately, Android Market does not provide update options for non-Market applications.

I’ve spent a few days looking for an automatic update deployment software on the net. Found a few. Most of them are just plain disappointments. So,I’ve decided to spend a weekend to roll my own. Maybe also a disappointment, but at least my own.

Finally, today I’ve published the first version of AutoUpdateAPK service. Due to gruesome death of the service I’ve used before, I was quite pressed for time, so the basic functionality is a bit limited, but is expected to grow rapidly. Especially, because we are going to use this service ourselves quite extensively.

Android code is open-sourced under Apache 2.0 license, so people may freely copy it into their applications and start to deploy updates automatically.

, ,

No Comments

Mail/parcel tracker — now with Sagawa and Kuroneko Yamato support

Two other major delivery services are supported now by mail tracker: Sagawa Takkyubin (佐川宅急便) and Kuroneko (ヤマト運輸), but it’s still as simple as it was before — just enter the number and the program will automatically check and decide where and how to track it. Barcode scanner works now almost always, success rate is about 95% even in extreme lighting conditions. It takes only 2-5 seconds to scan a receipt and get all the tracking info available on the screen. If you send a lot of mail you know how troublesome and time consuming this might be.

Here’s version 0.9.7 (still beta, but improving quite fast and steady): 配送追跡.

, ,

No Comments

Japan Post mail/parcel tracker

Got some spare time and made a little application for Android, which helps to check the current status of my mail and packages right from my phone. Actually I’ve tried a few other similar applications first, but haven’t found the one which works just as I like. Most of them don’t support barcode scanning and don’t validate input, so I could input any garbage instead of tracking number (you know how error prone is touch-typing =) and then spend hours wondering why my parcel does not show up in the tracking list. Another thing I don’t like is to choose every time what kind of number I have, Expack or cash on delivery/registered mail — they all look very similar written on the paper.

My application (配送追跡) takes the number and selects the proper category automatically, also it calculates checksum for every number and rejects anything that fails validation. Took me a few hours to reverse engineer checksum calculation for Japan Post tracking numbers, but finally it works, and, by some strange coincidence, same validation scheme is used for Sagawa (佐川宅急便) and Kuroneko (ヤマト運輸) express delivery tracking numbers, so maybe I’ll add support for those in the future.

There are still a few kinks to iron out, and current barcode scanning library from “ZXing team” gave me mixed results on my phone, but people say it’s the best one and the actual problem is in my phone, so I hope it works well for you.

And, please, don’t worry about the kanji on the screenshot — the program will display everything in English if you phone has non-japanese locale set.


No Comments

iOS :: developers program enrollment

For those worried, it’s not like I’m jumping the ship, but more like grabbing another opportunity and expanding to the new devices. After I’ve paid $99 to the “empire of evil”, I’ve got a nice formatted e-mail, saying: “To complete your purchase and access your Apple Developer Program benefits, please click on the activation code below.”

Clicked on the link and there’s another message, telling me they have some problem and I should contact support. Support sent me another message, which says “We have reviewed your documentation and have removed the hold on your Program activation. At this time, we ask that you please refer to the original activation code email that you received and click through the link once again.”

Well, “If at fist you don’t succeed, try, try again!”. Plenty of fun and games and for only $99.

No Comments

Eclipse :: coding for Android back again

walking android

After a long while, I’ve recently started to code a few things for Android, launched Eclipse and was greeted with mysterious errors. Which include:

  • “layoutlib is too recent. update your tool” in the Eclipse layout editor. This was solved by upgrading android libs and SDK and also upgrading ADT from inside of Eclipse->Help->Upgrade. The former upgrade probably was not really necessary, but I did it anyway just in case to prevent other incompatibilities from coming out.
  • another gem appeared when I tried to create an empty project to test a few ideas: “error generating final archive: Debug certificate expired”. This required deleting ~/.android/debug.keystore and “cleaning” the project, which eventually led to regeneration of required debug keys. Google says debug keys are expired after 365 days, so it must have been more than 1 year since I’ve started playing with Android.
  • if you plan to access internet from the emulator, open Run->Configuration->Target and set “Additional Emulator Command Line Options” to “-dns-server,″ and don’t forget to require INTERNET permission in the manifest.

And yes, I’ve got two walking plastic Androids to race them against each other around my table.

, ,

No Comments

DIY :: Geiger Counter, making your own graphs

I’ve got a few questions about the geiger graph plots and how to make them. Here’s a short explanation for those without extensive computer background. Personally I prefer using RRDTOOLS to plot any data graphs, but the installation under Windows might be a bit too difficult for the average windows user. Anyway, if you plan to user RRDTOOLS, here’s the download link, and don’t forget you’ll need to install CYGWIN as well. Japanese users might appreciate someone already had translated the manual.

For everybody else, I think the easiest way is to use Excel/Chart or OpenOffice to create pretty pictures in no time.

First, you have to launch your favourite terminal application and get some data from the (USB-)serial port and copy it with (Ctrl/C) or any other available technique. This is the data you’re going to make a graph from.

Open Excel or any other spreadsheet software and paste the data into it. Don’t forget to set “separators” to spaces or the data won’t get separated into the different columns.

In the column just before the data, enter two consecutive time values (13:30 and 13:31, for example), select them and drag black square with the mouse to fill the whole column with the time values.

Finally you may select the time and data columns together and use Chart function to draw a pretty char of your data. There are plenty of settings to adjust and make it look just the way you like it.


No Comments

DIY :: Geiger Counter, high speed readings

This is new, totally reworked board which can accomodate any tube, from SI-3BG through SI-37/39G upto SI-1G and even SBM-20, though the last one is a bit too large and leaves tips hanging off the board. The tube on the picture is SI-39G. High voltage generator is now controlled from the microprocessor, instead of fixed setting as on previous boards and also there’s a noisy buzzer, which ‘ticks’ just like the original geiger counter.

New software has changed a lot, now includes voltage controller, buzzer support and fast screen update. The data over USB is still sent once a minute, but the LCD display is now updated every 4 seconds (2-3 seconds were also possible, but seemed to be overkill) with the data of the last minute. Instead of fixed 1 minute intervals, this version uses “sliding 1 minute window” to calculate the value. There’s no need anymore to wait for full 1 minute to see readings go up after introduction of some radiation source, the change is obvious and imminent. Though, on the down side, this fast pace could be a bit disconcerting to some users.


No Comments

DIY :: Geiger counter, new tube — more fun

Recently I’ve got a few SI-1G tubes, so naturally I’ve built a new board to accomodate this tube, which is about three times as big as SI-3BG. Well, the schematics is almost the same, capacitors went up a grade and basically only the board layout had changed a little.

This tube has almost everything I need for a household radiation measurement post — high sensitivity, low required voltage and very good response even to the smallest amounts of radiation.

I have brought home a piece of granite (which has about 0.2uSv/h natural background radiation level) and put it next to the SI-1G around 13PM on Monday. As I said before, granite does emit mostly alpha and tube has been rated for gamma only, so I did not expect much.

But, almost immediately I have noticed a +4CPM spike which is still continuing since the rock stays near the tube until now. I have not seen this good response even from the Chinese-made dosimeter which costs several times as much. I’m off to bed and wonder if the high level of secondary gamma emission will wear off around tube by tomorrow morning (I hope not =)

ps. Ah, and thorium mantle makes it really scream at whopping 255-280CPM, which converts to something in 2-3uSv/h range — scary!


No Comments