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.

КОМЕНТАРІ • 42

  • @ucminh7630
    @ucminh7630 2 роки тому

    Start learning android 1 year after this video release but still a phenonmenal one! Thanks

  • @mrfapoh7536
    @mrfapoh7536 3 роки тому

    It works! Its my first time handling a an API that deals with the path! This is what I'm looking for! Thanks!

  • @karateswe
    @karateswe 3 роки тому

    Very good examples. Not fragments of an example you find everywhere. Also very good explained.

  • @jumps63
    @jumps63 4 роки тому +1

    Great tutorial and thank you, I recently switched to kotlin and I am starting to see benefits of it

  • @osehiaseehilen5718
    @osehiaseehilen5718 2 роки тому

    Thank you so much; manipulating the query parameter was helpful.

  • @abdifatahmohamed8600
    @abdifatahmohamed8600 3 роки тому

    Thanks sir. its hard to appreciate such an effort

  • @nafakash999
    @nafakash999 3 роки тому

    best outro to a tech tutorial

  • @emre.sahin10
    @emre.sahin10 3 роки тому

    thx a lot you are such a great teacher

  • @santiagos4290
    @santiagos4290 Рік тому

    Great !!

  • @PhegonDev
    @PhegonDev 3 роки тому

    Correct Guy. You are doing well

  • @AndrewDChristie
    @AndrewDChristie 2 роки тому

    Thanks!

  • @yusamertcakr8419
    @yusamertcakr8419 3 роки тому

    YOU ARE FUCKIN AWESOME MAAN !!!!

  • @mozhdehnouri4931
    @mozhdehnouri4931 4 роки тому

    amazing !! I wating for post requst😭 I hopeing comming soon

  • @bacassf8477
    @bacassf8477 4 роки тому

    Thank you nice tutorial, I want @POST and HTTPS SSL settings...

  • @MrRahulmalik
    @MrRahulmalik 4 роки тому +1

    Please make a video on how to consume GraphQl api with Apollo using MVVM and coroutines with repository pattern

  • @burak439
    @burak439 2 роки тому

    THAnk you my god u saved me

    • @StevdzaSan
      @StevdzaSan  2 роки тому +1

      Always glad to help buddy 👍

  • @krgamesstudio5476
    @krgamesstudio5476 4 роки тому

    thanks

  • @TheCreative1798
    @TheCreative1798 3 роки тому

    in case someone is having an error about arrays, remove "

  • @ismailkassim6325
    @ismailkassim6325 4 роки тому

    Can you do livedata transformation tutorial?

  • @developersuntex7230
    @developersuntex7230 4 роки тому

    Hi teacher! could you teach how to Change Retrofit Base Url at runtime with kotlin?

    • @StevdzaSan
      @StevdzaSan  4 роки тому +2

      I'll make a video about it .

  • @rockyracks459
    @rockyracks459 2 роки тому +1

    How can handle internate error

  • @leeladherkumawat7244
    @leeladherkumawat7244 2 роки тому +1

    Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
    how to fix it. please help

  • @GurpreetKaur-nx5bt
    @GurpreetKaur-nx5bt 3 роки тому

    Can we pass user id in the query map as well?

  • @aiyuayaan
    @aiyuayaan 4 роки тому +1

    Plz make it for JAVA

  • @gojolm861
    @gojolm861 2 роки тому

    Can mr help me pls . Make app translate with api query . Android studio java not kotlin

    • @gojolm861
      @gojolm861 2 роки тому

      Pls i very need 🙏.

    • @StevdzaSan
      @StevdzaSan  2 роки тому

      I don't work in Java anymore.

    • @gojolm861
      @gojolm861 2 роки тому

      @@StevdzaSan okey how kotlin

  • @pyaesonehan19
    @pyaesonehan19 2 місяці тому

  • @Mrat121
    @Mrat121 3 роки тому

    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?

    • @victororue9598
      @victororue9598 2 роки тому

      Is constraint Layout , values ​​must be set in the xml to accommodate it

  • @AndrewDChristie
    @AndrewDChristie 2 роки тому

    Thanks!