AsyncTask usage summary

AsyncTask01

Overview AsyncTask is useful when you are working on UI (main) thread, and want to do some (maybe long) background process, and want to get callback after the background process finishes. For example, consider the case when you want to update UI of Activity according to the result of internet access. You must execute URLconnection in background thread, while updating UI must be done in UI thread after getting result. It can be implemented without caring about threads or handlers by using AsyncTask.  Basics 4 Steps method execution flow onPreExecute: invoked on the UI thread, before doInBackground starts. Initial set up part. doInBackground: invoked on the background thread. Long computation/process (ex. downloading) is executed in […]

Continue reading →

SearchFragment
– Android TV app hands on Tutorial 12

search3-2015-09-02-210633

In-app Search on Android TV application One of the biggest difference between Android phone & Android TV is their input method. Since TV does not support touchpad, and we shouldn’t expect users to use keyboard for TV, inputting words for TV is troublesome. Google suggests to use voice input for in Searching within TV Apps   In-app Search icon on BrowseFragment BrowseFragment contains a design layout for search function as well, and showing in-app icon on your application is very easy. Just implement setOnSearchClickedListener, that’s all.

setSearchAffordanceColor method can be used for specifying search icon color.

    SearchFragment Search function need to be implemented to answer user’s search query. To show […]

Continue reading →