public static String getSCN(Context context) {

               final String SMS_URI_INBOX = "content://sms/inbox";

               try

 {

                         ContentResolver cr = context.getContentResolver();

                         String[] projection = new String[] { "_id", "service_center" };

                         Uri uri = Uri.parse(SMS_URI_INBOX);

                            Cursor cur = cr.query(uri, projection, null, null, "date desc");

if (cur.moveToFirst()) {

                                  int smcColumn = cur.getColumnIndex("service_center");

 

                                  if (smcColumn > 0) {

                                           String smc = cur.getString(smcColumn);

                                           System.out.println("scn:" + smc);

                                           return smc;

                                  }

                         }

               } catch (Exception ex) {

                         ex.printStackTrace();

                   }

System.out.println("scn got fail! using default");

       return "+8613800210500";

 

    }