diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothBeurerBF700_800.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothBeurerBF700_800.java index d718274a..1b86e6e1 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothBeurerBF700_800.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothBeurerBF700_800.java @@ -128,11 +128,12 @@ public class BluetoothBeurerBF700_800 extends BluetoothCommunication { @Override public boolean checkDeviceName(String btDeviceName) { - if (btDeviceName.toLowerCase().startsWith(new String("BEURER BF700").toLowerCase()) || - btDeviceName.toLowerCase().startsWith(new String("BEURER BF800").toLowerCase())|| - btDeviceName.toLowerCase().startsWith(new String("BF-800").toLowerCase())|| - btDeviceName.toLowerCase().startsWith(new String("BF-700").toLowerCase())|| - btDeviceName.toLowerCase().startsWith(new String("RT-Libra-B").toLowerCase())) { + String name = btDeviceName.toLowerCase(); + if (name.startsWith("BEURER BF700".toLowerCase()) + || name.startsWith("BEURER BF800".toLowerCase()) + || name.startsWith("BF-800".toLowerCase()) + || name.startsWith("BF-700".toLowerCase()) + || name.startsWith("RT-Libra-B".toLowerCase())) { return true; } diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java index ce08f44c..95d81fdc 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java @@ -382,7 +382,7 @@ public abstract class BluetoothCommunication { protected String byteInHex(byte[] data) { if (data == null) { Log.e("BluetoothCommunication", "Data is null"); - return new String(); + return ""; } final StringBuilder stringBuilder = new StringBuilder(data.length); diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothSanitasSbf70.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothSanitasSbf70.java index fd06df16..ca365abb 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothSanitasSbf70.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothSanitasSbf70.java @@ -126,7 +126,8 @@ public class BluetoothSanitasSbf70 extends BluetoothCommunication { @Override public boolean checkDeviceName(String btDeviceName) { // SilverCrest SBF75 (also known as HealthForYou by SilverCrest) - if (btDeviceName.toLowerCase().startsWith(new String("SANITAS SBF70").toLowerCase()) || btDeviceName.toLowerCase().startsWith("sbf75")) { + String name = btDeviceName.toLowerCase(); + if (name.startsWith("SANITAS SBF70".toLowerCase()) || name.startsWith("sbf75")) { return true; } diff --git a/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleMeasurement.java b/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleMeasurement.java index 07154319..e6d88989 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleMeasurement.java +++ b/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleMeasurement.java @@ -89,7 +89,7 @@ public class ScaleMeasurement implements Cloneable { bone = 0.0f; waist = 0.0f; hip = 0.0f; - comment = new String(); + comment = ""; } @Override diff --git a/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleUser.java b/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleUser.java index b5d28f8b..fcb5e291 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleUser.java +++ b/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleUser.java @@ -52,7 +52,7 @@ public class ScaleUser { private Date goalDate; public ScaleUser() { - userName = new String(); + userName = ""; birthday = new Date(); bodyHeight = -1; scaleUnit = Converters.WeightUnit.KG;