[Q] Retrieve contacts from database - Defy Q&A, Help & Troubleshooting

I have a problem with my Defy running CM11. Yesterday it just rebooted randomly during writing of SMS message. I wouldn't really mind this(because it happens sometimes with unstable fw) but half of my contacts were gone. I know I should sync them with my Google account but I didn't for some time now and I really would like to restore them. I copied 'contacts2.db" file, opened it in text editor and it is possible to find those missing numbers there, but the context is really hard to figure something out. I found it in the table named "search_index_content". The table is looking like that: "CREATE TABLE 'search_index_content'(docid INTEGER PRIMARY KEY, 'c0contact_id', 'c1content', 'c2name', 'c3tokens')". Number is in the "c3tokens" column, there are two ids in first two columns and some probably encoded text in "c2name" column. Does any one know how to decode the text from this column or how to generally restore ALL contacts from "contacts2.db"?

qwert940 said:
I have a problem with my Defy running CM11. Yesterday it just rebooted randomly during writing of SMS message. I wouldn't really mind this(because it happens sometimes with unstable fw) but half of my contacts were gone. I know I should sync them with my Google account but I didn't for some time now and I really would like to restore them. I copied 'contacts2.db" file, opened it in text editor and it is possible to find those missing numbers there, but the context is really hard to figure something out. I found it in the table named "search_index_content". The table is looking like that: "CREATE TABLE 'search_index_content'(docid INTEGER PRIMARY KEY, 'c0contact_id', 'c1content', 'c2name', 'c3tokens')". Number is in the "c3tokens" column, there are two ids in first two columns and some probably encoded text in "c2name" column. Does any one know how to decode the text from this column or how to generally restore ALL contacts from "contacts2.db"?
Click to expand...
Click to collapse
First of all export your contacts to SD card. Then you can find 00001.vcf file in SD card. Open it using a text editor and look for missing contacts. Or after exporting it display ......contacts copied. If it equals to your full contacts list then import it.
Sent from my MB526 using Tapatalk 2

I wouldn't name you answer brilliant, but no offense you tried. If I'm working with database to restore at least some of the lost contacts if not all of them do you really think it's that simple to click "Export to SD" on my phone. I wrote that the contacts are missing. There are not showing in directory so they won't be exported to vcf
Nonetheless I managed to encode the text. It's in hex system, however it's not ASCII, I'm not sure which encoding it is. Topic can be closed.

Related

Contact Name Format

Hi All.
I have just got my M1000 and have got a quick question.
All of my contacts are surname/firstname.
Is there anyway to change this.
I have searched the forum but couldnt find anything
thanks
Tim
The only fixes mentioned involved changing these settings on the Outlook (i.e. the PC) side. For new entries, you can specify "File As (Firstname Lastname)" in Outlook. For older ones, you have to change them, and somebody on this forum wrote a utility to do that to a handful of contacts.
On the XDA itself you don't have an option to specify "File As". I've gotten into the habit of not writing the names directly but making the name dropdown appear (by clicking on the arrow to the right) and writing the full name in the "First Name" entry.
try pocket informant.
Very powerful addon for the PCC outlook.
Has the function u're looking for... showing first name then surname. Plus alot of extra functions.
thanks

Contacts Arrangement

