7

Here's what I want to do.

I have a Samsung galaxy phone whose message box is full. I want to download all the SMS messages from the mobile phone to my computer the Pythonic way. Before I decided to pose this question, I did a quick research on the internet, SO for possible answers.

I hit this lead and this lead here on the internet. These tutorials are quite extensive but do not provide the basic information of accessing the device and display its contents on a screen on my computer.

I read up a little more on using Twilio and other websites, but then that requires connecting to the internet and exposing my phone for the websites.

For now, I just want to access the SMS messages and display them as, perhaps, lists may be. Not the complicated stuff of automating, etc. There sure must be a simple method of doing this?

Community
  • 1
  • 1
Annapoornima Koppad
  • 1,376
  • 1
  • 17
  • 30

3 Answers3

2

To access messages on an Android phone directly, you'll need to read the "mmssms.db" file. This is located at data/data/com.android.providers.telephony/databases/mmssms.db, and is an SQLite database. However, this requires root to read. If you have root, use the SMS-tools library here.

If you don't have root access to your phone, you can likely use a built-in Android backup tool to save your SMS messages to your Gmail account. You'd then be able to scrape the messages, or potentially use the Gmail API to retrieve them.

Anonymous
  • 171
  • 2
  • 10
2

You can use "SMS Backup & Restore" app from Google Play and then manipulate generated backup file with Python. No need to write Python app for Android

Also, you can't backup sms in Google account, like the other answer says

Karol Zlot
  • 2,887
  • 2
  • 20
  • 37
0

I haven't experimented, but have a look at this page: https://groups.google.com/g/kivy-users/c/3ToGSpc0_1w. It looks pretty promising for accessing the sms history.

Wudfulstan
  • 129
  • 11