How To Read Sms Stored In Sim Card In Android
I was wondering if anyone knew anything about programmatically getting the SMS messages off of your phone's sim card on an android platform. I would like to write a program that a
Solution 1:
You can manage the SMS saved on the SIM card with the URI content://sms/icc
. It works also with the last version of Android.
For example this prints the contents of the cursor to System.out
:
Cursorcursor= getContentResolver().query(Uri.parse("content://sms/icc"), null, null, null, null);
DatabaseUtils.dumpCursor(cursor);
You need the permissions:
<uses-permissionandroid:name="android.permission.READ_SMS"/><uses-permissionandroid:name="android.permission.WRITE_SMS"/>
You can find a complete example here: https://github.com/android/platform_packages_apps_mms/blob/master/src/com/android/mms/ui/ManageSimMessages.java
Post a Comment for "How To Read Sms Stored In Sim Card In Android"