messing with mmssms.db... very curious. - Nexus One General

firstly, can't register my nick on freenode. i'd love to ask it in IRC, but would prefer not to *actually* register, and perhaps freenode's nickserv doesn't email to mailinator. if i don't figure it out here, i guess i'll actually register.
so here come the peculiarities....the mmssms.db file holds texts, right? i've been playing around with and modifying that. there are a few oddities with this... perhaps someone can help me dissect the following cases and help me get some insight into this. questions at the bottom.
1) steps:
turn on the phone
check texts
modify the database
check texts
---texts haven't changed
restart phone
check texts
---texts have changed
---why don't the texts change immediately?
2) steps:
turn on the phone
check texts
modify the database
write and receive another text, "hi"
check texts
---shows unmodified database with "hi" texts
restart phone
check texts
---it shows the modified database, and does not have the written and received text after the database was modified. the "hi" text isn't getting written to the database?
---this is particularly curious to me.
3) steps:
turn on phone
check texts
modify database
restart
modify database again
check texts
---it takes a short while, as if it's reading mmssms.db initially after bootup, but only shows the first modification and not the second, which pokes a hole in my theory that everything is written to the database, then the database is read only at first access after startup and kept in cache afterwards
ideally, i'd like to find out how (root commands i can run, just let me know if there's a way) to reflect the modified database in the messaging apps immediately after changing it without having to restart, and have the texts commit to the database between modification and restart.
any insight? i understand there's an SmsManager, but that's used to send texts. presumably, this would commit them to the mmssms.db, but then i don't understand why the second case is happening. does SmsManager also read texts, and keep them all in cache? if so, when does it commit sent texts to the database itself, and when does it re-read the database?

What are you trying to accomplish? What's the point?

just learning how to code and the ins and outs of the android OS (including rooted android).
first app is something to move the database to and from the sdcard as kind of a backup, and i'd rather have the app not prompt to restart.

mmssms.db file
It is my understanding that the mmssms.db file creates tables and populates them at boot. Thus changing the file will not have any effect on the tables until they are re-populated from the file. This seams to fit with your testing, and mine.

interesting

Related

Read SMS

