Retrofit - URL Manipulation with @Path @Query @QueryMap | Android Studio Tutorial
Вставка
- Опубліковано 23 лип 2024
- 🏆 My Online Courses
⭐Discount Coupon: LAUNCH-STEVDZA-SAN
stevdza-san.com
🐱👤 Wanna become a member? Join!
/ @stevdzasan
📸 Instagram
/ stevdza_san
Retrofit is a Type Safe REST client for Android Developed by square. It uses okHttp library for HTTP requests, and it's one of the best tools for performing network requests in android applications. In this video I'll show you how to customize URL and get dynamic input from user in order to concatenate it with our endpoint (GET request).
Retrofit requires three main components:
1. Retrofit Instance:
We can create an instance of Retrofit by Retrofit.Builder class. And we have to specify the base url and converter factory at the time of the Retrofit instance creation
2. Model Class:
Retrofit needs a Model class for sending and receiving Request. It uses the model class for parsing server Response by using converters like Gson, Moshi etc.
3. An Interface for possible API calls:
The interface contains methods that represents possible API calls. Each methods need a base Url end point annotation that represents the Http methods like GET, POST etc.
Start learning android 1 year after this video release but still a phenonmenal one! Thanks
It works! Its my first time handling a an API that deals with the path! This is what I'm looking for! Thanks!
Very good examples. Not fragments of an example you find everywhere. Also very good explained.
Great tutorial and thank you, I recently switched to kotlin and I am starting to see benefits of it
Thank you so much; manipulating the query parameter was helpful.
Thanks sir. its hard to appreciate such an effort
best outro to a tech tutorial
thx a lot you are such a great teacher
Great !!
Correct Guy. You are doing well
Thanks!
YOU ARE FUCKIN AWESOME MAAN !!!!
amazing !! I wating for post requst😭 I hopeing comming soon
Thank you nice tutorial, I want @POST and HTTPS SSL settings...
Please make a video on how to consume GraphQl api with Apollo using MVVM and coroutines with repository pattern
THAnk you my god u saved me
Always glad to help buddy 👍
thanks
in case someone is having an error about arrays, remove "
Can you do livedata transformation tutorial?
Hi teacher! could you teach how to Change Retrofit Base Url at runtime with kotlin?
I'll make a video about it .
How can handle internate error
Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
how to fix it. please help
same error
Can we pass user id in the query map as well?
You can pass whatever info you want.
@@StevdzaSan thanks man
Plz make it for JAVA
Can mr help me pls . Make app translate with api query . Android studio java not kotlin
Pls i very need 🙏.
I don't work in Java anymore.
@@StevdzaSan okey how kotlin
After entering a number and pressing the button, thereby calling JSON, if I rotate the screen, the response is gone and only the welcome text is there. That is probably because we're taking input number from the Main Activity. What should I change in the ViewModel so that the response stays visible even after rotating the screen?
Is constraint Layout , values must be set in the xml to accommodate it
Thanks!