I have do an android application, and now, this application needs to read emails. I found this code:
      protected ArrayList<Mail> doInBackground(Void... params) {
    ArrayList<Mail> mails = new ArrayList<Mail>(32);
        boolean finish = false;
        try {
            String direcCompleta = URI_PREFIX + email;
            Uri a = Uri.parse(direcCompleta);
            Cursor  cCursor = resolver.query(a, null, null , null, null);
            while (cCursor.moveToNext() && (! finish)) {
                finish = fromTime.before(new Date(cCursor.getLong(1)));
                if (! finish){
                    String conv_id  = cCursor.getString(cCursor.getColumnIndex("_id"));
                    Uri    uri      = Uri.parse(URI_PREFIX + email + "/" + conv_id + "/messages");
                    Cursor mCursor  = resolver.query(uri, MESSAGE_PROJECTION, null, null, null);                    
                    while (mCursor.moveToNext() &&  (! finish)){
                        long mtime = mCursor.getLong(4);
                        finish = fromTime.before(new Date(mtime));
                        if (! finish){
                            mails.add(new Mail(mCursor.getString(0), mCursor.getString(2), mCursor.getString(1), mCursor.getString(4), mtime));                             
                        }
                    }                       
                }               
            }
        } catch (Exception ex){  
            Log.e("GmailReadApp", ex.toString());
            mails.add(new Mail(null, null, ex.toString(), ex.toString(), 0));
        }
        return mails;
    }
But cCursor is null. I have my mail account in app: "Email", because i work with android sdk, and it doesn´t have app: "GMAIL". And android sdk doesn´t have market.
Somebody can help me please? thanks. (no matter if it's for gmail, yahoo, hotmail,....)
 
     
    