When i save a contact with name and surname it appears on my contact list like this: Surname, Name (ex: Gates, Bill), can i change this so that the name is displayed first?(ex: Bill Gates).
Furthermore, can i disable the default format by which phone numbers are saved? By default when i add a phone number to a contact it appears like this (xxx) xxx-xxxx. Not that i have a problem with this BUT when i transfered some contacts from my p910 i found out that they were saved like xxxxxxxxxx. So what, you may think...well actually when a message delivery report arrives (and the contact is not saved with the "default phone format"), next to the phone number(in the delivery report) shows the name of the contact, something that is very usefull when -for example- multiple messages are sent or when a message is delivered 2-3 days later.
ps: actually, what i really need is not neccesarily to change the default phone format but to find out a way to see in the message delivery report the name of the contact that the message was delivered to.
ps2:sorry for the huge post!
thanx in advance
I had the same problem 2 years ago, and found out that it is impossible to let the PPC display the name as "Firstname Surname". So I "solved" it by saving the full name of the contact under Firstname. I know it isn't a solution but I couldn't get it to display it how I wanted it.
yeah, i did the same thing, but as you said it isn't a solution
Your problem here then is to hack the deilvery report, not Poutlook.
V
vijay555 said:
Your problem here then is to hack the deilvery report, not Poutlook.
V
Click to expand...
Click to collapse
what matters is to achieve the goal and not how it will be achieved
True, but "Every Journey Begins With a Single Step, Minus Your Shoes".
Knowing what to hack and what not to hack is your first step. Poutlook, I believe, stores the contact data in whatever format it is happy with. You can't change that - you can change the external display of that data through the File As field, but that's subject to the app you are using using that field and not the underlying data stored in Poutlook.
So, if you wish to force the message delivery report into using the fields as you want them, hack that. Poutlook can't be easily hacked and is not your problem. So research hacking the delivery report, and/or learn to hack it yourself to force custom output.
V
thanx vijay555, i found this Name of recipient in SMS delivery receipt on WM5 and i guess this is what i was looking for
this really is very simple (assuming you sync with outlook on your pc).
In your contacts in outlook, double click a contact and in the "file as" drop down change it to "firstname lastname". then sync with your device and hey presto, all will be as you want!
bit of a pain in the arse if you've got 5billion contacts, but hey!
yeah, i discovered it yesterday, thanx anyway, but as you said its a pain...
I don't get it. If you're going to use File As, just use FileasFL to do the conversion automatically on your PPC.
V

How to transfer SMS Messages from a Nokia phone to X1 (Win Mob device)

