Merge branch '72-bug-new-retrofit-verion' into 'master'

Resolve "Bug: New retrofit verion"

Closes #72

See merge request marcel.schwarz/2020ss-qbc-geofence-timetracking!54
This commit is contained in:
Tobias Wieck 2020-05-18 09:18:25 +00:00
commit 4c34ac3497
4 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -26,6 +26,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
@ -47,6 +51,6 @@ dependencies {
implementation "android.arch.navigation:navigation-fragment-ktx:2.2.2"
implementation "android.arch.navigation:navigation-ui-ktx:2.2.2"
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
}

View File

@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.hft.geotracker">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

View File

@ -6,6 +6,7 @@ import androidx.fragment.app.Fragment
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import okhttp3.HttpUrl
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
@ -27,8 +28,8 @@ class Login : AppCompatActivity() {
val retrofit = Retrofit.Builder()
.baseUrl("http://plesk.icaotix.de:5000")
.addConverterFactory(GsonConverterFactory.create())
.build()
.addConverterFactory(GsonConverterFactory.create())
.build()
service = retrofit.create(GeofenceService::class.java)
login = findViewById(R.id.button_create_account)
@ -58,7 +59,7 @@ class Login : AppCompatActivity() {
var headers = response.headers()
var authentication = headers.get("Authorization")
token = JWToken(authentication)
token = JWToken(authentication!!)
println(response.code())
println(token.token)