+Kavitha Nagarajan Thanks for the feedback.. Glad that you found the content useful. Feel free to visit playlist section (bit.ly/2wtwbQ2) to see what other concepts on Android have been covered so far. Help spread the word about the channel. Hope you have subscribed...
2:30 demo 4:04 onClick(View v) using Switch statement and Boolean flag 4:24 putting loop on separate thread : new Thread(new Runnable { public void run () { while (mStopLoop) { .. } } }).start(); 5:15 now different Thread id showing in logcat 5:37 separate thread use case advice
Make some videos on MVP, MVVM, MVA, Callback. Because most of the interviewers focuses on these topic now a days.I am writing these as your explanations are very nice.Thank you for helping.
Thanks for commenting.. One of the biggest debate among Android developers is - Which of the following MVC, MVP, MVVM, MVA are suited for Android architectures? The recent Android Architecture components that Android officially proposes make it even more clear that Android is not suited for MVC. Even MVP has it's problems with how Android components are designed. MVVM seems to be the most properly suited architecture for Android. I definitely have future plans to create content on these, but these things will take some time - as I am busy with other fundamental topics that I intend to cover in Android. If you have any interesting article/blog/github posts on these topic please let me know. It will help me create a good references when I decide to create content. The more exhaustive literature survey is, better the content will be and I don't mind help coming from any where :-)
Hey thanks.. Glad that you liked the content. Feel free to explore other videos, visit playlist section of channel to see curated content. Hope you have subscribed.
i am using checkbox to on and off flashlight .........after starting service(flash light is on state) wen we close and open application the checkbox is showing unchecked state but still flash is in on state.....hw to solve this
Maestro resuelveme una duda porfavor, cuando hablas de diferentes procesos (process /App) te refieres a diferentes apps? O estos procesos están en la misma aplicación???
In Android each and every app has a process of it's own. So basically each app gets a dedicated process.Since each app runs in it's own process they can't interfere with one another (unless you want interprocess communication) . This makes OS more complex but also robust. If all apps were hosted in one process, then for example your music player app and caller app would be in same process. If Music app crashes then it will take the caller app also down with it. If these two were separate processes, then only music app will get crashed and caller app will continue to work just fine. I intentionally wrote this in English because I don't trust how Google Translate is going to translate what I may intend to say. I want to be sure that I mean what I write. I hope I have not confused you more with this.
1) Sir, can't i check this while loop execution using my mobile phone instead of emulator 2)And OnCreate() method itself is the "main Thread/UI thread right sir??
Ans 1: You can, enable the debug mode on your Android device and run the app on device (find out how to do this :-) ) Ans 2: Yes, your understanding is right.
Since there is not real delay in the loop inside run, the logs you are seeing is not in sync with the exact moment when mStopLoop becomes false. Just add a 1 second Thread sleep and see what happens. Not as far as read: unexpected EOF! is concerned, it is not related to the code we have written. I think since lots of Logs are being written, it is affecting Android Studio. You need to increase Log buffer size of Android Studio. At least this is what I got to know when I went through some Stackoverflow posts.
Hi sir, I'm facing some ANR problem while performing setadapter for Listview . My activity contains 3listview and many other (textview ..) and in that 1 Listview is always visible and consist 7 items and 2nd list view is visible only some cases and 3rd list view consist of huge items like I'm getting items of 3rd Listview from server by using asynctask and after getting items I'm not displaying it immediately.. initially my 3rd Listview is hidden when user click on title layout I'm performing setadapter for my 3rd Listview and making it visible . But the problem is here it's. Taking more time and showing ANR. I tried putting setadapter I'm asynctask , and showing progress dialog while setting adapter so that users can not perform other ui operation . But after setting adapter after progress bar dismiss also it's taking 20-30 seconds for making Listview visible .. Please help me..
As explained in the video ANR happens when you are doing something on UI thread which is blocking it for more than five seconds. It would very difficult to guess the root cause of the problem based on just the description you have given. But I feel there is something wrong in the way you are initializing the View in 3rd ListView. Consider caching the web service response so that View can be set quickly. There is an option of Lazy Loading as well. Have you debugged the application - at which juncture the UI thread gets blocked? Use CPU and Memory profiler tools (part of Android Studio) to understand where resources are being used excessively.
Hey your video is good but when I am am making a sample then that time thread is automatic stopping after some interval of time, Please let me know why Its happening.
I suggest you check out the code from Github link I have given in description section of the video. You can compare the code you have written and I have written - or even fork my code. It will be easy to track the differences.
Nice tutorial. Thanks. I am a little confused as to why the stop button didn't stop the logging until only when it was put in a new thread. I thought changing the Boolean value should have nothing to do with the thread. can you please explain?
Please provide videos of parcelable in android.Because Parcelable is very much required when you use bulk of data to pass from one activity .Thanks in advance.
In Android any UI related work needs to run on main/UI thread. But some times to reduce the burden on main thread, you may start a thread. After that thread completes or during it's execution, you may want to update the UI with some information from that thread. That is not possible. Because the thread that you have created is not UI thread. That is where runOnUIThread comes in to picture. you can invoke this method inside you thread. This is execute the part of code, that you want to run on main/UI thread , on main/UI thread. So it's a handy mechanism provided by Android to push work from non-UI thread to UI thread.
Wow i am so glad i landed on this explanation first, very clear.
Great Explanation.Still now I didn't find this kind of explanation anywhere.Thanks a lot...
+Kavitha Nagarajan Thanks for the feedback.. Glad that you found the content useful. Feel free to visit playlist section (bit.ly/2wtwbQ2) to see what other concepts on Android have been covered so far. Help spread the word about the channel. Hope you have subscribed...
2:30 demo
4:04 onClick(View v) using Switch statement and Boolean flag
4:24 putting loop on separate thread :
new Thread(new Runnable {
public void run () {
while (mStopLoop) {
..
}
}
}).start();
5:15 now different Thread id showing in logcat
5:37 separate thread use case advice
Make some videos on MVP, MVVM, MVA, Callback. Because most of the interviewers focuses on these topic now a days.I am writing these as your explanations are very nice.Thank you for helping.
Thanks for commenting.. One of the biggest debate among Android developers is - Which of the following MVC, MVP, MVVM, MVA are suited for Android architectures? The recent Android Architecture components that Android officially proposes make it even more clear that Android is not suited for MVC. Even MVP has it's problems with how Android components are designed. MVVM seems to be the most properly suited architecture for Android. I definitely have future plans to create content on these, but these things will take some time - as I am busy with other fundamental topics that I intend to cover in Android. If you have any interesting article/blog/github posts on these topic please let me know. It will help me create a good references when I decide to create content. The more exhaustive literature survey is, better the content will be and I don't mind help coming from any where :-)
Very best explanation. Very easy to understand. Thank you
This is theqawedwaedf original comment.
BEST EXPLANATION! thank you very much
That was a very good explanation. Thanks!
Hey thanks.. Glad that you liked the content. Feel free to explore other videos, visit playlist section of channel to see curated content. Hope you have subscribed.
Thank!
Nice illustration, nice explanation
accurate and easy to understand . thank you so much sir
Awesome tutorials.. Keep doing the same sir... 🤝🏻
Thanks.. Help read the word about the channel. If you like something, please share the video with your friends and peers who might find it useful too.
Simple and clear.
Nice explanation.
Thank you sir
i am using checkbox to on and off flashlight .........after starting service(flash light is on state) wen we close and open application the checkbox is showing unchecked state but still flash is in on state.....hw to solve this
Maestro resuelveme una duda porfavor, cuando hablas de diferentes procesos (process /App) te refieres a diferentes apps? O estos procesos están en la misma aplicación???
In Android each and every app has a process of it's own. So basically each app gets a dedicated process.Since each app runs in it's own process they can't interfere with one another (unless you want interprocess communication) . This makes OS more complex but also robust. If all apps were hosted in one process, then for example your music player app and caller app would be in same process. If Music app crashes then it will take the caller app also down with it. If these two were separate processes, then only music app will get crashed and caller app will continue to work just fine.
I intentionally wrote this in English because I don't trust how Google Translate is going to translate what I may intend to say. I want to be sure that I mean what I write. I hope I have not confused you more with this.
understood teacher, better I use the translator for your convenience, thank you for sharing your knowledge ... regards
subscribe , because explaining using demos much easy to understand
good work !!.
+MedG Absent thanks for subscribing.... Stay tuned for more interesting content..
Short and at the same time Comprehensive....
Glad that you found it useful. Feel free to explore other content on channel. Visit playlist section. Hope you have subscribed.
1) Sir, can't i check this while loop execution using my mobile phone instead of emulator
2)And OnCreate() method itself is the "main Thread/UI thread right sir??
Ans 1: You can, enable the debug mode on your Android device and run the app on device (find out how to do this :-) )
Ans 2: Yes, your understanding is right.
@@Codetutor-DemystifyCoding Woah!! Thanks a lot sir.
Loop doesn't stop immediately after setting mStopLoop = false. It is stopping after long time due to "read: unexpected EOF!"
Please explain why
Since there is not real delay in the loop inside run, the logs you are seeing is not in sync with the exact moment when mStopLoop becomes false. Just add a 1 second Thread sleep and see what happens. Not as far as read: unexpected EOF! is concerned, it is not related to the code we have written. I think since lots of Logs are being written, it is affecting Android Studio. You need to increase Log buffer size of Android Studio. At least this is what I got to know when I went through some Stackoverflow posts.
explaination is very good but could you please improve the voice quality?
Hi sir,
I'm facing some ANR problem while performing setadapter for Listview . My activity contains 3listview and many other (textview ..) and in that 1 Listview is always visible and consist 7 items and 2nd list view is visible only some cases and 3rd list view consist of huge items like I'm getting items of 3rd Listview from server by using asynctask and after getting items I'm not displaying it immediately.. initially my 3rd Listview is hidden when user click on title layout I'm performing setadapter for my 3rd Listview and making it visible . But the problem is here it's. Taking more time and showing ANR.
I tried putting setadapter I'm asynctask , and showing progress dialog while setting adapter so that users can not perform other ui operation . But after setting adapter after progress bar dismiss also it's taking 20-30 seconds for making Listview visible ..
Please help me..
As explained in the video ANR happens when you are doing something on UI thread which is blocking it for more than five seconds. It would very difficult to guess the root cause of the problem based on just the description you have given. But I feel there is something wrong in the way you are initializing the View in 3rd ListView. Consider caching the web service response so that View can be set quickly. There is an option of Lazy Loading as well. Have you debugged the application - at which juncture the UI thread gets blocked? Use CPU and Memory profiler tools (part of Android Studio) to understand where resources are being used excessively.
but this does not stop the loop thread, it may be memory leakage. and consumer a lot of bettery
Yes... for example the UI thread itself is a Looper which continuously runs to execute anything related to UI.
Etv music in the intro
Hey your video is good but when I am am making a sample then that time thread is automatic stopping after some
interval of time, Please let me know why Its happening.
I suggest you check out the code from Github link I have given in description section of the video. You can compare the code you have written and I have written - or even fork my code. It will be easy to track the differences.
Useful knowledge... thanks sir
You are welcome. Feel free to explore other content on channel - visit play list section of the channel. Hope you have subscribed.
Nice tutorial. Thanks. I am a little confused as to why the stop button didn't stop the logging until only when it was put in a new thread. I thought changing the Boolean value should have nothing to do with the thread. can you please explain?
Watch the complete series...
Codetutor Thanks!
Codetutor Thanks!
Please provide videos of parcelable in android.Because Parcelable is very much required when you use bulk of data to pass from one activity .Thanks in advance.
Hi Om, Parcelable has been covered on Codetutor previously. Please visit: ruclips.net/p/PLfuE3hOAeWhbtEnCB0-vuF2hSmwGAAeea
Awesome explanation
hey thanks.. see you around.
very nicely explained
Thanks... stay tuned
Nice explanation
Very well explained..
Thanks...Stay tuned as I shall be publishing videos on Looper and Handler to deal with slightly complicated scenarios...
Please explain me what is role of runOnUIThread method in android?
In Android any UI related work needs to run on main/UI thread. But some times to reduce the burden on main thread, you may start a thread. After that thread completes or during it's execution, you may want to update the UI with some information from that thread. That is not possible. Because the thread that you have created is not UI thread. That is where runOnUIThread comes in to picture. you can invoke this method inside you thread. This is execute the part of code, that you want to run on main/UI thread , on main/UI thread. So it's a handy mechanism provided by Android to push work from non-UI thread to UI thread.
great explanation
Feel free to explore other content on playlist section of the channel. Hope you have subscribed.
Nice tutorial thanks sir. sir please also deliver tutorial on process
Thanks... stay tuned.. one of these days you may get the topic that you suggested...cheers.. happy coding..
THANKS YOU
Thanks for the kind words. Feel free to explore other content on channel. Visit the play list section. Hope you have subscribed.
Thanks :)
Very bad accent.
If you explain good and we don’t listen any word, that serve no purpose