Hi Guys,
This is my first post. I have recently purchased an Xperia X1 upgrading from an N73. I was searching for a way to transfer sms from the Nokia N73 to Windows Mobile but came up empty handed. I found a few threads on this forum which asked the question, but didn't end up helping me. I have found a way to do this, I will admit this may be a pain in the ass, but if you stick with it (and if its important enough) you will have your SMS messages transferred across to your WM device.
Tools you will need
Nokia PC Suite (whichever version you need for your mobile)
SMSImport for PPC (http://www.freewarepocketpc.net/ppc-download-smsimport-v1-0-1.html)
ABC Amber Nokia Converter
XML Notepad 2007
Steps
1. Firstly its best we extract the messages from your Nokia phone first. Open PC Suite and view ALL the messages you want to transfer. I just selected my inbox
and copied all messages.
2. Create a folder on your desktop and paste all the messages in the folder.
3. We will leave the messages alone at this stage and prepare the xml file template you use to import your messages. Copy SMSImport to your PPC device (doesnt matter which memory you choose) Run the app. Its best to run this with some sms messages in your inbox so you can see how its exported. Export a copy of your messages to a file. If your doing this on a fresh install below is the xml structure.
<SMSExport><store name="SMS"><folder name="Deleted Items"/><folder name="Drafts"/><folder name="Inbox">
<message date="DATE" sender="SENDER MOBILE NUMBER" recipient="">MESSAGE CONTENT</message>
</folder><folder name="Outbox"/><folder name="Sent Items"/></store></SMSExport>
You may notice that there are additional folder names. You can export messages from other folders on your phone and import them under the headers in a similar format as per below
<SMSExport><store name="SMS">
<folder name="Deleted Items"/>
<message date="DATE" sender="SENDER MOBILE NUMBER" recipient="">MESSAGE CONTENT</message>
</folder><folder name="Drafts"/>
<message date="DATE" sender="SENDER MOBILE NUMBER" recipient="">MESSAGE CONTENT</message>
</folder><folder name="Inbox">
<message date="DATE" sender="SENDER MOBILE NUMBER" recipient="">MESSAGE CONTENT</message>
</folder><folder name="Outbox"/>
<message date="DATE" sender="SENDER MOBILE NUMBER" recipient="">MESSAGE CONTENT</message>
</folder><folder name="Sent Items"/>
<message date="DATE" sender="SENDER MOBILE NUMBER" recipient="">MESSAGE CONTENT</message>
</store></SMSExport>
Simply put, there is a message in each folder above, it will restore this message in each folder on your PPC device. Got it? Good =)
4. We will return to your copied messages now. Open ABC Amber Nokia Converter and open all the messages in the folder you created earlier.
This will list all messages and show you the details of each message.
5. Now depending on how you view your SMS messages on your PPC, there is Conversation view or the normal sms itemised view. If you decide to use the Conversation view, to show the messages in the correct order from which they were recieved, you will need to sort by date, oldest messages at the top. If you use the normal sms itemised view, you dont need to worry about sorting (as far as I know).
6. Select all messages and export to a excel spreadsheet (xls). Why are we exporting to Excel? Because the next stage will make preparing the output
for the xml doc so much faster and easer.
7. Open the excel sheet and you will see all your messages listed with the individual details separated by column. YOu will need to edit this output to resemble the following order
DATE/TIME, MOBILENUMBER, MESSAGE
8. Next we need to insert the xml tags to make life easy. You will need to create the following tags.
<message date="
" sender="
" recipient="">
</message>
9. Now for each line you will need to insert additional columns for each of the above tags. The end result should be like this
COLUMN A = <message date="
COLUMN B = DATE/TIME
COLUMN C = " sender="
COLUMN D = MOBILENUMBER
COLUMN E = " recipient="">
COLUMN F = MESSAGE
COLUMN G = </message>
Ensure that this format is consistent for all messages.
10. Once you have completed this, Select all text and copy it to notepad. When the data has been pasted there will be a lot of tab spacing. These will need to be removed. The best way is to copy a block of these spaces (a tab space) and use find and replace to remove the spacing. HINT Find box will have your tab space, Replace will have nothing. Click Replace all and this will remove all the tab spaces.
11. Once this has been done you will need to then sort out your messages into the folders that you want them to be imported into. Use the example above as your guide.
12. Once you have done the sorting of your messages, you will need to add the following to the top of the document
<SMSExport><store name="SMS">
And the following to the end
</store></SMSExport>
Save as a .xml file.
13. As xml is picky on which characters are accepted, you will need to vet the xml file for bogus characters which SMSImport will reject, Open your xml file in XML Notepad 2007. It will flag the location of unsupported characters with an error message, giving the line number and character number. The status bar in Notepad will help you with the locations if you have a large amount of messages. Typical characters that arent supported will be @ & and other non English standard lettering. If there are no errors, the xml file will load and display a tree output which you can expand the folders and see your messages.
14. Now for the final step. Copy the xml file to your PPC device and start SMSImport. Point to your xml file and tap it. If things are right, You will see the app processing and adding all the messages into your SMS folders!!!
Thats it!!!.
Now I should mention on a side note that the mobile numbers do not display the + sign on the mobile number like +61000000000 for example, so linking it to your contacts will not work. If you want to be anal about how the SMS display (you want to see the Contacts name instead of the number) you will need to do the following
1. Using Notepad, and the find and replace option, search the first 3 numbers eg 614, replace it with +614 (Im using Australian country codes and the 4 is the second number for mobile numbers in Aus) This will make the numbers a recognisable format for your mobile.
2. So your messages display with the contacts name you will need to replace the following string
<message date="DATE" sender="SENDER MOBILE NUMBER" recipient="">MESSAGE CONTENT</message>
With the following
<message date="DATE" sender="""CONTACT NAME" <SENDER MOBILE NUMBER>" recipient="">MESSAGE CONTENT</message>
This will be a time consuming process if you arent to savvy with your mates mobile numbers, but it makes it worth it in the end. Once you have made the changes save the xml file and follow steps 13 and 14 to check the import file and import into your PPC.
This process took me a few hours to figure out and im happy with the results. I agree its not the simplest way of doing this, but so far the only documented way I have found that works.
I hope this helps
I just wanted to thank you for your HowTo! I had to to this from an old SE-Phone (W960i) but the steps have been mainly the same. Although I needed up to 3 hours to handle 300+ SMS I'm now happy to have them all on my X1
Also I will indeed never read them all again, but it feels just good for me to have them not lost
THX a LOT!
thx for this idea, I transfered my sms from nokia 3110c to my htc wizard with your help :")
I made updated version of the transfer guide: http://forum.xda-developers.com/showthread.php?p=4385729#post4385729
Also made a little parser for simple user-friendly xml creating.
Check it out :")
Hi dude, i need a similar kind of help, I am sending my Xperia X1 for repairs, I wanted to backup my sms onto my PC, do you any way I could acheive this?
Your help will be much appreciated.
Thnaks
PIM backup? Jeyo SMS backup? I think the best would be full backup with SPB backup utility
Do u know how to transfer sms from X1 to PC ?
How to transfer sms from X1 to a PC ?
Hi dude, i need a similar kind of help, I am sending my Xperia X1 for repairs, I wanted to backup my sms onto my PC, do you any way I could acheive this?
Your help will be much appreciated.
Thnaks
Help!!
Ran this procedure on a HD2 and completed all steps successfully. However, I don't see any messages when I go to the message panel on the home screen. what could be the possible issue?
thanks in advance.
Try http://www.bloove.com
MOBILedit!
Hello,
I would like to point out a software for mobile phones management called MOBILedit.
MOBILedit is a PC software, which is among other things able to browse, edit, copy, backup and migrate data within connected mobile phones. Mobile phones may be connected by cable, BlueTooth or even IrDA.
Especially the possibility to migrate contacts, messages and other content may come handy in this case.
It is not free, but it is totally worth it.
I hope you will give it a try - there is a lite version available to see how it works.
Thanks!
its a very awsome mobile phone............i like its specification............
yeah that takes ages, but deleting messages is always like loosing part of your life so thanks a lot

SMS incoming problem ... solution !!!

Hi there.
I had problem with sms-messages after modaco-2.2 flashing.
When I got sms-message phone made sound and vibration but nothing to read in message program.
After reading couple hundred pages I found solution:
(Before you do this remember that this distroys your old mms and sms archive )
1. I found and downloaded adb.zip file and extracted it. You can get it from attacement. ( nope ... I can't upload it here )
2. Then I turned phones debugging on ( home-> menu-> settings-> Applications-> Developement -> USB debugging on
3. Wired phone to my mac
4. Opened terminal and then went to that directory where I extracted adb.zip
5. First checked device with command
./adb device
6. When everything was ok then shell command
./adb shell
7. Now prompt was #
8. Changed directory with command
# cd /data/data/com.android.providers.telephony/databases
9. Look that there was mmssms.db
# ls mmssms.db
10. Erased that file
# rm mmssms.db
11. Went out from shell
# exit
12. Went out from terminal
exit
13. Rebooted my phone and then everythin worked perfect.
I think that old mmssms.db file was different format than new one and thats why message-program could't use it.
I hope that this helps somebody.
...Lasse...
worked perfectly for me, thanks a lot of the tip!
The database from 2.73.405.5 build got a lot of changes to the old one (1.76.405.6). So it does not work to copy back the old Database after an update. I imported my old Mails manual to the new databasefile by accessing the database directly.
patzek said:
The database from 2.73.405.5 build got a lot of changes to the old one (1.76.405.6). So it does not work to copy back the old Database after an update. I imported my old Mails manual to the new databasefile by accessing the database directly.
Click to expand...
Click to collapse
Could you please describe how you restored your old data? I know it's a SQLite database and manually changed data in it before updating, but my knowledge with SQLite ain't that great, so I don't know "the perfect" SQL manager and so on...
Any advice is highly appreciated!
For me it was really easy as i only have SMS messages in my Database. So i wrote a very simple windows-app that imports the old messages out of the old database-file into the new database.
i have read about this fix in a german forum. it doesn't seem to fix the issue completely. i would suggest to keep smstomailbox installed for a while so we can be sure this really is a permanent fix.
This fix (german forum) does not work because the database got also changes in other parts of the database than the sms table. only in import into the new format will work.
patzek said:
For me it was really easy as i only have SMS messages in my Database. So i wrote a very simple windows-app that imports the old messages out of the old database-file into the new database.
Click to expand...
Click to collapse
Yes, I used your method when migrating from Windows to Android. It worked great and it was me who wrote directions for Notepad++ on how to change dates to proper format with regexp for other countries
Although, with the new Hero ROM database ROM seems to have changed in such a way that old message collides with new database/table structure. I will transfer new database to my computer and do some research soon.
sibbor said:
Yes, I used your method when migrating from Windows to Android. It worked great and it was me who wrote directions for Notepad++ on how to change dates to proper format with regexp for other countries
Although, with the new Hero ROM database ROM seems to have changed in such a way that old message collides with new database/table structure. I will transfer new database to my computer and do some research soon.
Click to expand...
Click to collapse
The SMSImport Application was done to import my SMS Messages from Windows Mobile. The application is based on the 1.76 Rom SMS Database.
After my Update to 2.73 is was in the same situation, how to get the messages into the new Databaseformat and so i wrote a second little application that just make a transfer from the old databsefile to the new databasefile Quick and Dirty
sibbor said:
Yes, I used your method when migrating from Windows to Android. It worked great and it was me who wrote directions for Notepad++ on how to change dates to proper format with regexp for other countries
Although, with the new Hero ROM database ROM seems to have changed in such a way that old message collides with new database/table structure. I will transfer new database to my computer and do some research soon.
Click to expand...
Click to collapse
patzek said:
The SMSImport Application was done to import my SMS Messages from Windows Mobile. The application is based on the 1.76 Rom SMS Database.
After my Update to 2.73 is was in the same situation, how to get the messages into the new Databaseformat and so i wrote a second little application that just make a transfer from the old databsefile to the new databasefile Quick and Dirty
Click to expand...
Click to collapse
Come on guys, lets share these about...
I have to migrate my brothers contacts from his Diamond to his Hero, he's on the 1.76 rom at the minute but will be upgrading to 2.73 later on.
I then have to import my messages from my old 1.76 database to my 2.73 database.
patzek said:
The SMSImport Application was done to import my SMS Messages from Windows Mobile. The application is based on the 1.76 Rom SMS Database.
After my Update to 2.73 is was in the same situation, how to get the messages into the new Databaseformat and so i wrote a second little application that just make a transfer from the old databsefile to the new databasefile Quick and Dirty
Click to expand...
Click to collapse
Ah, sorry I missunderstood. Please share your dirty solution with us ;-)! Btw, can one merge the old structure with the new one (two databases) and keep data intact from both? Or is it just a conversation from old to new structure, where you keep old messages? Either way, sounds great! I can manually add messages that I recieved in my new database "manually" afterwards
i will try to make an sql update script that will update the structure from the old database to the new one.
so i make a quick compare of the database files from a wiped hero 1.76 rom and an wiped 2.73 hero rom. the only difference is the column "index_on_sim" in the table "sms" as an integer field. an simple "alter table sms add index_on_sim integer null" would fix this. i think this field will store the id of an contact which is on the sim card stored, otherwise its value is "null" on messages that was sended and "-1" on messages that was received.
there are hugher differences between a normal android sms database and the hero one and and "easy" upgrade is not possible. its necessary to add columns to different tables and it is also necessary to have them in the right possition so that when a application try to access the column by the index and not with the column name it uses the right one. maybe there is a application in the www available that makes an automatic database update. for other databases like ms sql server there are solutions available...
patzek said:
so i make a quick compare of the database files from a wiped hero 1.76 rom and an wiped 2.73 hero rom. the only difference is the column "index_on_sim" in the table "sms" as an integer field. an simple "alter table sms add index_on_sim integer null" would fix this. i think this field will store the id of an contact which is on the sim card stored, otherwise its value is "null" on messages that was sended and "-1" on messages that was received.
there are hugher differences between a normal android sms database and the hero one and and "easy" upgrade is not possible. its necessary to add columns to different tables and it is also necessary to have them in the right possition so that when a application try to access the column by the index and not with the column name it uses the right one. maybe there is a application in the www available that makes an automatic database update. for other databases like ms sql server there are solutions available...
Click to expand...
Click to collapse
Yes, I've made this conclusion too. I've now merged my entire MMS/SMS database:
1) I exported both the 1.76 db and the 2.73 db as SQL dumps
2) Merged them together and got rid of lots of messed up data. Also I had to fix formatting for strings for the application to be able to import it properly again. Changed some ID's too.
3) Then I truncated the tables "sms" & "threads" + made minior fixes around the database (clean-up). and made changes to other ID's for it to look cleaner.
Since I've done SMS migration like this: Nokia > Windows Mobile > Android (Hero, v1.76) > Android (Hero, 2.73) there was some differences within the database. I fixed number formatting + updated data in proper places. Ex. sms.toa + sms.sc_toa (145 for one person and 0 for me), sms.person to correct ID for the contact (since there was diffs between the two Android databases and no person ID at all for earlier merged databases; Nokia + WM).
Side note: it seems sms.index_on_sim should be NULL for outgoing SMS'es and -1 for incoming (that's not stored on SIM card).
Also I added correct ID to the sms.person column for all my old SMS'es. First
Tx uttila for the sms problem solution
@uttila: it worked fine for me and my htc hero. I erased the database table mmssms.db and now it saves the messages
I have the Sprint version of the HTC Hero, Just got it a few days ago. I started noticing in about my second day having the phone that I wasnt receiving texts either. Same problem as everyone else, could send, make calls, receive calls, etc. Just couldnt recieve texts. After a while, i will eventually be able to recieve again, usually because I restart the phone, or that could just be a coincidence. But nevertheless I dont recieve any of the "lost" texts.
I just got off the phone with customer service with Sprint, They had me turn the phone off, take the battery out, and were doing some "updates" on their end. And then tried to send a text to me after turning it back on. They werent able to resolve the problem. They are telling me to take it to a Sprint store, so that they can run some tests on the phone, and send it off for a replacement.
I mentioned to the customer service rep that I've read about this problem online, that alot of people seem to be having the same problem. His response was "Yeah, I have been receiving some calls, but not to the point where we would consider it a known issue"
So I guess thats where we stand right now. Is there someway that I can fix it on my end, or is there an update out from HTC that resolve's this. Because it doesn't seem to just be a Sprint issue, since people overseas in Europe with different providers are having the same issue. So I'm guessing its a software\hardware issue, and not a network problem.
Any solutions?
Same Issue here.... about to send it back!
From Sprint's actual Hero forum users are reporting the same issue...
http://community.sprint.com/baw/thread/22913?start=30&tstart=0&reqsorting=dec
Hope posting this link is ok
Additionally it seems like some files are not being removed when performing a factory reset as I had installed a sound board and after two factory resets I noticed some sound files were still on my phone. TO me this indicates not all files are being removed correctly. I doubt the sound board messed anything up but this may indicate another app inadvertently did and the factory reset isn't cutting it as far as fixing the issue. Called Sprint and they offered to replace for free and also refreshed my syst settings which had zero impact.

"Old" SMS Application for HD2?

Hi. I'd need the option to use the old Application for managing the SMS Store.
Does anybody know if it is incorporated in HD2-Roms but hidden, or if the old application from a 6.1 ROM would work on HD2?
Backgroud: I used to created subfolders under Inbox and sent messages as an archive for all SMS I get and send. Every year I export them with PIMBackup and save the resulting file to a safe place.
Now, with the new messaging-application I'm not able to change the folders anymore. The subfolders are still there (I see them in PIMBackup when trying to create a backup), but I can't access them.
Take a look here
Cheers.
Oh thank you.
I must have defined my searches wrong, cause I missed that posting
EDIT: Oh, thank you again. You made me edit the registry and I mistankely changed the Name "System" und HKLM to "e" and I couldn't change it back. :S
Since it is one of the most important keys in the registry, only a hard-reset brought my HD2 back to life.
Well, it was not so bad at all. I have all my data as a backup.
Actually, it was kinda funny to see what the device does when you edit the registry and make a mistake.

Categories

Resources