So what you can do to get pictures is go I get the MMS's id and go through ("content://mms/part")
do a type check:
String type = cursor.getString(cursor.getColumnIndex("ct"));
String partId = cursor.getString(cursor.getColumnIndex("_id"));
//is type a picture
if ("image/jpeg".equals(type) || "image/bmp".equals(type)
|| "image/gif".equals(type) || "image/jpg".equals(type)
|| "image/png".equals(type)) {
getMmsImage(partId); // load in your picture
}
Now you that you have the part ID you know the picture's location so you can load it in using anything you want for example if you just want it as a bitmap you can do:
public Bitmap getMmsImage(String _id, Context context) {
Uri partURI = Uri.parse("content://mms/part/" + _id);
InputStream is = null;
Bitmap bitmap = null;
try {
is = context.getContentResolver().openInputStream(partURI);
bitmap = BitmapFactory.decodeStream(is);
} catch (Exception e) {// probably should do an ioException around here}
finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {}
}
}
return bitmap;
}
Now I would like to point out that if you wanted animated gifs this would not work, it would load the gifs but they would be still images. if you want them animated you could use something like Glide and give it the path location for the uri. Glide takes a while to load gifs though, just fair warning.
As for Receiving MMS, you could always use an Observer and load in the added message whenever the observer say there was a change... Or use a broadcast receiver if you want it to be the default messenger.