Тёмный

Kotlin Youtube - How to Quickly Fetch Parse JSON with OkHttp and Gson (Ep 2) 

Lets Build That App
Подписаться 204 тыс.
Просмотров 86 тыс.
50% 1

Episode 1: • Kotlin RU-vid: Intro ...
Today, we learn how to fetch JSON data and integrate it using Model objects in our application. What's going to make our lives a lot easier is to use the help of OkHttp and Gson to fetch and parse our objects. Once we construct a HomeFeed model containing a list of videos, we will modify MainAdapter to dynamically render our list using this REST api endpoint. Enjoy.
HomeFeed Json Endpoint: api.letsbuildt...
OkHttp: square.github....
Gson: guides.codepat...
Intermediate Training Core Data
www.letsbuildt...
Instagram Firebase Course
www.letsbuildt...
Facebook Group
/ 1240636442694543
iOS Basic Training Course
www.letsbuildt...
Completed Source Code
www.letsbuildt...
Follow me on Twitter: / buildthatapp

Опубликовано:

 

22 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 203   
@dcdales
@dcdales 4 года назад
In case anyone is having the problem I had - in the build.gradle file, if you write what Brian wrote ("compile..."), it'll show up with a line crossed through it. If you hover your mouse over that text, it'll tell you that "compile is deprecated, replace with implementation" - so you basically just replace the keyword. I would've figured this out sooner if I'd known to hover over that text, haha! Awesome videos, Mr. Voon! 10/10! Thank you!
@samthexplorer9621
@samthexplorer9621 6 лет назад
Your systematic approach to programming and explanations make your vidz worth watching. Thanks Brian!
@cotswoldconversions
@cotswoldconversions 3 года назад
3 years later, still a life saver. Clear and concise, also great demo of 'Debug' too 👍
@heathkornblum6007
@heathkornblum6007 4 года назад
Brian has a casual, easy demeanor that makes him a good instructor. I recommend this video.
@absconditus8660
@absconditus8660 5 лет назад
You're so chill. I feel like I could smoke a blunt with you and talk about various code syntaxes.
@rodiaz2709
@rodiaz2709 2 года назад
Thank you. I had like 3 hours trying to parse a JSON from an API and thanks to you I was able to do it. Not only that, but I think I actually understand the process and will be able to repeat it in the near future. Gracias.
@iantassin7611
@iantassin7611 6 месяцев назад
Took me so long to find a decent tutorial on this! Thank you! Great video and explanations!
@souphiane10
@souphiane10 3 года назад
This video helpt me A LOT! I have a deadline and don't have the luxury to dive into the documentation. Thanks for explaining this so easily!
@evertonrodrigues1277
@evertonrodrigues1277 4 года назад
For everyone having trouble with Gson not parsing array, if your Json starts with a "[", make sure to use YourClass. Also, if it starts as an array, the example that he have using the HomeFeed class won't work, you would need to use the Video class directly. Watch out for the format of your Json.
@EdgarG2310
@EdgarG2310 4 года назад
could you please send an example of the code? and how can I change the format of my Json?
@vinaynagrani7954
@vinaynagrani7954 6 лет назад
After watching your tutorials, it feels so comfortable to start with Android development using Kotlin. Thanks Brian!
@smag21
@smag21 3 года назад
Amazing tutorial. Watched countless other tutorials and none of them told me to add the internet permission in the manifest, hence my errors. You made this very clear and simple to understand. Thank you!
@LucasLima-yu8mb
@LucasLima-yu8mb 6 лет назад
How can someone dislike this master piece? Thanks bro, those libs to work with Json and HttpRequest are really, really great! Youre a beast!
@roiiroii9561
@roiiroii9561 3 года назад
I applied for a job 1 week ago and this was my sort of task to get an interview. Basically if i am going to be accepted on this internship it's going to be just because of you Thank you
@emmanuelpregnolato5026
@emmanuelpregnolato5026 6 лет назад
Been following your through iOS and now Kotlin. You have a gift for teaching.
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
Glad to have you follow the channel, isn't great that we can program in so many languages?
@uzKantHarrison
@uzKantHarrison 6 лет назад
Hey, I'm really lucky I found you. Your videos are too good, really. I really needed something practical yet super clear in order to build my application for a uni course in about 15 days without knowing kotlin at all (I refused to use java, I really dislike it).
@abdulazeez180
@abdulazeez180 3 года назад
Thank you !!! , you just saved me in my 400 level class
@cvdogan
@cvdogan 6 лет назад
You have taught me Obj C first. Then Swift. And now Kotlin. I think I owe you a drink :D
@kerem.a14
@kerem.a14 4 года назад
adamın heykelini yapsak taşaklara beton yetmez
@philwatkinson5417
@philwatkinson5417 5 лет назад
These are great videos, thanks Brian. There's a minor syntax change with the latest Android Studio/Kotlin libraries: At the 10:42 point in the video, the syntax is: override fun onResponse(call: Call, response: Response) It seems to be no practical difference, but Kotlin insists that the declaration of an overridden function is EXACTLY the same as the abstract declaration.. .. Aah, there's another small syntax change on the next line, it should be: val body = response.body?.string() Cheers.
@MasPran
@MasPran 4 года назад
thank you very much, I'm studying this. in this section, I found an error in the code that I tried from the tutorial. I read read a few comments. I found the answer here ... I am very happy ...
@sayanmanna2511
@sayanmanna2511 3 года назад
Dude u r a savior!
@JohanAlbrectsen
@JohanAlbrectsen 6 лет назад
I LOVE these Android tutorials
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
Everything's nice and easy eh?
@JohanAlbrectsen
@JohanAlbrectsen 6 лет назад
Lets Build That App I really like that you compared some of the elements to the corespondent elements in swift. Makes it easier, please keep doing that :-) But yeah, some concepts I can’t understand 100%
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
After you get over the initial "new syntax" scare, it becomes the same thing but in a new language. Good ol fetch json, load images. Rinse and repeat.
@shingiraibondai747
@shingiraibondai747 6 лет назад
i wish you could get a million views. Thank u so much, this is very easy to follow
@ravi_dhorajiya
@ravi_dhorajiya 6 лет назад
I Love these tutorials, Easy to understand and very helpful videos.
@mheymans
@mheymans 5 лет назад
Just a quick note to watch out for. This took me about an hour to realize. Don't use body = response?.body()?.toString() use: response?.body()?.string() ResponseBody has its own to string function - string()
@adrianalarsson7345
@adrianalarsson7345 4 года назад
Do you fixed the problem?
@7erg95
@7erg95 4 года назад
body() is deprecated, use body like variable instead it
@albaqawi
@albaqawi 6 лет назад
Hay Brain, thank you for a magical outstanding experience to get me back on a fast track for mobile development. I am very grateful to come across someone who loves to grow through sharing knowledge like you. I am loving this Kotlin track even through my heart is set on iOS :D I want to take the opportunity to wish you and all your loved ones a brilliant holiday season and more success and prosperity in the new year.
@surjavaghosh427
@surjavaghosh427 5 лет назад
Thank you so much for all your hard work :) When ever I want to learn something new.. your videos are always what I need . Please keep it up
@pembatamang8233
@pembatamang8233 6 лет назад
let the beginners know that the list is meant for the jsonarray and the world isn't over... it took me hours to figure that out. that aside your tuts are very helpful
@boeingpete
@boeingpete 5 лет назад
Me too. Took a little while to work out what was going on there.
@VinitJogani
@VinitJogani 6 лет назад
The videos are really great. I just wanted to point one thing out - I guess we can also make HTTP calls in a more simple way: using threading and the URL library, it boils down to one line: Thread({ val response = URL("").readText() }).start()! You still need to use Gson to convert it into a model, but I found this to be the easier way...
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
Hmm....really? I gotta brush up on the Threading library.
@VinitJogani
@VinitJogani 6 лет назад
Yeah! I discovered it a few days ago myself. And it's much simpler with Kotlin than it was in Java. The one downside though is that you do have to use try-catch statements as the inbuilt URL library throws a fatal exception when it can't read a url...
@ivicapetrsoric1263
@ivicapetrsoric1263 6 лет назад
Could you please post the code with your solution?
@VinitJogani
@VinitJogani 6 лет назад
Hey, like I said. The code is just this much: Thread({ val json = URL("").readText(); val object = Gson().fromJson(json); runOnUiThread({ // do something with the object... }); }).start();
@charleskinniburgh7206
@charleskinniburgh7206 6 лет назад
Very nicely presented. Just right for a tutorial.
@philwatkinson5417
@philwatkinson5417 5 лет назад
If you get an OkHttpCliient error "failed to execute request" here's what to try: (*) Double-check the url is correct - it's "api." not "www." (*) Add the following line to the onFailure function to give more details in the logcat about the error: Log.i("LBTA", e.message) (*) Test your OkHttpClient code by using a different JSON feed: This is a public testing feed that I used: url = "jsonplaceholder.typicode.com/posts" If you see some json in your logcat, then you know your code is okay, and that the problem lies with the server. Hope this helps.
@MeAndAdiZero
@MeAndAdiZero 5 лет назад
If the error message in the logcat is something like socket failed: eperm (operation not permitted), you can also try uninstalling the app from the emulator and debugging it once again.
@haasithsanka5706
@haasithsanka5706 5 лет назад
There's an error inside of runonuithread because I'm getting that homefeed is null inside the runonuithread
@matheusserraouchoa8222
@matheusserraouchoa8222 4 года назад
owesome video is symple and just go in what we need thankssss a lot ps:from a brasilian fan
@sraldous
@sraldous 6 лет назад
Should the homeFeed & Video classes be 'data class' rather than just 'class'?
@kanhaiyatulsyan7560
@kanhaiyatulsyan7560 3 года назад
yes that would been have a better approach....!!!!
@christophebeaulieu4916
@christophebeaulieu4916 4 года назад
The videos are great, but I feel like your microphone might be slightly not loud enough? I'm comparison to other videos, this one is probably at 70-90% volume whereas I listen to others at like 40-50%. Anyways, the content and the videos are amazing! :)
@truongnguyenthe6492
@truongnguyenthe6492 3 года назад
love your work your video , thanks alot
@hispagamers
@hispagamers 4 года назад
thanks profesor brian
@gtbgmaniak
@gtbgmaniak 5 лет назад
Hello Brian, That's an excellent tutorial. I am implementing it, I did have some differences in the structure (my JSON was an array instead of an object, but I found out how to fix that. I am having another problem though, I am using this code inside a fragment and when I try to use the runOnUiThread { } block, it's marked as red and it's not working, any idea how I could fix that?
@andreaculot99
@andreaculot99 5 лет назад
Excuse me, could you tell my how you fix your first problem? I’m new to Kotlin and also my JSON is an array...
@gtbgmaniak
@gtbgmaniak 5 лет назад
@@andreaculot99 hello, sorry for the late answer, I ended up switching libraries to RetroFit2 and it worked like a charm :) almost didn't have to change code.
@benyaminaghaebrahimi5073
@benyaminaghaebrahimi5073 6 лет назад
same as always, very helpful, thank you
@nanditaekambaram9609
@nanditaekambaram9609 4 года назад
My code moves to the onFailure function call and gives me an error "System.out: socket failed: EPERM (Operation not permitted)"
@marshal7969
@marshal7969 4 года назад
mine too, idk why
@BuildezCraft
@BuildezCraft 4 года назад
@@marshal7969 Delete the app from the emulator and run again
@vpsaxman
@vpsaxman 4 года назад
@@BuildezCraft that worked for me, thanks!
@vivekrai5042
@vivekrai5042 6 лет назад
Hey Dude you are doing great job. Thank-you for the videos.
@waichee723
@waichee723 5 лет назад
Thanks your video are awesome.
@ethanhatch9224
@ethanhatch9224 3 года назад
My debugger is telling me that I am getting NULL values in my class when converting Json to Gson in: val homeFeed = gson.fromJson(body, HomeFeed::class.java) I can't seem to figure out why or how I can mitigate this. (I am using my own variable names and a different API)
@lilashsah6225
@lilashsah6225 6 лет назад
thank you very much.This video is very help full for me
@venusianoctopus1
@venusianoctopus1 6 лет назад
Great videos! Thank you so much. :)
@sf2759
@sf2759 6 лет назад
UR VIDEOS ARE SUPERB!
@utsabsubedi6009
@utsabsubedi6009 5 лет назад
Only the original thread that created a view hierarchy can touch its views. how to solve this in fragment? you cannot use runOnUiThread on fragment
@drjones694
@drjones694 6 лет назад
if you install android studio fresh and when you run the okhttp it is not working make sure your emulator can reach the internet. to test hit home on the emulator and click chrome go to yahoo.com. if it doesnt work go to android studio preferences ( on a mac ) and type in proxy make sure the android studio is using the current wifi connection then go to the emulator and make sure the proxy tab says to use android studio test yahoo.com again and your all set. hope that helps anyone new and having issues
@context177
@context177 5 лет назад
Hi, Brian! Awesome videos, best way to get job in software dev field is DO DEV!:) Could you make a video explaining how to use RPC. Can't find answers for json-rpc2.0 using Kotlin. THX!!!
@joycelu962
@joycelu962 6 лет назад
SOOOO grateful!! Thanks!!!
@AbhishekKumar-mq1tt
@AbhishekKumar-mq1tt 6 лет назад
Thank u for this awesome video
@RahulSharma-es9uv
@RahulSharma-es9uv 4 года назад
Retrofit vs okhttp? Which one shall we prefer
@hyperspace5828
@hyperspace5828 5 лет назад
I love you dude, you save my life
@rogerwprice
@rogerwprice 6 лет назад
Loving it!
@dailydaisydog
@dailydaisydog 6 лет назад
Thanks for the tutorial !! :D
@drumagazine5722
@drumagazine5722 3 года назад
Why don't you use retrofit to parse the data
@RussellHarrower
@RussellHarrower 3 года назад
Ok besides that OkHttp now allowing .execute().use which works - I could not get your method to work.
@na_you_mess_am
@na_you_mess_am 6 лет назад
Hello, How do you tackle the case whereby the user has no active internet connection?
@donathmm3881
@donathmm3881 2 года назад
Thank you bro
@tohaassegaf7642
@tohaassegaf7642 4 года назад
sorry for asking, why my api always Failed to execute request, i'll try to use your api anda another api. but it still not working properly
@adrianalarsson7345
@adrianalarsson7345 4 года назад
Need help too
@adrianalarsson7345
@adrianalarsson7345 4 года назад
I get the answer in the console but the homefeed class dosent show
@sawkhinmaungthoo5063
@sawkhinmaungthoo5063 6 лет назад
I just wanna say "i will click a lots of ads on your tutorials" !!!!!!
@typical_punjabi_munda
@typical_punjabi_munda 4 года назад
very good !! can you please tell me how to parse json array instead of json object ???
@TravelMemories
@TravelMemories 5 лет назад
hi man, i have a question, i am doing this with maps, but i dont know how call the mainthread on response, to reload the map when the points are loaded, something like layoutViews or something
@RussellHarrower
@RussellHarrower 3 года назад
note is is now : println(response.body!!.string())
@trainmania100
@trainmania100 3 года назад
In 2021, is okhttp and gson still the recommended thing to use to build something like this?
@LetsBuildThatApp
@LetsBuildThatApp 3 года назад
Google their github activity
@mrrice4036
@mrrice4036 6 лет назад
Thank you so much . bro 😊😊
@kanhaiyatulsyan7560
@kanhaiyatulsyan7560 3 года назад
response?.body()?.string is not working for me.....idk y...🥺🥺
@philwatkinson5417
@philwatkinson5417 5 лет назад
Thanks for the really great videos, Brian. I'm getting this error from the OkHttpClient: "Trust anchor for certificate path not found". Mr Google indicates that the SSL certificate on the server has expired or is mis-configured. These videos are well over a year old now and you don't have any responsibility to maintain them, but the context is still relevant and there are thousands of beginner developers (like me) that would get a lot of benefit out of them. So I hope this is something that is easily fixable. Cheers.
@philwatkinson5417
@philwatkinson5417 5 лет назад
Brian, apologies; I've found a solution. I was implementing a logging interceptor (an useful exercise in itself) and accidentally tested the project against a different virtual device in the emulator - and got a different INET exception (what?!). A bit of trial and error I found a virtual device that would make the project accept the api feed - Nexus 9 Android 7.0 (API 24). Weird. Having seen some advice that a good way to eliminate strange errors is to close the emulator and reopen it, I feel that I have bumped into one of those dark and mysterious areas of Android programming - and feeling a little bruised and humbled as a result, Apologies again.
@roberthdg
@roberthdg 5 лет назад
@@philwatkinson5417 you've saved me hours of trial an error, thanks
@sherazali6324
@sherazali6324 5 лет назад
How you have created this api I mean if using sql then on what server or is it heroku?? Your information mean a lot. Thanks :)
@aym_zahid
@aym_zahid 5 лет назад
i have the same problem
@LearnWebDesign
@LearnWebDesign 5 лет назад
I know this is an older comment - and wanted to write something just in case someone read it in the future and had the same question. Depending on your language determines how you generate your data - the API is just JSON nothing more, nothing less. Converting your objects to a json object should be simple, search "your language data to json" should give you some insight -- now I will say -- make sure your data is not in a parent array - I had this break on me -- meaning your data starts like this [....] vs {} - best of luck.
@joredawal2297
@joredawal2297 6 лет назад
sir.. are the lessons/tuts that the link you've provided below is for free.? or if isn't how can i enrolled in your class on android dev. especially on kotlin courses..
@mbfauzan
@mbfauzan 3 года назад
Hi, nice tutorial, how do i change the url ?
@aviksutar
@aviksutar 6 лет назад
make some tutorial on augmented reality in Android.Ur tutorials are awesome
@artemkonoplin2143
@artemkonoplin2143 6 лет назад
Hi! Thank you for the video. Do you use x86 or arm emulator?
@jshamuraq
@jshamuraq 4 года назад
Is there gonna be tutorial for populating recyclerview from, say, an xml file within the product package instead of loading it from the internet?
@yersultanutemissov
@yersultanutemissov 6 лет назад
man, nice job
@imranahmedtech843
@imranahmedtech843 6 лет назад
Love You Bro
@MrCollinsOne
@MrCollinsOne 4 года назад
If you want to fetch and parse html because you want to consum data that is not available by an api you can try github.com/skrapeit/skrape.it It's a kotlin library that is providing a very nice DSL to achieve things like this
@aviksutar
@aviksutar 6 лет назад
very nice
@developerios6096
@developerios6096 5 лет назад
Hi brian, this a great video! Im an iOS developer, and im writing my first kolin lines. I like to write code like i would do with swift, so i created a network manager class to fetch the json. All is fine, however, i dont know how to return this data to my main activity. In swift i would do this with a completion block on the the fetchJson(), but i dont know if there is something similar in kotlin. Also, intercepting the adapter from my network manager class, is something i want to avoid because its not the purpose of this class to update the UI with the new data. How do i return data properly?
@tylerrutt17
@tylerrutt17 6 лет назад
Thanks! Very helpful!. Just wondering if you have any tips for refreshing yourself with Xcode? Like if you've taken a break from it for awhile.
@roothack2325
@roothack2325 6 лет назад
Hi, I need your help. I have a live portal with database how can I convert into an Android app
@ameysaple7893
@ameysaple7893 6 лет назад
Can you show dynamic horizontal recyclerview to dynamic vertical recyclerview with jain parse...pls
@francisconeto9081
@francisconeto9081 3 года назад
Hi, can i contact you? I'm new até kotlin and Android studio, só i'm here to ask if you please, could help me!
@thanasisathanasi4965
@thanasisathanasi4965 4 года назад
What is different of Gson and Volley?
@i3lacangel
@i3lacangel 5 лет назад
Hey, great tutorial... But having lots of trouble with API links that have parameters
@Kanakapallianurag
@Kanakapallianurag 4 года назад
runOnUiTherad is not working can u please me out
@anasabubakar4125
@anasabubakar4125 6 лет назад
nice tutotials
@anasabubakar4125
@anasabubakar4125 6 лет назад
iam hoping you will make Android development courses as you did for ios development
@Tom-rk3xl
@Tom-rk3xl 5 лет назад
Hello ! I am having a big problem. When I compile, the function prints out what is written when onFailure but not when onResponse. how to fix it? I tried other .json files but still the same
@Tom-rk3xl
@Tom-rk3xl 5 лет назад
I found the problem :D it is because your phone is sleeping.. :D unlock it and then compile :D
@dumitru3355
@dumitru3355 5 лет назад
Thanks )
@ecodisplay7893
@ecodisplay7893 4 года назад
Hi Sir.. do you have any video for filtering this recyclerview? 10q
@ecodisplay7893
@ecodisplay7893 4 года назад
I mean how to search data or filtering the search data
@valeria-210
@valeria-210 6 лет назад
Brian, I did a navigationButton with three items. I visualize (as you do to check) that each fragment is shown when selecting each item. My query is, to apply your course to a fragment, is it the same? What if it was an activity? or with a fragment does the programming change?
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
Each fragment should be its own entity. Once you load one, loading a second one is pretty easy.
@valeria-210
@valeria-210 6 лет назад
I do not realize how to do it ...? Will you have a tutorial or do you know any guides? THANK YOU!
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
Google pretty much shows you how to load a fragment right?
@valeria-210
@valeria-210 6 лет назад
yes, until the fragment shows up, and upload a text manually, too, I have the problem in showing the data from the json ....
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
You should probably load the json then, no?
@carbon4061
@carbon4061 5 лет назад
hey. i have a question. if i go another activity and still need the same data what should i do. is there a way to make "val homeFeed" accessible frown any Activity ?
@LetsBuildThatApp
@LetsBuildThatApp 5 лет назад
We go over this in the next lessons right? I might be going crazy after reading comments
@sandroh3378
@sandroh3378 6 лет назад
Hi Brian, The video is really helpful. I just wanted to ask a question how can I use OkHttp with request method POST in Kotlin? Thanks
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
I'd go ahead and use the method shown here for POST requests: stackoverflow.com/questions/23456488/how-to-use-okhttp-to-make-a-post-request
@sandroh3378
@sandroh3378 6 лет назад
Great. Thank you so much
@usgqgwa
@usgqgwa 6 лет назад
At 15:08 , 18:53 : I don't know if you are familiar with this but app.quicktype.io/ is quite helpful for most of the languages including swift and objective c
@amansagar4948
@amansagar4948 3 года назад
in javascript we do fetch.then().catch() and we are done, why it is so complicated in android? is it just me? and the big question why nobody wonderers why it is complicated in android? or it may be because im not familier with OOPs
@LetsBuildThatApp
@LetsBuildThatApp 3 года назад
This is mostly because JSON is native javascript and you are left with zero type checking during compile time. Most programmers prefer having type safety over ease of use coding as it prevents future bugs from creeping in.
@amansagar4948
@amansagar4948 3 года назад
@@LetsBuildThatApp that seems true, I was hopping on typescript lately and it's fun, code becomes more reliable, still the OOP paradigms in android haunts me, too much code to get basic stuff done, im working on improving that as well.. let see
@diymicha4905
@diymicha4905 4 года назад
Why can I only fetch from https? If I use your url "api.letsbuildthatapp.com/youtube/home_feed" it works like a charm, and displays the raw json data. But if I'm using my own json on my server (which is not https) it fails. My json comes from an http server, so the app gives the "failed to execute" error... But the syntax of my json is exactly the same. :( I now tried volley, I tried retrofit, now OkHttp (which is the easyest and most logical in my opinion) but all with the same result. It seems like android refuses to connect to http. But it has to work somehow...
@LetsBuildThatApp
@LetsBuildThatApp 4 года назад
Http doesn’t work fyi
@sraldous
@sraldous 6 лет назад
Quick side question, how do we set custom colors when using API 15? Everything I'm trying seems to require API 26. Thanks!
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
What have you tried?
@sraldous
@sraldous 6 лет назад
Color.argb requires API level 26 However, I found Color.parseColor("#HexValue") to work, is this the only option?
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
Yep, i've used parseColor in the past. Is there a reason you're not using targetSdkVersion 26? My configurations use: minSdkVersion 15 targetSdkVersion 26
@williamclarkson6834
@williamclarkson6834 4 года назад
I'm getting an error when using fetchJson, "E/zygote: isWhitelistProcess - Process is Whitelisted. Does anyone know how to get around this? I'm using my Samsung S7 as my emulator, its never given me this error before. Any help appreciated!!!
@carloselilopeztellez7802
@carloselilopeztellez7802 5 лет назад
Is it a better practice to keep models in separate files?
@LetsBuildThatApp
@LetsBuildThatApp 5 лет назад
Probably, why do you ask?
@qwithonly7967
@qwithonly7967 5 лет назад
when i call fetchJson. it always return onFailure. is anyone know what happen?
@cerdek9190
@cerdek9190 5 лет назад
i have the same problem, do you know what happend?
@Tom-rk3xl
@Tom-rk3xl 5 лет назад
i found the problem :D it is because the phone is sleeping . unlock it and then compile ;D
@sirisaac8727
@sirisaac8727 5 лет назад
@@cerdek9190 Have you found a solution?
@guillermoyeltsinbaltodanol5548
First...!!!! Good video, keep it up ... !!!
@jackh3824
@jackh3824 6 лет назад
Im getting this error when using a different url to parse an array. "Expected BEGIN_OBJECT but was BEGIN_ARRAY" Is there a simple fix? Ive altered all my classes to to adhere to the new url. Changing the home feed class to "Array" instead of "List" gives the same error. Im coming from iOS so I figure there has to a simple solution.
@LetsBuildThatApp
@LetsBuildThatApp 6 лет назад
Episode 5 of this series explains how you would parse an Array of objects instead of an Object directly. Namely, you need to use Array::class.java.
@jackh3824
@jackh3824 6 лет назад
You're really making the sub worth it. 👍🏽
Далее
Kotlin YouTube - Load and Cache Images Picasso (Ep 3)
25:42
Rest API - Best Practices - Design
15:50
Просмотров 108 тыс.
FastAPI Tutorial - Building RESTful APIs with Python
1:03:10
RecyclerView (Kotlin Beginner Example)
39:22
Просмотров 71 тыс.
What is JSON ?
11:56
Просмотров 1,1 млн
How to deal with Abusive People? - Assim al hakeem
1:50