Skip to content

Android Stuff

Apps and Tips for Android…

Archive

Category: tips

Dave Hope has created a neat utility to convert SMS Messages from Blackberry devices into a format that can be used to import them into any Android phone using my app SMS Backup & Restore.
This utility/tool can be downloaded from his site Hope.mx. Thanks to Dave for this utility :)

This process works WITHOUT needing root access on the Android phone.

A couple of users of my SMS Backup & Restore app reported that they were not able to see the backup folder (and files) created by the app when using a Galaxy Nexus on Windows 7. For the uninitiated, Galaxy Nexus is a bit different from most other Android phones, it does not have an SDCard slot and it does not support USB Mass Storage mode when connecting the phone to a computer. Instead, it exposes the internal storage as an MTP device.

Initially I couldn’t reproduce this problem (I have the same phone + OS combination) and thought that this may be a problem on their phone or Windows. I could see the folder and the file on my PC. After some more discussions with the user we came to the conclusion that this looked like some type of caching issue where a file created by my app only appeared on Windows after the phone was restarted.

It turns out that only files known by the MediaStore on the phone gets exposed via MTP to the computer.

A simple work-around/solution for this problem is to let the Media Store know that a new file/folder has been created and that file/folder will immediately appear on Windows.

Doing this in code is very simple, just call the MediaScannerConnection.scanFile method with the full path of the file(s) created.

If you are getting an error then I will need to have a look at the logs to figure out and then either make a fix in the app or suggest if there is something wrong on the phone.

The latest version of SMS Backup & Restore and Call Logs Backup & Restore have inbuilt options to Send Logs in case of errors. The inbuilt option to send logs normally appears when the app encounters an error and allows the user to send me an email containing details of the app’s activity and the error it encountered. Sometimes this information is not enough to figure out what could be wrong as there could be other components of the device that could be causing the problem. In such cases I need the System Logs generated on the device.

For devices running Android 4.1 (Jelly Bean) or above, you need to have a rooted device to be able to send System logs.

If you have a rooted device or a device running Android 4.0 (Ice Cream Sandwich ) or lower, follow the following instructions to send detailed System logs:

  • Install the app CatLog from the Google Play Store.
  • Enable the Logging in the app that you are getting error in (Menu->Preferences -> Enable Logging)
  • Repeat the operation that you were performing in my app to reproduce the error.
  • Once the error has been reported, open the CatLog app
  • In CatLog, open the Menu and select “Send”  it’ll ask you how to send the log, select the Email or GMail option as per your configuration and send the log by email to my email address: android AT riteshsahu DOT com
  • Also send a note on what were you trying, so I know what to look for.
  • Once I’ve received the logs I’ll analyze them and get back to you.

Notes:

  • Make sure you’ve enabled logging in the App before you retry the backup or restore operation and also to send the logs as soon as you get the error, otherwise the logs would not contain the information needed.
  • If you get an Error during SMS Restore then please try restarting the Phone and Restore again. Sometimes the internal database for the messages gets corrupted and gets fixed on restarting the phone.
  • Some users have reported getting errors when doing a Restore with SMS Backup & Restore. The logs suggest the Antivirus App interfering with the Restore. Uninstalling/Disabling the Antivirus app fixes the Restore problem.

Jan Grewe has created a web based application to convert SMS Messages from iPhone so that they can be transferred into any Android phone using the SMS Backup & Restore app. The page has instructions to find the SMS database created by iTunes and then upload it for conversion. The web application generates an XML file which can then be copied to the SD Card of the Android phone and restored using SMS Backup & Restore.

If you don’t want to upload your messages to a remote site then Dr. Bil Kirmani, one of the users of SMS Backup & Restore, came up with a manual process of doing the conversion on a Mac. In his words:

———————————————————-

I’m not suggesting that this is the easiest or the most efficient way to transfer all your old text messages from your iPhone to your new android phone, but it was “free” (apart from the donationware) and required no “programming” (if you don’t count excel functions).

I’ve broken it down step by step as much as possible, but this is not for the faint hearted. Maybe somebody clever could amalgamate all these steps into a script or something, but I’m just a tinkerer, not a programmer, so that’s me out. Good luck and Godspeed….

***

Create a backup of your iPhone SMSes

  • Sync your iPhone

Download the necessary software

