Category : json

I want to call an api endpoint and display the associated response in my android app. The api takes a parameter user_name and return response of that user. Response is in json array consisting json of date, location and img (base64). RESPONSE [ { "id": "602a1901a54781517ecb717c", "date": "2021-02-15T06:47:29.191000", "location": "mall", "img": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYFBgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr/2wBDAQICAgICAgUDAwUKBwYHCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgr/wAARCASvBLADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/ } ] the ..

Read more

I’m getting the JSON blow from an API with retrofit and I want to only select the production_companies array from it and convert it to a list of ProductionCompanie class, how I can do it with Moshi without using nested classes? { "backdrop_path": "/52AfXWuXCHn3UjD17rBruA9f5qb.jpg", "belongs_to_collection": null, "budget": 63000000, "genres": [ { "id": 18, "name": "Drama" ..

Read more

Currently I am trying to display data from my graphQL API to my Flutter, I run the query but it says such Error being displayed and here is my code Scaffold( body: Query( options: QueryOptions( documentNode: gql(_tags.getTags()), variables: { "vendor_id": _sp.getString(‘vendor_id’) } ), builder: (QueryResult result, {VoidCallback refetch, FetchMore fetchMore}) { //refetchQuery = refetch; if(result.data ..

Read more

I get messages from a Rabbitmq queue: fun listen(callback:(msg: String) -> Unit){ val deliverCallback = DeliverCallback { consumerTag: String?, delivery: Delivery -> val message = String(delivery.body, StandardCharsets.UTF_8) Log.d(consumerTag, "<- $message") callback(message) } } Then I try parsing with Gson: val updated_session = Gson().fromJson<Session>( it, Session::class.java ) And I get a com.google.gson.JsonSyntaxException exception. My deserializer works ..

Read more

I am scheduling user registration in kotlin. I want to use preferences and I have problems with preference storage not working inside the RESPONSE of StringRequest, but it does work outside of StringRequest. Please support. work OK … ‘val stringRequest = object : StringRequest(Method.POST, URLs.URL_LOGIN, Response.Listener { response -> try { …. } catch (e: ..

Read more