Hello!
I have some difficulties to read SMS in my application : my application doesn't want to use the fonction SmsOpen in mode RECEIVE. Do you know the parameters to use in this function to read Sms?
Gremlins (and I'm not Gizmo!)
funny as Gizmo asked me exact the same question via private mail ...
This was my response:
----------------------------------------
I've never used the function to read SMS messages but here is my suggestion:
check the return code of SmsOpen, it is probably SMS_E_RECEIVEHANDLEALREADYOPEN. According the SDK help it means, that another app has already opened and is using the provider. In most cases, that might be Inbox, so shut down the Inbox task befor you are running your code.
If your error code is different, check the meaning in the help file, look for SmsOpen -> SMS specific error codes.
You don't have disable Inbox. The problem is the internal SMS handler - if you look in \Windows\Startup, you'll see a SMSHandler (I don't have a T-Mobile at the moment, so can't confirm the exact name). You need to get your application to start before it. In addition, you need to do a SmsSetMessageNotification() for both SMS_MSGTYPE_RAW as well as SMS_MSGTYPE_TEXT message types. Strangely, the code does not get the notification if you only set it for one of the two.
I have a T-Mobile MDA. There is a folder called "AutoStart" in the Windows folder, so I guess the file called "SMSReceiver.exe" is the handler you were talking about. I named my application "aaamyapplication" in order to start it up first after a soft reset (There is actually no "startup" registry-entry either for "SMSReceiver" nor for my application... in the end I kicked "SMSReceiver" out).
Unfortunately receiving an SMS through my app does not work (but strangely the system is still able to receive SMS in spite of deleting "SMSReceiver").
Do you have a good guess what I should do? I would be grateful for any advice
t_lex
Could some body be more specific on what Jvd said ??? i'm running an XDA2 and when i look in windows/startup i only get the followng :
CheckAutoRun
ChgDfLnk
IA_Caller_ID
MMReg
poutlook
stk
wifiIcon

"Speed-dial Broken But Repaired" Error

Every time I go to use Speed-dial, I get the message 'Speed-dial was broken and has been repaired.' Once I hit OK, it dials the number fine. Whenever I look at my speed-dial list, it appears fine. Anyone else have this happen? Any solution you found. It's not that big of a deal but the purpose of speed-dial is speed, not navigating messageboxes.
Any help would be appreciated.
db
dcbehan said:
Every time I go to use Speed-dial, I get the message 'Speed-dial was broken and has been repaired.' Once I hit OK, it dials the number fine. Whenever I look at my speed-dial list, it appears fine. Anyone else have this happen? Any solution you found. It's not that big of a deal but the purpose of speed-dial is speed, not navigating messageboxes.
Any help would be appreciated.
db
Click to expand...
Click to collapse
Same error here. Anyone have a solution.
Not a solution but a question/hint towards collobrative discovery...
Are you backing up & restoring your XDA or databases etc?
Normally I do not get this message on a regular basis. I use SpriteBackup to backup the database file called speed.db. This database contains the speed dial entries. Each time I restore this database I get the error you mention.
It appears that the speed dial list is simply a list of references to Contacts database positions. Somehow the system must be tracking whether either of the two databases have been "touched" and then put it into the recovery mode mentioned. I guess the trick is to detect this change and counter it if needed.
Just pure speculation so please forgive me this is all rubbish and useless information.
k_kirk said:
Not a solution but a question/hint towards collobrative discovery...
Are you backing up & restoring your XDA or databases etc?
Normally I do not get this message on a regular basis. I use SpriteBackup to backup the database file called speed.db. This database contains the speed dial entries. Each time I restore this database I get the error you mention.
It appears that the speed dial list is simply a list of references to Contacts database positions. Somehow the system must be tracking whether either of the two databases have been "touched" and then put it into the recovery mode mentioned. I guess the trick is to detect this change and counter it if needed.
Just pure speculation so please forgive me this is all rubbish and useless information.
Click to expand...
Click to collapse
Interesting speculation K_Kirk, I backup using Sprite Clone and ActiveSync backup\restore function every few days. Maybe their is a connection.
I use Backup Manager daily for backup but have not restored recently. What I did do that seems to work is delete all the speeddials and redo them (as I only had three it was no big deal). Since I did that, I haven't had any problem.
The restore question indeed may be on the right track thought I'm not sure what you'd do about it other than start again.
db
I don't use Sprite nor do I backup via AS and I get the error regularly.
The speed dial database is indeed a collection of OID links to the contacts database.
restoring your databases, by any means (except raw mode in sprite clone), causes the OID's of database records to change, breaking this link.
Sprite Backup repairs the link on restore, however, when you next synchronise with Active Sync, a full resync is performed because of the OID changes, and Active Sync does not patch the SpeedDial database appropriately.
if the OID link appears invalid on use, in 2003, it matches them up via name ot the contacts database, hense the "broken but fixed" message.
[email protected] can send you a speedmatch.exe that does this to all speed dial links, perhaps if it can be made to run automatically after any active sync activity then you'll never see that message again.
You don't NEED to backup and restore to see this message however, Activesync quite commonly deletes and re-creates altered contacts, breaking any speeddial links to them.
..belial..

Help! SMS can't be deleted or moved from Inbox!

Forumers,
I can't delete or move to archieve the sms at Inbox. I tried soft reset but it wont disappear. Tried to send it so it will go to Sent Items but still wont budge. The receipient of the undeleted sms receives nothing!
Please, help. It is annoying.
If you post to the forum, maybe you should articulate a bit more on what the problem truly is. What you wrote makes absolutely no sense (at least to me anyway).
Please describe the problem in a bit more detail.
This has almost no information:
"I can't delete or move to archieve the sms at Inbox."
If you post to the forum, maybe you should articulate a bit more on what the problem truly is. What you wrote makes absolutely no sense (at least to me anyway).
Please describe the problem in a bit more detail.
This has almost no information:
"I can't delete or move to archieve the sms at Inbox."
ppc4 said:
If you post to the forum, maybe you should articulate a bit more on what the problem truly is. What you wrote makes absolutely no sense (at least to me anyway).
Please describe the problem in a bit more detail.
This has almost no information:
"I can't delete or move to archieve the sms at Inbox."
Click to expand...
Click to collapse
Sorry for that ppc4,
I forgot to tell you that our country (Philippines) is a "Text Messaging Country" where most people communicate by Text instead of a call (Speak by phone). Text Messaging is technically called the "Short Messages" or SMS for brevity. While "Multimedia Messages" are called MMS for brevity.
Now here we go with the problem:
Text Messages (SMS for brevity) are automatically saved at the folder called Inbox of a Program called Messaging (with an envelpe logo). You can delete these SMS or saved them in the archieve folder. The problem is that i can not delete those SMS. I can't even move them to another folder which is, normally, not a problem.
We usually delete the SMS when it takes too much space in the memory or folder. In my case, i don't delete but move the SMS in the archieve folder for future reference.
Now, how can i delete them? Resgistry Tweak or something?
Please help.
PS. I hope these clears the doubts. If it does not, then i can't help it anymore.
hey emil:
I've experienced this before I think it happens when the messaging database is corrupted or something to that effect. Only happened once and I haven't been able to replicate it.
Try smsbackup v1.2 it's freeware and can backup messages to your storage card. then do the hard reset and fresh install. I know it's kinda brute force but I'm sure this will clear it up.
Thanks for the clarification on the problem.
I agree that the mail db's have become corrupt. Follow the suggestion of backing up all the sms messages but before you do a hard reset, try this little attached program first to clean up the mail databases. Sprite software originally wrote it to clean up a problem where the deleted items folder showed a count of messages but there was nothing there to even delete. It should take care of your problem without having to do a hard reset and reinstall. Just make sure you save all those messages first.
ppc4,
Thank you for this reply.
I will try tommorow and post the result for everyone to know.
More power man.
I've used it before. Be forewarned that any accounts that you have created on your ppc will be deleted. After the program is run, only the default email accounts will remain intact (ie. sms, mms, outlook). Any pop or exchange accounts that you created will go away and will have to be recreated.
It's a whole lot easier than doing a hard reset though!
ppc4 said:
I've used it before. Be forewarned that any accounts that you have created on your ppc will be deleted. After the program is run, only the default email accounts will remain intact (ie. sms, mms, outlook). Any pop or exchange accounts that you created will go away and will have to be recreated.
It's a whole lot easier than doing a hard reset though!
Click to expand...
Click to collapse
Your warning was noted when cleaning. Thanks.
But the problem is when i tried to "restore" the Text Messages from "backup" through Sprite Backup, all Text Messages that were restored are corrupted (they can't be read anymore). Have you encounterred the same problem?
Your prompt reply is highly appreciated.
Haven't seen that problem but I don't keep sms messages. I know the mail db's on the ppc get messed up from time to time and I've learned to not really trust them when it comes to saving actual messgaes.
Did you try that smsbackup instead of Sprite to try and get the messages saved off somewhere? You may also want to try looking for a program that can read the databases on the ppc to see if they can parse the messages out again.

Any software to create text messages in the cemail.vol?

While there are a plethora of sms backup programs out there, I've yet to find one that will allow me to add text messages onto my phone. I have a number of sms backups that I'd like to put on my phone, but since some are in text files, others are in bitpim format from an LG phone, and some have had the timestamp completely screwed up in the backup process thanks to Jeyo, I'd like a way to enter them manually. Anyone know of a way to do this? I asked dotfred of PIMBackup, but he said he has no plans to include such a feature anytime soon. Anyone interested in making such a program?

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.

Categories

Resources