Find and extract your old SMSes

  • Go to the folder User>Library>Application Support>Mobile Sync>Backup>[Some ID] (there may be more than one folder in the Backup Folder, but probably just one with the following file in)
  • Find the file 3d0d7e5fb2ce288813306e4d4636395e047a3d28 with the extension .mdbackup or .mddata and copy it to the desktop
  • Load the file in the SQLite browser
  • Select File>Export>Table as CSV file and choose the “message” table

Amend the file into SMS Backup format

  • Load the file into Excel (I know Excel isn’t free, but seriously, if you’re doing all this and you don’t have a spreadsheet program, you should probably stop now)
  • You should have the following headings:
     ROWID; address; date; text; flags; replace; svc_center; group_id; association_id; height; UIFlags; version; subject; country; headers; recipients; read
  • Create an extra column to the right of “date”. Make sure the original date column is in “Text” format (not “number” format) by right clicking the column and choosing >Format cells>Number>Text. Now copy the formula =C2&”000″ in the column to the right. This changes the date to the correct format for android (Epoch including milliseconds).
  • Create six columns to the right of the “text” column. iPhone stores certain characters that confuse the XML parser (ampersands, quotes, apostrophes, greater than signs and line breaks etc). Make sure the format of the column with the body of the SMS in is “text” format (otherwise it misses characters and makes you unhappy). In each of the successive columns, use the formulae:
    • =SUBSTITUTE(E2,CHAR(38),CHAR(38)&"amp;")
    • =SUBSTITUTE(F2,CHAR(60),CHAR(38)&"lt;")
    • =SUBSTITUTE(G2,CHAR(62),CHAR(38)&"gt;")
    • =SUBSTITUTE(H2,CHAR(34),CHAR(38)&"quot;")
    • =SUBSTITUTE(I2,CHAR(39),CHAR(38)&"apos;")
    • =SUBSTITUTE(J2,CHAR(13),CHAR(38)&"#13;")
    • Create an extra column to the right of “flags”. This column will tell your device if the text is received or sent. The iPhone uses received as “2” and sent as “3”, but these need to be “1” and “2” respectively for Android. Use =L2-1 to change this down the column.
    • In a new column, use the following formula:
    • ="  <sms protocol="&CHAR(34)&”0”&CHAR(34)&" address="&CHAR(34)&B2&CHAR(34)&" date="&CHAR(34)&D2&CHAR(34)&" subject="&CHAR(34)&”null”&CHAR(34)&" body="&CHAR(34)&K2&CHAR(34)&" toa="&CHAR(34)&”null”&CHAR(34)&" sc_toa="&CHAR(34)&”null”&CHAR(34)&" service_center="&CHAR(34)&”null”&CHAR(34)&" read="&CHAR(34)&”1”&CHAR(34)&" status="&CHAR(34)&”-1”&CHAR(34)&" />"

Create the SMS Backup and Restore File

  • Ensure you have at least one text in your Android Phone (either sent or received)
  • Do a Backup
  • Connect your phone to the computer and download the file saved by SMS Backup
  • Using the XML editor, add the text created in the last column of your excel document to the XML file source. It should look something like:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<smses>
<sms protocol="0" address="NHS" date="1272018455000" subject="null" body="Medical Student Teaching Reminder" toa="208" sc_toa="0" service_center="+447782000800" read="1" status="-1" /><sms protocol=”…” etc />
</smses>
  • Rename the file (just in case!) with an extra digit at the end and load this file back onto your SD card in the SMSBackupRestore Folder.
  • Do a restore.
  • Make donations to the makers of your free software and ensure that you’ve got SMS Backup and Restore to do regular backups. Also, consider downloading SMS Backup by Christoph Studer to convert all your SMSes to gmail messages.

——————————————–

Thanks to Bil for those instructions.

Google has recently updated its Maps App for Android to 4.1.1. Normally the update process in the market is straight forward, but some times it can get tricky, specially if you are using a custom ROM as most of the ROMs come with the Maps App pre-installed and that can make it difficult to update them.

When trying to update to the new version, if your Android phone crashes or restarts then you need to uninstall the previous version of the App first and then install the new version. To uninstall the previous version, run this command from the computer:

adb uninstall com.google.android.apps.maps

After this install the new version from the Android Market.