All Questions
1,225
questions
0
votes
1
answer
39
views
I am not sure how to optimize retrofit with callback in kotlin, or how to remove the callback after its done
I am using callbacks in Kotlin, and I currently have the exact retrofit function returning result in the form of a callback as its used multiple times across different classes,the endpoints are ...
-1
votes
1
answer
75
views
Cannot access class 'retrofit2.Response'. Check your module classpath for missing or conflicting dependencies
I started a project with a few modules and i have problems when i build the app.
Cannot access class 'retrofit2.Response'. Check your module classpath for missing or conflicting dependencies
I also ...
0
votes
1
answer
46
views
Unable to create call adapter for class Retrofit2
When I run the app it doesn't crash but it always goes on the .onFailure block in the repo's method (posted below) and the message is the following:
Unable to create call adapter for class independent....
0
votes
0
answers
49
views
How to write a ByteArray to an Excel file and saving it in external storage?
I want to write ByteArray data which is coming from Retrofit API (ResponseBody as return type from API) into Excel file and store into external memory of android SD Card.
try {
var path = mContext?...
0
votes
1
answer
39
views
Retrofit logs are not showing, Android Studio
I'm starting to learn Android(kotlin, mvvm, coroutine). I'm trying to call(GET) this api which is provided from The Movie DB.
http:// api.themoviedb.org/3/discover/movie?sort_by=popularity.desc&...
1
vote
3
answers
146
views
403 Error When Making HTTP Request with Retrofit in Kotlin
I’m working on an Android project where I need to send an HTTP request to a search endpoint using the Retrofit library in Kotlin. The request works fine when I enter the URL directly into my browser, ...
0
votes
0
answers
24
views
I can't connect to the server using retrofit2 + kotlin
I attach the complete files of my attempt to connect to the server with retrofit by logging in to the app. The server returns 3 variables to me and the idea is to display them indicating that I am ...
0
votes
0
answers
45
views
Got failed to connect to /10.0.2.2 (port 8080) from /10.0.2.16 (port 35802) after 10000ms error when connect android to local API using retrofit
My android project have a server. This is my configure
In my MainViewModel file
class MainViewModel :ViewModel(){
private val _filmRespone: MutableState<filmState> = mutableStateOf(...
1
vote
1
answer
51
views
How can I show my Log.i() in my logcat when it is not in the main thread?
I have this function in my viewModel which calls a retrofit request in another function, but the Log.i() statement in the function that calls a retrofit request doesn't show in my logcat. I have been ...
0
votes
1
answer
99
views
Handle http request path changes in runtime with retrofit
I have this api usage now:
App.API.foo(mapOf("a" to a, "b" to b)).enqueue(responseHandler)
// my api class
@POST("/foo-v1")
fun foo(@Body map: Map<String, String>):...
0
votes
0
answers
14
views
Android Retrofit2 Call error when send Post request to API
Hello I start with my first Android app. I use Retrofit2 and all Get request work.
But if I have Post request I have this error:
"Unable to invoke no-args constructor for retrofit2.Call<java....
0
votes
1
answer
60
views
Jetpack compose ViewModels - should I have one ViewModel for different api calls?
Currently, I'm trying to get down basics of jetpack compose, and I'd like to ask you about the view model. Let's say we have an app which will make a few different api calls. As far as I know, before ...
0
votes
0
answers
26
views
How to handle Okhttp3 POST Failing after changing location? Roaming issue?
Issue: A user typically makes a few POSTs successfully from one room and then walks a few minutes to another location. During this walk it is possible that the device roams and tries to connect to ...
0
votes
0
answers
202
views
retrofit2.HttpException: HTTP 404, at retrofit2.KotlinExtensions$await$2$2.onResponse error
I want to implement use-case for my project;
this is my retrofit implemantation;
`@Module
@InstallIn(SingletonComponent::class)
object AppModule {
@Singleton
@Provides
fun provideRetrofitInstance(...
0
votes
1
answer
108
views
Convert Retrofit Json to Kotlin Map
Ok, i have a problem in a Kotlin multiplatform project i am working on at the moment.
I want to get some Currency conversion rates from a api (http://www.floatrates.com/daily/usd.json) and save them ...