Example usage for android.os Build UNKNOWN

List of usage examples for android.os Build UNKNOWN

Introduction

In this page you can find the example usage for android.os Build UNKNOWN.

Prototype

String UNKNOWN

To view the source code for android.os Build UNKNOWN.

Click Source Link

Document

Value used for when a build property is unknown.

Usage

From source file:Main.java

public static boolean check(String rom) {
    if (sName != null) {
        return sName.equals(rom);
    }//from   ww w.  j  a va  2  s .co m

    if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_MIUI))) {
        sName = ROM_MIUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_EMUI))) {
        sName = ROM_EMUI;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_OPPO))) {
        sName = ROM_OPPO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_VIVO))) {
        sName = ROM_VIVO;
    } else if (!TextUtils.isEmpty(sVersion = getProp(KEY_VERSION_SMARTISAN))) {
        sName = ROM_SMARTISAN;
    } else {
        sVersion = Build.DISPLAY;
        if (sVersion.toUpperCase().contains(ROM_FLYME)) {
            sName = ROM_FLYME;
        } else {
            sVersion = Build.UNKNOWN;
            sName = Build.MANUFACTURER.toUpperCase();
        }
    }
    return sName.equals(rom);
}

From source file:com.bilibili.magicasakura.utils.ThemeUtils.java

public static boolean isSkipAnimatedSelector() {
    if (!hasRecordedVersion) {
        final String sdkVersion = Build.VERSION.RELEASE;
        isSkipAnimatedSelector = !Build.UNKNOWN.equals(sdkVersion) && "5.0".compareTo(sdkVersion) <= 0
                && "5.1".compareTo(sdkVersion) > 0;
        hasRecordedVersion = true;/*from w  ww  . java  2s.com*/
    }
    return isSkipAnimatedSelector;
}

From source file:com.flowzr.export.flowzr.FlowzrSyncEngine.java

