@@ -0,0 +1,2479 @@
+package de.akquinet.android.androlog.reporter;%0A%0Aimport java.util.Properties;%0A%0Aimport android.app.Activity;%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport de.akquinet.android.androlog.Log;%0A%0A/**%0A * Reporter sending the report by mail.%0A */%0Apublic class MailReporter implements Reporter %7B%0A%0A    /**%0A     * Mandatory Property to set the %3Ctt%3Eto%3C/tt%3E address..%0A     */%0A    public static final String ANDROLOG_REPORTER_MAIL_ADDRESS = %22androlog.reporter.mail.address%22;%0A%0A    /**%0A     * The address.%0A     */%0A    private String to;%0A%0A    /**%0A     * Configures the Mail Reporter. The given configuration %3Cb%3Emust%3C/b%3E contain%0A     * the %7B@link MailReporter#ANDROLOG_REPORTER_MAIL_ADDRESS%7D property and it%0A     * must be a valid email address.%0A     *%0A     * @see de.akquinet.android.androlog.reporter.Reporter#configure(java.util.Properties)%0A     */%0A    @Override%0A    public void configure(Properties configuration) %7B%0A        String u = configuration.getProperty(ANDROLOG_REPORTER_MAIL_ADDRESS);%0A        if (u == null) %7B%0A            Log.e(this, %22The Property %22 + ANDROLOG_REPORTER_MAIL_ADDRESS%0A                    + %22 is mandatory%22);%0A            return;%0A        %7D%0A        to = u;%0A    %7D%0A%0A    /**%0A     * If the reporter was configured correctly, post the report to the set%0A     * e-mail address. IF the mail cannot be sent (no mail client), the method%0A     * returns %3Ccode%3Efalse%3C/code%3E%0A     *%0A     * @see de.akquinet.android.androlog.reporter.Reporter#send(android.content.Context,%0A     *      java.lang.String, java.lang.Throwable)%0A     */%0A    @Override%0A    public boolean send(Context context, String mes, Throwable err) %7B%0A        if (to != null) %7B%0A            String report = new Report(context, mes, err).getReportAsJSON()%0A                    .toString();%0A            Intent intent = new Intent(Intent.ACTION_SEND);%0A            intent.putExtra(Intent.EXTRA_SUBJECT, %22Application Error Report%22);%0A            intent.putExtra(Intent.EXTRA_TEXT, report);%0A            intent.putExtra(Intent.EXTRA_EMAIL, new String%5B%5D %7B to %7D);%0A%0A            // Create a new task because we're not sure to be an Activity%0A            if (!(context instanceof Activity)) %7B%0A                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);%0A            %7D%0A%0A            try %7B%0A                context.startActivity(intent);%0A                return true;%0A            %7D catch (android.content.ActivityNotFoundException e) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%0A%7D%0A

Add a Mail Reporter