Skip to content

Commit c778d45

Browse files
committed
Fixed error in getting server
1 parent 484bd92 commit c778d45

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "uk.samban.machinemonitoring"
77
minSdkVersion 24
88
targetSdkVersion 33
9-
versionCode 9
10-
versionName "7.0"
9+
versionCode 10
10+
versionName "7.1"
1111
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {

app/src/main/java/uk/co/digitme/machinemonitoring/Helpers/DbHelper.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,8 @@ public void saveServerAddress(String address){
8888

8989
@SuppressLint("Range")
9090
public URI getServerURI() throws URISyntaxException {
91-
SQLiteDatabase db = getReadableDatabase();
92-
String address;
9391
URI uri;
94-
95-
Cursor cursor = db.rawQuery("SELECT * FROM SETTINGS",null);
96-
if(cursor.moveToFirst()) {
97-
try {
98-
address = cursor.getString(cursor.getColumnIndex(COLUMN_SERVER_ADDRESS));
99-
cursor.close();
100-
} catch (CursorIndexOutOfBoundsException e) {
101-
Log.e(TAG, "Failed to get server address");
102-
address = "";
103-
}
104-
} else {
105-
Log.e(TAG, "Failed to get server address");
106-
address = "";
107-
}
92+
String address = this.getServerAddress();
10893

10994
uri = new URI(address);
11095
String scheme;

0 commit comments

Comments
 (0)