13 - JSON Parsing, NetworkOnMainThreadException, AsyncTask - Android Studio

preview_player
Показать описание

We get a NetworkOnMainThreadException if try to make a network call on main thread, we will also see how we can resolve this exception in Android.

AsyncTask is ideal for short operations (a couple of seconds), For long running tasks in the background use a services in Android.

Finally we will run our app and will parse result.

NEW LINKS:

Рекомендации по теме
Комментарии
Автор

Sir, you are one of the best teachers I've ever come across. You not do it, but deliberately run into exceptions and errors so we can understand it. Being a software development student, there is a big difference between writing a functioning code and understanding the elements that make one's code to function. That's why you are an exception. I'm going back to click the subscribe button....Thank you.

adefemie.kolawole
Автор

Whoever is trying to find a video that is properly made, explained and shown step by step, this is the right video. Thanks mate.

AllenTsuna
Автор

couldn't find a better series of videos than these, thanks dude, tho i might say, parsin json through an http protocol website is such a mess

Vasault
Автор

You're the best! Got to wonder what thousands of people would've done without you :D

Ziado
Автор

Upvoted : "I promise that it will be the last exception we get." :D

yanlisbos
Автор

awesome. you are one of real YouTube teacher. very nice. but you have to promise, you will publish more videos.

i-school
Автор

That's What We Call A Perfect Tutorial.

yashthakur
Автор

Sir i follow many instructions/tutorials in an attempt to this working..THANK YOU...URL Connection works...This has had be stumped for days
...

crookedwolfgaming
Автор

Very good work. Thank you for the lesson. I am very new at this. I only had one problem: my emulator was in Airplane Mode and would not allow me to connect to the text file.

Do not worry about the few mistakes. Most of us make far far more than you made. They do not detract from your presentation and it is good for us new people to see how you go about tracking them down and correcting them.

madjayhawk
Автор

This was the most helpful thing I found on the internet! Thanks!!!

aschultzy
Автор

Thanks a ton Hisham, This video nicely taught me to how to fetch the JSON data for a beginner like me. I was breaking my head from since 2 days and finally saved my ass.

srinivasulurao
Автор

Thanks for this video, have been trying hard to understand this and your video made it very easy ! (y)

Atulmaharaj_
Автор

what was the hotkey that you mentioned at 5:21? i couldn't understand it, thanks

zyrxeonkagero
Автор

+Hisham Muneer, you are just awesome.
Thanks a lot for the course

sudarsan
Автор

Really like your videos man, but please for gods sake, get a better mic!

heavyrazor
Автор

+Hisham Muneer I need toknow whichemulator are you using running apps, Android Emulator does not provide Internet. Guide me

maloom
Автор

Hi! Thank you very much for the helpful tutorial!

I implemented all the steps carefully, but still getting the same error after providing permission for the Internet.

Do you know what might happen? Why does it still show the same error even after I gave permission?

Thanks!

Ashirgaziyev
Автор

hi i wrote the same code but in the final fonction i mean this one :

protected void onPostExecute(String result) {
super.onPostExecute(result);
tvData.setText(result);
}

it says that it cant resolve tvData even if i ve already written private TextView data;

sophiietela
Автор

Hi, I am new to android development. Is there a way to post data from your app to the server in JSON format? Thanks.

gauravramakrishna
Автор

for the tvData, I do exactly what you showed in the tutorial, but it still doesn't detect it in the onPostExecute.

undead
welcome to shbcf.ru