CoVer_App/app/src/main/java/com/example/cover_a01/bluetooth/BluetoothFragment.java
/**
     * to be called by a button (testing) and automatically on a timer / loading homescreen
     */
to be called by a button (testing) and automatically on a timer / loading homescreen
to be called by a button ( testing ) and automatically on a timer / loading homescreen
public void generateNewID(){
        if(preferences.getBoolean("trackingOn",true)) {
            button_generateNewID.setBackgroundColor(getResources().getColor(R.color.blue_NICE));
            button_generateNewID.setText("GENERATE RANDOM ID");
            String uid = getSystemID();
            startServiceBroadcast(uid);
            myIdView.setText(uid);
            coVerDatabase.secretKeyDao().insert(new SecretKey(uid));
        }else{
            button_generateNewID.setBackgroundColor(getResources().getColor(R.color.red_NICE));
            button_generateNewID.setText("tracking disabled");
        }
    }
public void generateNewID ( ) { if ( preferences . getBoolean ( "trackingOn" , true ) ) { button_generateNewID . setBackgroundColor ( getResources ( ) . getColor ( R . color . blue_NICE ) ) ; button_generateNewID . setText ( "GENERATE RANDOM ID" ) ; String uid = getSystemID ( ) ; startServiceBroadcast ( uid ) ; myIdView . setText ( uid ) ; coVerDatabase . secretKeyDao ( ) . insert ( new SecretKey ( uid ) ) ; } else { button_generateNewID . setBackgroundColor ( getResources ( ) . getColor ( R . color . red_NICE ) ) ; button_generateNewID . setText ( "tracking disabled" ) ; } }
to be called by a button (testing) and automatically on a timer / loading homescreen
to be called by a button ( testing ) and automatically on a timer / loading homescreen
//only generate a new key when tracking is enabled