Web API Android Studio Kotlin Tutorial | REST

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

ความคิดเห็น • 18

  • @AdityaYadav-py9yz
    @AdityaYadav-py9yz 2 ปีที่แล้ว +5

    Great playlist cal, hope more people discover your work.

  • @paulavram2759
    @paulavram2759 19 วันที่ผ่านมา

    why skip the part where you created the project, and the xml file ? the page where you show the data from that api, i don't understand anything.

  • @tamnguyen2009
    @tamnguyen2009 2 ปีที่แล้ว +1

    thanks so much bro . For opening my eyes. :)))

  • @viacly7312
    @viacly7312 2 ปีที่แล้ว +4

    If anyone is having problems using this with Array of objects. Here is the solution.
    Use: val request: List = Gson().fromJson(inputStreamReader, Array::class.java).toList(). And updateUI function should be: private fun updateUI(request: List). In updateUI function you need to for loop your list.
    Sorry for bad explanation, but hopefully this helps someone out.

    • @kabirbajaj7225
      @kabirbajaj7225 7 หลายเดือนก่อน

      i am unable to loop through the object and display them what should i do exactly in the updateUI function?

  • @kyanite8682
    @kyanite8682 ปีที่แล้ว

    Nice tutorial

  • @samuelcommander8611
    @samuelcommander8611 2 ปีที่แล้ว +1

    This is a great video, super useful. Quick q - if this strategy were used to return info where each var in Currency had the same name, then how might you change the approach plz. I'm trying to adapt it to my own stuff but getting a bit stuck.

    • @CodeWithCal
      @CodeWithCal  2 ปีที่แล้ว +1

      If they all have the same name then I believe you can put them into an array.
      This is in Java bit I believe it's what you are trying to do
      howtodoinjava.com/gson/gson-parse-json-array/

    • @samuelcommander8611
      @samuelcommander8611 2 ปีที่แล้ว

      @@CodeWithCal Wahey, got my code working thanks to you. Cheers so much, keep up the vids.

  • @antdx316
    @antdx316 2 ปีที่แล้ว

    It was missing a couple thing such as, if there is no internet the app shouldn't crash, fetching intervals, and it should stop fetching when the page is on the background but still this is great. : )

  • @muhammadrayanmansoor4301
    @muhammadrayanmansoor4301 2 ปีที่แล้ว

    Brother from where do we know the response code should be 200 for a successful API request. Why the value is 200?

    • @CodeWithCal
      @CodeWithCal  2 ปีที่แล้ว +2

      Good question, it's a http thing. The following should clear things up developer.mozilla.org/en-US/docs/Web/HTTP/Status

  • @TimestampMaster
    @TimestampMaster 2 ปีที่แล้ว

    Great video! Just curious, what’s your education/how did you learn these programming languages?

    • @CodeWithCal
      @CodeWithCal  2 ปีที่แล้ว +3

      I studied IT in university, graduated in 2016. but that was really only a very basic understanding of java. Since then it's been self learning. I find i learn best by doing. and when i get stuck I google it, if theres a youtube video on the topic great otherwise stack overflow has some great information.
      Also the more time you spend programming the easier it is to swap languages, fundamentals of programming do not change in any programming language only syntax.

  • @salgutierrez3272
    @salgutierrez3272 2 ปีที่แล้ว

    Nice! You could have used Retrofit, no? (I'm new and just wondering if thats another way to do it?)

    • @CodeWithCal
      @CodeWithCal  2 ปีที่แล้ว +1

      Probably, usually many different ways to solve a problem 🙂