Skip to content Skip to sidebar Skip to footer

Inserting Sent Mms Into Sent Box

I'm trying to insert a MMS into the sent database but alas I haven't been able to view it in the native android application. my insertion code: ContentValues values = new ContentVa

Solution 1:

I think what you need is in this class of the source code . Generally take a look at how they do it at google.. specifically take a look at this method

privatestatic Uri createDraftMmsMessage(PduPersister persister, SendReq sendReq,
        SlideshowModel slideshow) {
    try {
        PduBodypb= slideshow.toPduBody();
        sendReq.setBody(pb);
        Urires= persister.persist(sendReq, Mms.Draft.CONTENT_URI);
        slideshow.sync(pb);
        return res;
    } catch (MmsException e) {
        returnnull;
    }
}

And after creating the Draft (step one) then you update the draft to sent. by calling the other method

privatestaticvoidupdateDraftMmsMessage(Uri uri, PduPersister persister,
        SlideshowModel slideshow, SendReq sendReq) {
    if (Log.isLoggable(LogTag.APP, Log.VERBOSE)) {
        LogTag.debug("updateDraftMmsMessage uri=%s", uri);
    }
    if (uri == null) {
        Log.e(TAG, "updateDraftMmsMessage null uri");
        return;
    }
    persister.updateHeaders(uri, sendReq);
    finalPduBodypb= slideshow.toPduBody();

    try {
        persister.updateParts(uri, pb);
    } catch (MmsException e) {
        Log.e(TAG, "updateDraftMmsMessage: cannot update message " + uri);
    }

    slideshow.sync(pb);
}

Now I know you cannot run this code from your app since you're not building in the source, or even if you are it may be a challenge to do so (even though I think that if you do build in the source if you code correctly the google code should handle the save stuff)

in any case you should be able to save mms message in the provider by following what they do in this class.

cheers...

and post your progress...

Post a Comment for "Inserting Sent Mms Into Sent Box"