public static String create(Context p_context, DatabaseAdapter p_dba, DefaultHttpClient p_http) {
    startTimestamp = System.currentTimeMillis();

    if (isRunning == true) {
        isCanceled = true;//from www.  j av a  2 s .co  m
        isRunning = false;
    }
    isRunning = true;
    boolean recordSyncTime = true;

    dba = p_dba;
    db = dba.db();
    em = dba.em();
    http_client = p_http;
    context = p_context;

    last_sync_ts = MyPreferences.getFlowzrLastSync(context);
    FLOWZR_BASE_URL = "https://" + MyPreferences.getSyncApiUrl(context);
    FLOWZR_API_URL = FLOWZR_BASE_URL + "/financisto3/";

    nsString = MyPreferences.getFlowzrAccount(context).replace("@", "_"); //urlsafe

    Log.i(TAG, "init sync engine, last sync was " + new Date(last_sync_ts).toLocaleString());
    //if (true) {
    if (!checkSubscriptionFromWeb()) {
        Intent notificationIntent = new Intent(context, FlowzrSyncActivity.class);
        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);

        NotificationManager notificationManager = (NotificationManager) context
                .getSystemService(Context.NOTIFICATION_SERVICE);
        Notification notification = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.icon)
                .setTicker(context.getString(R.string.flowzr_subscription_required))
                .setContentTitle(context.getString(R.string.flowzr_sync_error))
                .setContentText(context.getString(R.string.flowzr_subscription_required,
                        MyPreferences.getFlowzrAccount(context)))
                .setContentIntent(pendingIntent).setAutoCancel(true).build();
        notificationManager.notify(0, notification);

        Log.w("flowzr", "subscription rejected from web");
        isCanceled = true;
        MyPreferences.unsetAutoSync(context);
        return null;
    } else {
        mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
        // Sets an ID for the notification, so it can be updated

        mNotifyBuilder = new NotificationCompat.Builder(context).setAutoCancel(true)
                .setContentTitle(context.getString(R.string.flowzr_sync))
                .setContentText(context.getString(R.string.flowzr_sync_inprogress))
                .setSmallIcon(R.drawable.icon);
    }

    if (!isCanceled) {
        notifyUser("fix created entities", 5);
        fixCreatedEntities();
    }
    /**
     * pull delete
     */
    if (!isCanceled) {
        notifyUser(context.getString(R.string.flowzr_sync_receiving) + " ...", 10);
        try {
            pullDelete(last_sync_ts);
        } catch (Exception e) {
            sendBackTrace(e);
            recordSyncTime = false;
        }
    }
    /**
     * push delete
     */
    if (!isCanceled) {
        notifyUser(context.getString(R.string.flowzr_sync_sending) + " ...", 15);
        try {
            pushDelete();
        } catch (Exception e) {
            sendBackTrace(e);
            recordSyncTime = false;
        }
    }
    /**
     * pull update
     */
    if (!isCanceled && last_sync_ts == 0) {
        notifyUser(context.getString(R.string.flowzr_sync_receiving) + " ...", 20);
        try {
            pullUpdate();
        } catch (IOException e) {
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (JSONException e) {
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (Exception e) {
            sendBackTrace(e);
            recordSyncTime = false;
        }
    }
    /**
     * push update
     */
    if (!isCanceled) {
        notifyUser(context.getString(R.string.flowzr_sync_sending) + " ...", 35);
        try {
            pushUpdate();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (IOException e) {
            e.printStackTrace();
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (JSONException e) {
            e.printStackTrace();
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (Exception e) {
            e.printStackTrace();
            recordSyncTime = false;
        }
    }
    /**
     * pull update
     */
    if (!isCanceled && last_sync_ts > 0) {
        notifyUser(context.getString(R.string.flowzr_sync_receiving) + " ...", 20);
        try {
            pullUpdate();
        } catch (IOException e) {
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (JSONException e) {
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (Exception e) {
            sendBackTrace(e);
            recordSyncTime = false;
        }
    }

    notifyUser(context.getString(R.string.integrity_fix), 80);
    new IntegrityFix(dba).fix();
    /**
     * send account balances boundaries
     */
    if (!isCanceled) {
        //if (true) { //will generate a Cloud Messaging request if prev. aborted        
        notifyUser(context.getString(R.string.flowzr_sync_sending) + "...", 85);
        //nm.notify(NOTIFICATION_ID, mNotifyBuilder.build()); 
        ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
        nameValuePairs.add(new BasicNameValuePair("action", "balancesRecalc"));
        nameValuePairs.add(new BasicNameValuePair("last_sync_ts", String.valueOf(last_sync_ts)));

        String serialNumber = Build.SERIAL != Build.UNKNOWN ? Build.SERIAL
                : Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
        nameValuePairs.add(new BasicNameValuePair("serialNumber", serialNumber));
        List<Account> accountsList = em.getAllAccountsList();
        for (Account account : accountsList) {
            nameValuePairs.add(new BasicNameValuePair(account.remoteKey, String.valueOf(account.totalAmount)));
            Log.i("flowzr", account.remoteKey + " " + String.valueOf(account.totalAmount));
        }
        try {
            httpPush(nameValuePairs, "balances");
        } catch (Exception e) {
            sendBackTrace(e);
        }
    }

    notifyUser("Widgets ...", 90);
    AccountWidget.updateWidgets(context);

    Handler refresh = new Handler(Looper.getMainLooper());
    refresh.post(new Runnable() {
        public void run() {
            if (currentActivity != null) {
                //currentActivity.refreshCurrentTab();
            }
        }
    });

    if (!isCanceled && MyPreferences.doGoogleDriveUpload(context)) {
        notifyUser(context.getString(R.string.flowzr_sync_sending) + " Google Drive", 95);
        pushAllBlobs();
    } else {
        Log.i("flowzr", "picture upload desactivated in prefs");
    }
    notifyUser(context.getString(R.string.flowzr_sync_success), 100);
    if (isCanceled == false) {
        if (recordSyncTime == true) {
            last_sync_ts = System.currentTimeMillis();
            SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
            editor.putLong("PROPERTY_LAST_SYNC_TIMESTAMP", last_sync_ts);
            editor.commit();
        }
    }
    //
    mNotificationManager.cancel(NOTIFICATION_ID);
    isRunning = false;
    isCanceled = false;
    if (context instanceof FlowzrSyncActivity) {
        ((FlowzrSyncActivity) context).setIsFinished();
    }
    return FLOWZR_BASE_URL;

}

From source file:com.flowzr.budget.holo.export.flowzr.FlowzrSyncEngine.java

public static String create(Context p_context, DatabaseAdapter p_dba, DefaultHttpClient p_http) {
    startTimestamp = System.currentTimeMillis();

    if (isRunning == true) {
        isCanceled = true;/*from w w  w .  j a v a2 s  .c o m*/
        isRunning = false;
    }
    isRunning = true;
    boolean recordSyncTime = true;

    dba = p_dba;
    db = dba.db();
    em = dba.em();
    http_client = p_http;
    context = p_context;

    last_sync_ts = MyPreferences.getFlowzrLastSync(context);
    FLOWZR_BASE_URL = "https://" + MyPreferences.getSyncApiUrl(context);
    FLOWZR_API_URL = FLOWZR_BASE_URL + "/financisto3/";

    nsString = MyPreferences.getFlowzrAccount(context).replace("@", "_"); //urlsafe

    Log.i(TAG, "init sync engine, last sync was " + new Date(last_sync_ts).toLocaleString());
    //if (true) {
    if (!checkSubscriptionFromWeb()) {
        Intent notificationIntent = new Intent(context, FlowzrSyncActivity.class);
        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);

        NotificationManager notificationManager = (NotificationManager) context
                .getSystemService(Context.NOTIFICATION_SERVICE);
        Notification notification = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.icon)
                .setTicker(context.getString(R.string.flowzr_subscription_required))
                .setContentTitle(context.getString(R.string.flowzr_sync_error))
                .setContentText(context.getString(R.string.flowzr_subscription_required,
                        MyPreferences.getFlowzrAccount(context)))
                .setContentIntent(pendingIntent).setAutoCancel(true).build();
        notificationManager.notify(0, notification);

        Log.w("flowzr", "subscription rejected from web");
        isCanceled = true;
        MyPreferences.unsetAutoSync(context);
        return null;
    } else {
        mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
        // Sets an ID for the notification, so it can be updated

        mNotifyBuilder = new NotificationCompat.Builder(context).setAutoCancel(true)
                .setContentTitle(context.getString(R.string.flowzr_sync))
                .setContentText(context.getString(R.string.flowzr_sync_inprogress))
                .setSmallIcon(R.drawable.icon);
    }

    if (!isCanceled) {
        notifyUser("fix created entities", 5);
        fixCreatedEntities();
    }
    /**
     * pull delete
     */
    if (!isCanceled) {
        notifyUser(context.getString(R.string.flowzr_sync_receiving) + " ...", 10);
        try {
            pullDelete(last_sync_ts);
        } catch (Exception e) {
            sendBackTrace(e);
            recordSyncTime = false;
        }
    }
    /**
     * push delete
     */
    if (!isCanceled) {
        notifyUser(context.getString(R.string.flowzr_sync_sending) + " ...", 15);
        try {
            pushDelete();
        } catch (Exception e) {
            sendBackTrace(e);
            recordSyncTime = false;
        }
    }
    /**
     * pull update
     */
    if (!isCanceled && last_sync_ts == 0) {
        notifyUser(context.getString(R.string.flowzr_sync_receiving) + " ...", 20);
        try {
            pullUpdate();
        } catch (IOException e) {
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (JSONException e) {
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (Exception e) {
            sendBackTrace(e);
            recordSyncTime = false;
        }
    }
    /**
     * push update
     */
    if (!isCanceled) {
        notifyUser(context.getString(R.string.flowzr_sync_sending) + " ...", 35);
        try {
            pushUpdate();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (IOException e) {
            e.printStackTrace();
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (JSONException e) {
            e.printStackTrace();
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (Exception e) {
            e.printStackTrace();
            recordSyncTime = false;
        }
    }
    /**
     * pull update
     */
    if (!isCanceled && last_sync_ts > 0) {
        notifyUser(context.getString(R.string.flowzr_sync_receiving) + " ...", 20);
        try {
            pullUpdate();
        } catch (IOException e) {
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (JSONException e) {
            sendBackTrace(e);
            recordSyncTime = false;
        } catch (Exception e) {
            sendBackTrace(e);
            recordSyncTime = false;
        }
    }

    notifyUser(context.getString(R.string.integrity_fix), 80);
    new IntegrityFix(dba).fix();
    /**
     * send account balances boundaries
     */
    if (!isCanceled) {
        //if (true) { //will generate a Cloud Messaging request if prev. aborted
        notifyUser(context.getString(R.string.flowzr_sync_sending) + "...", 85);
        //nm.notify(NOTIFICATION_ID, mNotifyBuilder.build());
        ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
        nameValuePairs.add(new BasicNameValuePair("action", "balancesRecalc"));
        nameValuePairs.add(new BasicNameValuePair("last_sync_ts", String.valueOf(last_sync_ts)));

        String serialNumber = Build.SERIAL != Build.UNKNOWN ? Build.SERIAL
                : Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
        nameValuePairs.add(new BasicNameValuePair("serialNumber", serialNumber));
        List<Account> accountsList = em.getAllAccountsList();
        for (Account account : accountsList) {
            nameValuePairs.add(new BasicNameValuePair(account.remoteKey, String.valueOf(account.totalAmount)));
            Log.i("flowzr", account.remoteKey + " " + String.valueOf(account.totalAmount));
        }
        try {
            httpPush(nameValuePairs, "balances");
        } catch (Exception e) {
            sendBackTrace(e);
        }
    }

    notifyUser("Widgets ...", 90);
    AccountWidget.updateWidgets(context);

    Handler refresh = new Handler(Looper.getMainLooper());
    refresh.post(new Runnable() {
        public void run() {
            if (currentActivity != null) {
                //currentActivity.refreshCurrentTab();
            }
        }
    });

    if (!isCanceled && MyPreferences.doGoogleDriveUpload(context)) {
        notifyUser(context.getString(R.string.flowzr_sync_sending) + " Google Drive", 95);
        pushAllBlobs();
    } else {
        Log.i("flowzr", "picture upload desactivated in prefs");
    }
    notifyUser(context.getString(R.string.flowzr_sync_success), 100);
    if (isCanceled == false) {
        if (recordSyncTime == true) {
            last_sync_ts = System.currentTimeMillis();
            SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
            editor.putLong("PROPERTY_LAST_SYNC_TIMESTAMP", last_sync_ts);
            editor.commit();
        }
    }
    //
    mNotificationManager.cancel(NOTIFICATION_ID);
    isRunning = false;
    isCanceled = false;
    if (context instanceof FlowzrSyncActivity) {
        ((FlowzrSyncActivity) context).setIsFinished();
    }
    return FLOWZR_BASE_URL;

}

From source file:org.brandroid.openmanager.fragments.DialogHandler.java

public static String getDeviceInfo() {
    String ret = "";
    String sep = "\n";
    ret += sep + "Build Info:" + sep;
    ret += "SDK: " + Build.VERSION.SDK_INT + sep;
    if (OpenExplorer.SCREEN_WIDTH > -1)
        ret += "Screen: " + OpenExplorer.SCREEN_WIDTH + "x" + OpenExplorer.SCREEN_HEIGHT + sep;
    if (OpenExplorer.SCREEN_DPI > -1)
        ret += "DPI: " + OpenExplorer.SCREEN_DPI + sep;
    ret += "Lang: " + getLangCode() + sep;
    ret += "Fingerprint: " + Build.FINGERPRINT + sep;
    ret += "Manufacturer: " + Build.MANUFACTURER + sep;
    ret += "Model: " + Build.MODEL + sep;
    ret += "Product: " + Build.PRODUCT + sep;
    ret += "Brand: " + Build.BRAND + sep;
    ret += "Board: " + Build.BOARD + sep;
    ret += "Bootloader: " + Build.BOOTLOADER + sep;
    ret += "Hardware: " + Build.HARDWARE + sep;
    ret += "Display: " + Build.DISPLAY + sep;
    ret += "Language: " + Locale.getDefault().getDisplayLanguage() + sep;
    ret += "Country: " + Locale.getDefault().getDisplayCountry() + sep;
    ret += "Tags: " + Build.TAGS + sep;
    ret += "Type: " + Build.TYPE + sep;
    ret += "User: " + Build.USER + sep;
    if (Build.UNKNOWN != null)
        ret += "Unknown: " + Build.UNKNOWN + sep;
    ret += "ID: " + Build.ID;
    return ret;//from   w  w  w.j ava2 s.  c  om
}

From source file:com.droid.app.fotobot.FotoBot.java

/**
 *   ?  ? ? //from  w  ww .  ja va2  s  .c  o m
 *
 * @param h
 * @param str
 */
public void SendMail(Handler h, String str, String fc_str, String bc_video, String fc_video) {

    //        final FotoBot fb = (FotoBot) getApplicationContext();

    Mail m = new Mail(getApplicationContext(), EMail_Sender, EMail_Sender_Password, SMTP_Host, SMTP_Port);

    String[] toArr = { EMail_Recepient };

    String s = "Debug-infos:";
    s += "\n OS Version: " + System.getProperty("os.version") + "(" + android.os.Build.VERSION.INCREMENTAL
            + ")";
    s += "\n OS API Level: " + android.os.Build.VERSION.SDK_INT;
    s += "\n Device: " + android.os.Build.DEVICE;
    s += "\n Model (and Product): " + android.os.Build.MODEL + " (" + android.os.Build.PRODUCT + ")";

    s += "\n RELEASE: " + android.os.Build.VERSION.RELEASE;
    s += "\n BRAND: " + android.os.Build.BRAND;
    s += "\n DISPLAY: " + android.os.Build.DISPLAY;
    s += "\n CPU_ABI: " + android.os.Build.CPU_ABI;
    s += "\n CPU_ABI2: " + android.os.Build.CPU_ABI2;
    s += "\n UNKNOWN: " + android.os.Build.UNKNOWN;
    s += "\n HARDWARE: " + android.os.Build.HARDWARE;
    s += "\n Build ID: " + android.os.Build.ID;
    s += "\n MANUFACTURER: " + android.os.Build.MANUFACTURER;
    s += "\n SERIAL: " + android.os.Build.SERIAL;
    s += "\n USER: " + android.os.Build.USER;
    s += "\n HOST: " + android.os.Build.HOST;

    m.setTo(toArr);
    m.setFrom(EMail_Sender);
    m.setSubject("Fotobot v" + versionName + " " + Camera_Name);

    String email_body = "";

    email_body = "Fotobot v" + versionName + "\n" + "---------------------------------------------\n"
            + "Camera Name" + ": " + Camera_Name + "\n" + getResources().getString(R.string.battery_charge)
            + ": " + battery_level + "%" + "\n" + getResources().getString(R.string.battery_temperature) + ": "
            + battery_temperature + "C" + "\n";

    if (Attached_Info_Detailisation.equals("Normal") || Attached_Info_Detailisation.equals("Detailed")) {

        email_body = email_body + getResources().getString(R.string.gsm) + ": " + GSM_Signal + "ASU    "
                + (2.0 * GSM_Signal - 113) + "dBm" + "\n" + "-50 -82 dbm   -   very good" + "\n"
                + "-83 -86 dbm   -   good" + "\n" + "-87 -91 dbm   -   normal" + "\n" + "-92 -95 dbm   -   bad"
                + "\n" + "-96 -100 dbm   -  almost no signal" + "\n"
                + "---------------------------------------------\n" + "Image Index:" + Image_Index + "\n"
                + "---------------------------------------------\n"
                + getResources().getString(R.string.phone_memory) + ":" + "\n" + "totalMemory: " + totalMemory
                + "\n" + "usedMemory: " + usedMemory + "\n" + "freeMemory: " + freeMemory + "\n"
                + "---------------------------------------------\n"
                + getResources().getString(R.string.email_sending_time) + ": " + email_sending_time + "\n"
                + "---------------------------------------------\n"
                + getResources().getString(R.string.Fotobot_settings) + ":\n" + "Network_Channel: "
                + Network_Channel + "\n" + "Network_Connection_Method: " + Network_Connection_Method + "\n"
                + "Use_Flash: " + Use_Flash + "\n" + "JPEG_Compression: " + JPEG_Compression + "\n"
                + "Photo_Frequency: " + Photo_Frequency + "\n" + "process_delay: " + process_delay + "\n"
                + "Image_Scale: " + Image_Scale + "\n" + "Image_Size: " + Image_Size + "\n" + "EMail_Sender: "
                + EMail_Sender + "\n" + "EMail_Sender_Password: *********" + "\n" + "EMail_Recepient: "
                + EMail_Recepient + "\n" + "Log_Font_Size: " + Log_Font_Size + "\n" + "Config_Font_Size: "
                + Config_Font_Size + "\n" + "Photo_Post_Processing_Method: " + Photo_Post_Processing_Method
                + "\n" + "SMTP_Host: " + SMTP_Host + "\n" + "SMTP_Port: " + SMTP_Port + "\n" + "Log length: "
                + loglength + "\n" + "FLog length: " + floglength + "\n" + "wake_up_interval: "
                + wake_up_interval + "\n" + "---------------------------------------------\n"
                + getResources().getString(R.string.hardware_info) + ":\n" + "Android: " + Build.VERSION.SDK_INT
                + "\n" + s + "\n" + "---------------------------------------------\n"
                + "Available SMS commands: " + "\n" + sms_commands_list() + "\n";
        ;
        if (Attached_Info_Detailisation.equals("Detailed")) {
            email_body = email_body + "\n\n\nActive tasks:\n" + Top + "\n\n\nBack Camera Properties:\n"
                    + Camera_Properties + "\n\n\nFront Camera Properties:\n" + fc_Camera_Properties;
        }

    }

    m.setBody(email_body);

    File attach_file;

    if (make_photo_bc && bc_image_attach) {

        attach_file = new File(str);
        boolean fileExists = attach_file.isFile();

        if (fileExists) {

        } else {
            SendMessage("ERROR: image doesn't exist for attaching to email.", MSG_FAIL);
        }
    }

    if (make_video_bc && bc_video_attach) {

        attach_file = new File(bc_video);
        boolean fileExists = attach_file.isFile();

        if (fileExists) {

        } else {
            SendMessage("ERROR: video " + bc_video + " doesn't exist for attaching to email.", MSG_FAIL);
        }
    }

    if (front_camera && make_photo_fc && fc_image_attach) {

        attach_file = new File(fc_str);
        boolean fc_fileExists = attach_file.isFile();

        if (front_camera && fc_fileExists && make_photo_fc) {

        } else {
            SendMessage("ERROR: front camera image doesn't exist for attaching to email.", MSG_FAIL);
        }
    }

    if (front_camera && make_video_fc && fc_video_attach) {

        attach_file = new File(fc_video);
        boolean fc_fileExists = attach_file.isFile();

        if (front_camera && fc_fileExists && make_photo_fc) {

        } else {
            SendMessage("ERROR: video " + fc_video + " doesn't exist for attaching to email.", MSG_FAIL);
        }
    }

    if (attach_log) {
        attach_file = new File((work_dir + "/logfile.txt"));
        boolean fileExists = attach_file.isFile();

        if (fileExists) {

        } else {
            SendMessage("ERROR: log doesn't exist for attaching to email.", MSG_FAIL);
        }

    }
    try {

        if (make_photo_bc && bc_image_attach) {
            m.addAttachment(str);
        }

        if (front_camera && make_photo_fc && fc_image_attach) {
            m.addAttachment(fc_str);
        }

        if (make_video_bc && bc_image_attach) {
            m.addAttachment(bc_video);
        }

        if (front_camera && make_video_fc && fc_image_attach) {
            m.addAttachment(fc_video);
        }

        if (attach_log) {
            m.addAttachment(work_dir + "/logfile.txt");
        }
        fbpause(h, process_delay);

        if (m.send()) {

            SendMessage(getResources().getString(R.string.foto_sent), MSG_PASS);

            SaveSettings();

        } else {
            SendMessage("ERROR: ?   ", MSG_FAIL);
        }
    } catch (Exception e) {
        SendMessage("Could not send email", MSG_FAIL);
        Log.e("MailApp", "Could not send email", e);
    }

}