This repository was archived by the owner on Jan 22, 2024. It is now read-only.
File tree 17 files changed +33
-32
lines changed
src/main/java/org/example/kotlin
src/main/java/org/example/kotlin
gson-deserializers-okhttp-asynctask
src/main/java/org/example/kotlin/networking
httpurlconnection-asynctask
listview-baseadapter-data-object
app/src/main/java/org/example/kotlin/models
src/main/java/org/example/kotlin/networking
17 files changed +33
-32
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ android {
26
26
dependencies {
27
27
compile fileTree(dir : ' libs' , include : [' *.jar' ])
28
28
compile ' com.android.support:appcompat-v7:25.3.1'
29
- compile ' com.google.code.gson:gson:2.7 '
30
- compile ' com.squareup.okhttp :okhttp:2.3.0 '
29
+ compile ' com.google.code.gson:gson:2.8.1 '
30
+ compile ' com.squareup.okhttp3 :okhttp:3.8.1 '
31
31
// Kotlin
32
32
compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
33
33
// Anko
34
- compile " org.jetbrains.anko:anko-sdk15 :$anko_version "
34
+ compile " org.jetbrains.anko:anko:$anko_version "
35
35
compile " org.jetbrains.anko:anko-support-v4:$anko_version "
36
36
compile " org.jetbrains.anko:anko-appcompat-v7:$anko_version "
37
37
}
Original file line number Diff line number Diff line change @@ -8,9 +8,8 @@ import com.google.gson.GsonBuilder
8
8
import org.example.kotlin.deserializers.WeatherDeserializer
9
9
import org.example.kotlin.models.WeatherObject
10
10
import org.example.kotlin.networking.NetworkClient
11
-
12
-
13
11
import org.jetbrains.anko.*
12
+ import org.jetbrains.anko.sdk25.coroutines.onClick
14
13
import java.io.BufferedInputStream
15
14
import java.io.BufferedReader
16
15
import java.io.InputStreamReader
Original file line number Diff line number Diff line change 1
1
package org.example.kotlin.networking
2
2
3
- import com.squareup.okhttp .OkHttpClient
4
- import com.squareup.okhttp .Request
3
+ import okhttp3 .OkHttpClient
4
+ import okhttp3 .Request
5
5
import java.io.InputStream
6
6
7
7
/* *
@@ -15,7 +15,7 @@ open class NetworkClient {
15
15
val body = response.body()
16
16
// body.toString() returns a string representing the object and not the body itself, probably
17
17
// kotlins fault when using third party libraries. Use byteStream() and convert it to a String
18
- return body.byteStream()
18
+ return body!! .byteStream()
19
19
}
20
20
21
21
}
Original file line number Diff line number Diff line change 2
2
3
3
buildscript {
4
4
5
- ext. kotlin_version = ' 1.1.2'
6
- ext. anko_version = ' 0.9 .1'
5
+ ext. kotlin_version = ' 1.1.4- 2'
6
+ ext. anko_version = ' 0.10 .1'
7
7
8
8
repositories {
9
9
jcenter()
Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ android {
26
26
dependencies {
27
27
compile fileTree(dir : ' libs' , include : [' *.jar' ])
28
28
compile ' com.android.support:appcompat-v7:25.3.1'
29
- compile ' com.google.code.gson:gson:2.7 '
30
- compile ' com.squareup.okhttp :okhttp:2.3.0 '
29
+ compile ' com.google.code.gson:gson:2.8.1 '
30
+ compile ' com.squareup.okhttp3 :okhttp:3.8.1 '
31
31
// Kotlin
32
32
compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
33
33
// Anko
34
- compile " org.jetbrains.anko:anko-sdk15 :$anko_version "
34
+ compile " org.jetbrains.anko:anko:$anko_version "
35
35
compile " org.jetbrains.anko:anko-support-v4:$anko_version "
36
36
compile " org.jetbrains.anko:anko-appcompat-v7:$anko_version "
37
37
}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import org.example.kotlin.deserializers.WeatherDeserializer
11
11
import org.example.kotlin.models.WeatherObject
12
12
import org.example.kotlin.networking.NetworkClient
13
13
import org.jetbrains.anko.*
14
+ import org.jetbrains.anko.sdk25.coroutines.onClick
14
15
import java.io.BufferedInputStream
15
16
import java.io.BufferedReader
16
17
import java.io.InputStreamReader
Original file line number Diff line number Diff line change 1
1
package org.example.kotlin.networking
2
2
3
- import com.squareup.okhttp .OkHttpClient
4
- import com.squareup.okhttp .Request
3
+ import okhttp3 .OkHttpClient
4
+ import okhttp3 .Request
5
5
import java.io.InputStream
6
6
7
7
/* *
@@ -15,7 +15,7 @@ open class NetworkClient {
15
15
val body = response.body()
16
16
// body.toString() returns a string representing the object and not the body itself, probably
17
17
// kotlins fault when using third party libraries. Use byteStream() and convert it to a String
18
- return body.byteStream()
18
+ return body!! .byteStream()
19
19
}
20
20
21
21
}
Original file line number Diff line number Diff line change 2
2
3
3
buildscript {
4
4
5
- ext. kotlin_version = ' 1.1.2'
6
- ext. anko_version = ' 0.9 .1'
5
+ ext. kotlin_version = ' 1.1.4- 2'
6
+ ext. anko_version = ' 0.10 .1'
7
7
8
8
repositories {
9
9
jcenter()
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ android {
27
27
dependencies {
28
28
compile fileTree(dir : ' libs' , include : [' *.jar' ])
29
29
compile ' com.android.support:appcompat-v7:25.3.1'
30
- compile ' com.google.code.gson:gson:2.7 '
31
- compile ' com.squareup.okhttp :okhttp:2.3.0 '
30
+ compile ' com.google.code.gson:gson:2.8.1 '
31
+ compile ' com.squareup.okhttp3 :okhttp:3.8.1 '
32
32
compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
33
33
}
34
34
Original file line number Diff line number Diff line change 1
1
package org.example.kotlin.networking
2
2
3
- import com.squareup.okhttp.OkHttpClient
4
- import com.squareup.okhttp.Request
3
+
4
+ import okhttp3.OkHttpClient
5
+ import okhttp3.Request
5
6
import java.io.InputStream
6
7
7
8
/* *
@@ -15,7 +16,7 @@ open class NetworkClient {
15
16
val body = response.body()
16
17
// body.toString() returns a string representing the object and not the body itself, probably
17
18
// kotlins fault when using third party libraries. Use byteStream() and convert it to a String
18
- return body.byteStream()
19
+ return body!! .byteStream()
19
20
}
20
21
21
22
}
Original file line number Diff line number Diff line change 2
2
3
3
buildscript {
4
4
5
- ext. kotlin_version = ' 1.1.2'
5
+ ext. kotlin_version = ' 1.1.4- 2'
6
6
7
7
repositories {
8
8
jcenter()
Original file line number Diff line number Diff line change 2
2
3
3
buildscript {
4
4
5
- ext. kotlin_version = ' 1.1.2'
5
+ ext. kotlin_version = ' 1.1.4- 2'
6
6
7
7
repositories {
8
8
jcenter()
Original file line number Diff line number Diff line change @@ -10,5 +10,4 @@ open class CustomPojo (var name: String) {
10
10
println (" Customer initialized with value ${name} " )
11
11
}
12
12
13
- override fun toString () = " $name "
14
13
}
Original file line number Diff line number Diff line change 2
2
3
3
buildscript {
4
4
5
- ext. kotlin_version = ' 1.1.2'
5
+ ext. kotlin_version = ' 1.1.4- 2'
6
6
7
7
repositories {
8
8
jcenter()
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ android {
27
27
dependencies {
28
28
compile fileTree(dir : ' libs' , include : [' *.jar' ])
29
29
compile ' com.android.support:appcompat-v7:25.3.1'
30
- compile ' com.squareup.okhttp :okhttp:2.3.0 '
30
+ compile ' com.squareup.okhttp3 :okhttp:3.8.1 '
31
31
compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
32
32
}
33
33
Original file line number Diff line number Diff line change 1
1
package org.example.kotlin.networking
2
2
3
- import com.squareup.okhttp.OkHttpClient
4
- import com.squareup.okhttp.Request
3
+
4
+ import okhttp3.OkHttpClient
5
+ import okhttp3.Request
5
6
import java.io.InputStream
6
7
7
8
/* *
@@ -15,7 +16,7 @@ open class NetworkClient {
15
16
val body = response.body()
16
17
// body.toString() returns a string representing the object and not the body itself, probably
17
18
// kotlins fault when using third party libraries. Use byteStream() and convert it to a String
18
- return body.byteStream()
19
+ return body!! .byteStream()
19
20
}
20
21
21
22
}
Original file line number Diff line number Diff line change 2
2
3
3
buildscript {
4
4
5
- ext. kotlin_version = ' 1.1.2'
5
+ ext. kotlin_version = ' 1.1.4- 2'
6
6
7
7
repositories {
8
8
jcenter()
You can’t perform that action at this time.
0 commit comments