64

Where in the file system are SMS messages stored?

I'm using ES File Explorer to browse around but can't seem to find this - is it on the phone or the SD, and where?

I have an HTC Wildfire but I would imagine it doesn't vary hugely from vendor to vendor (although I am an iOS developer who knows little about Android).

Alex Coplan
  • 743
  • 1
  • 6
  • 6

4 Answers4

45

See here: https://stackoverflow.com/questions/4809874/how-to-access-the-sms-storage-on-android

The gist is that SMS/MMS are residing in databases on the phone and the answer to the question contains the link to this tutorial.

The location of the database might vary from phone to phone, but you can look it up with this command via adb (you need to be root to find it because it's in the protected storage area):

find / -name "*mmssms*"

On my device (Samsung Galaxy S) these databases turned up:

./dbdata/databases/com.android.providers.telephony/mmssms.db
./data/data/com.jb.gosms/databases/gommssms.db

The first one being the native db and the second one is by the sms app I'm using.

joweiser
  • 1,005
  • 9
  • 13
  • could you explain how it's stored... it looks like XML? also where is it? - I'm not talking from a coding point of view as I do not know anything about android development. – Alex Coplan Dec 13 '11 at 23:44
  • 3
    It's an sqlite database. You can look at it with an sqlite viewer - which operating system do you use? – joweiser Dec 13 '11 at 23:50
  • Here's a platform independent sqlite viewer if you want to look at those files: http://sourceforge.net/projects/sqlitebrowser/ – joweiser Dec 14 '11 at 00:24
  • Thanks a lot for this answer! I had a some weird problem where sending SMS to a contact would send them to other contacts. I had to edit an entry in canonical_addresses in mmssms.db. Now it's working as it should again. – TheLostOne Jun 26 '13 at 12:32
  • 2
    @masterjo: SQLite Database Browser hasn't been developed since 2009 and it couldn't show anything from the .db file when I tried it today. Here's another SQLite browser that worked - http://sqlitestudio.one.pl/ – Dan Dascalescu Oct 17 '13 at 07:17
  • On kitkat: device/data/data/com.android.providers.telephony/databases/mmssms.db – JinSnow Jun 08 '17 at 14:44
  • I found mine at device\data\data\com.android.messaging\databases\ on android oreo. – Ajay Jan 12 '20 at 15:33
10

Looks like it moved to data/User_DE/0/com.android.providers.telephony/databases with Nougat.

At least, this is where it can be found on my Nexus 6. Hope this helps.

bmdixon
  • 8,815
  • 17
  • 43
  • 64
El mexiken
  • 101
  • 1
  • 2
  • I also found this to be the location on Android 11. Note that user_de is lower case, not capitalised like you have put – coxe87b Jun 13 '21 at 14:54
10

Here's a helpful piece of info also.

This is the absolute path to SMS and MMS DB on most android devices:

/data/data/com.android.providers/telephony/databases/mmssms.db

ale
  • 19,723
  • 34
  • 110
  • 159
user42973
  • 99
  • 1
  • 2
  • 1
    This should actually be renamed to /data/data/com.android.providers.telephony/databases/mmssms.db.

    Notice the .telephony

    – smac89 Dec 30 '16 at 08:02
  • On kitkat device/data/data/com.android.providers.telephony/databases/m‌​mssms.db – JinSnow Jun 08 '17 at 14:45
9

Note that, as of Kitkat (Android 4.4, released Sept 2013), the default path changed from:

/data/data/com.android.providers/telephony/databases/mmssms.db

to

/data/data/com.android.providers.telephony/databases/mmssms.db

Update: As mentioned in the comments, the latter path already exists in JB.

eyecatchUp
  • 241
  • 2
  • 6
  • The changes must have been introduced way before KitKat was launched since /data/data/com.android.providers.telephony/databases/mmssms.db exists in my JB. – Firelord Jan 10 '16 at 05:09
  • Well, JB is one release before KK. So, "way before" may be a bit exaggerated. ;-) – eyecatchUp Jan 10 '16 at 18:48