Android: Postmortem Reports via email

How can I get postmortem exception information from my deployed app without requiring net access?

One of the major breakthroughs I have had with my Android development has been the addition of a postmortem exception reporter into my apps. I started out my development on the emulator only as I did not have an Android phone of my own yet. I ran into the dilemma of having code that worked fine on the emulator, but crashed on some phones out in the field. Comments were pouring into my app with 1 star ratings and “FC on open”. I searched far and wide for a solution to use with postmortem crash analysis, but each one I researched required net access on the phone in order to report back. I was not going to force the requirement onto my fans because I don’t trust apps that should not need net access but do, so why should I force my fans to trust me? Continue reading

Android: Using Blackmoon File Browser’s MIME type provider

The function I use to translate a filename and given extension into it’s MIME type is available as a Provider in BmFB so that you can use my work for your app too.

    Uri theContentProvider = Uri.parse("content://com.blackmoonit.android.mimetypeprovider/getMIMEtype");
    Uri theContentTypeRequest = Uri.withAppendedPath(theContentProvider, aFile.getName());
    Cursor theTypeResult = managedQuery(theContentTypeRequest, null, null, null, null);
    theTypeResult.moveToFirst();
    if (!theTypeResult.isNull(0)) {
        String theMIMEType = theTypeResult.getString(0);
        ...
    }