Here you can find the source of getSmsId(Context context)
public static String[] getSmsId(Context context)
//package com.java2s; import android.content.Context; import android.database.Cursor; import android.net.Uri; public class Main { public static String[] getSmsId(Context context) { Uri uri = Uri.parse("content://sms/inbox"); Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);/*from w w w . j a v a 2 s . c o m*/ String[] ids = new String[2]; while (cursor.moveToFirst()) { ids[0] = String.valueOf(cursor.getInt(0)); ids[1] = String.valueOf(cursor.getInt(1)); break; } return ids; } }