MessengerPigeon/app2/src/main/java/com/epicstudios/messengerpigeon/Presenter.java
void addConversation(List<Pair<Long, String>> people, String message) {
        List<String> phonNums = new ArrayList<>();
        final int home = ContactsContract.CommonDataKinds.Phone.TYPE_HOME;
        final int main = ContactsContract.CommonDataKinds.Phone.TYPE_MAIN;
        final int mobile = ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE;
        final int other = ContactsContract.CommonDataKinds.Phone.TYPE_OTHER;
        final int custom = ContactsContract.CommonDataKinds.Phone.TYPE_CUSTOM;
        final int wmobile = ContactsContract.CommonDataKinds.Phone.TYPE_WORK_MOBILE;
        final int pager = ContactsContract.CommonDataKinds.Phone.TYPE_PAGER; //?

        for(Pair person: people) {
            Cursor c = cr.query(ContactsContract.Data.CONTENT_URI,
                    new String[]{ContactsContract.Data._ID, ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.TYPE, ContactsContract.CommonDataKinds.Phone.LABEL},
                    ContactsContract.Data.CONTACT_ID + "=?" + " AND "
                            + ContactsContract.Data.MIMETYPE + "='" + ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE + "'",
                    new String[]{String.valueOf(person.first)}, null);

            if(c != null) {
                final int TYPE = c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE);
                String Number = "";
                while(c.moveToNext()){
                    int type = c.getInt(TYPE);
                    Log.d(TAG+"numbers", "Type = "+type);
                    if(type == home) {
                        Number = c.getString(c.getColumnIndex(ContactsContract.Data.DATA1));
                    }
                    if (type == mobile){
                        Number = c.getString(c.getColumnIndex(ContactsContract.Data.DATA1));
                        break;
                    }
                }
                if(Number.equals("")){
                    c.moveToFirst();
                    Number = c.getString(c.getColumnIndex(ContactsContract.Data.DATA1));
                }
                phonNums.add(Number);
                c.close();
            }
        }
        Log.d(TAG+"numbers", "phonenumbers = "+phonNums.toString());
        smsManager = SmsManager.getDefault();
        for(String num: phonNums) { send(num, message); }
    }
/**
     * addConversation creates a new sms or mms object to be sent
     * @param people the numbers of the participants
     */
addConversation creates a new sms or mms object to be sent
@param people the numbers of the participants
addConversation creates a new sms or mms object to be sent @param people the numbers of the participants
void addConversation(List<Pair<Long, String>> people, String message) {
        List<String> phonNums = new ArrayList<>();
        final int home = ContactsContract.CommonDataKinds.Phone.TYPE_HOME;
        final int main = ContactsContract.CommonDataKinds.Phone.TYPE_MAIN;
        final int mobile = ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE;
        final int other = ContactsContract.CommonDataKinds.Phone.TYPE_OTHER;
        final int custom = ContactsContract.CommonDataKinds.Phone.TYPE_CUSTOM;
        final int wmobile = ContactsContract.CommonDataKinds.Phone.TYPE_WORK_MOBILE;
        final int pager = ContactsContract.CommonDataKinds.Phone.TYPE_PAGER; 
        for(Pair person: people) {
            Cursor c = cr.query(ContactsContract.Data.CONTENT_URI,
                    new String[]{ContactsContract.Data._ID, ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.TYPE, ContactsContract.CommonDataKinds.Phone.LABEL},
                    ContactsContract.Data.CONTACT_ID + "=?" + " AND "
                            + ContactsContract.Data.MIMETYPE + "='" + ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE + "'",
                    new String[]{String.valueOf(person.first)}, null);
            if(c != null) {
                final int TYPE = c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE);
                String Number = "";
                while(c.moveToNext()){
                    int type = c.getInt(TYPE);
                    Log.d(TAG+"numbers", "Type = "+type);
                    if(type == home) {
                        Number = c.getString(c.getColumnIndex(ContactsContract.Data.DATA1));
                    }
                    if (type == mobile){
                        Number = c.getString(c.getColumnIndex(ContactsContract.Data.DATA1));
                        break;
                    }
                }
                if(Number.equals("")){
                    c.moveToFirst();
                    Number = c.getString(c.getColumnIndex(ContactsContract.Data.DATA1));
                }
                phonNums.add(Number);
                c.close();
            }
        }
        Log.d(TAG+"numbers", "phonenumbers = "+phonNums.toString());
        smsManager = SmsManager.getDefault();
        for(String num: phonNums) { send(num, message); }
    }
void addConversation ( List < Pair < Long , String > > people , String message ) { List < String > phonNums = new ArrayList < > ( ) ; final int home = ContactsContract . CommonDataKinds . Phone . TYPE_HOME ; final int main = ContactsContract . CommonDataKinds . Phone . TYPE_MAIN ; final int mobile = ContactsContract . CommonDataKinds . Phone . TYPE_MOBILE ; final int other = ContactsContract . CommonDataKinds . Phone . TYPE_OTHER ; final int custom = ContactsContract . CommonDataKinds . Phone . TYPE_CUSTOM ; final int wmobile = ContactsContract . CommonDataKinds . Phone . TYPE_WORK_MOBILE ; final int pager = ContactsContract . CommonDataKinds . Phone . TYPE_PAGER ; for ( Pair person : people ) { Cursor c = cr . query ( ContactsContract . Data . CONTENT_URI , new String [ ] { ContactsContract . Data . _ID , ContactsContract . CommonDataKinds . Phone . NUMBER , ContactsContract . CommonDataKinds . Phone . TYPE , ContactsContract . CommonDataKinds . Phone . LABEL } , ContactsContract . Data . CONTACT_ID + "=?" + " AND " + ContactsContract . Data . MIMETYPE + "='" + ContactsContract . CommonDataKinds . Phone . CONTENT_ITEM_TYPE + "'" , new String [ ] { String . valueOf ( person . first ) } , null ) ; if ( c != null ) { final int TYPE = c . getColumnIndex ( ContactsContract . CommonDataKinds . Phone . TYPE ) ; String Number = "" ; while ( c . moveToNext ( ) ) { int type = c . getInt ( TYPE ) ; Log . d ( TAG + "numbers" , "Type = " + type ) ; if ( type == home ) { Number = c . getString ( c . getColumnIndex ( ContactsContract . Data . DATA1 ) ) ; } if ( type == mobile ) { Number = c . getString ( c . getColumnIndex ( ContactsContract . Data . DATA1 ) ) ; break ; } } if ( Number . equals ( "" ) ) { c . moveToFirst ( ) ; Number = c . getString ( c . getColumnIndex ( ContactsContract . Data . DATA1 ) ) ; } phonNums . add ( Number ) ; c . close ( ) ; } } Log . d ( TAG + "numbers" , "phonenumbers = " + phonNums . toString ( ) ) ; smsManager = SmsManager . getDefault ( ) ; for ( String num : phonNums ) { send ( num , message ) ; } }
addConversation creates a new sms or mms object to be sent
 @param people the numbers of the participants
addConversation creates a new sms or mms object to be sent @param people the numbers of the participants
//?