Updating your Nexus Player to Android M 6.0

Android 6.0 Marshmallow Factory Images are released for Nexus 6, Nexus 5, Nexus 9, Nexus 7, Nexus 10, Neus4 and Nexus Player. Google Releases Android 6.0 Marshmallow Factory Images for Nexus Devices Android 6.0 Factory Images Are Live For The Nexus 5, 6, 7, 9, And Player I will explain the steps to update software of your Nexus Player to Android M. The steps should be almost similar to other Nexus devices as well.  Flashing factory image to Nexus Player Step 0. install adb and fastboot command This method is for developers since it requires Android SDK tools set up such as, “adb” and “fastboot” command. If you haven’t set up these […]

Continue reading →

Building adb and fastboot command from AOSP source code

adb, android debugging brige, is used for connecting your PC and Android devices to get log, send command to Android devices etc which is very useful for Android software development. fastboot command is used to control bootloader mode for Nexus devices, it can be used to flash new factory image etc. Here the method of how to build adb command and fastboot command manually from Android Open Source Project source code is written. If you feel it trouble some to build adb and fastboot command manually in your PC, see also The Easiest Way to Install Android’s ADB and Fastboot Tools on Any OS [Guide] How To Setup And Use […]

Continue reading →

AsyncTask implementation framework – to be independent from Activity –

Continuing from AsyncTask usage summary. Interest is how to establish independence between Activity and AsyncTask? The answer is well summarized in the article, “Android AsyncTask はバックグラウンドの処理に集中すべし!”. I will just translate and re-summarize this article. 3 ways will be introduced.  Advance – implementation framework of AsyncTask A. Define as inner class of Activity Most intuitive, easy and faster way is to implement your AsyncTask inside Activity which use it. It is nice choice when CustomAsyncTask is specific (highly dependent on) to the parent Activity. Mock implementation is like below, here text of mEditText is updated after AsyncTask’s background process.

The problem is that member of Activity, mEditText, is used inside onPostExecute() method of CustomAsyncTask. […]

Continue reading →

Android Studio Live Templates Usage Examples

Android Studio, IDE offered by JetBrain, helps your day if you know how to use it more and more. Continuing from live template introduction, I introduce some examples of custom live templates which I found it convenient to use during my Android app development. To add your custom live template go to [File] → [Settings] → Select [Editor] category, [Leve Templates] → On the right side, you can add your custom template to “user” category. Click + button → [1. Live Templates]. 1. dump – check variables value for debugging Abbreviation: dump Description: print log to check variable’s value Template text:

Set applicable contexts to “Java” language. Template variables It is useful when you […]

Continue reading →

Spinner Fragment: show loading progress bar
– Android TV app hands on Tutorial Appendix A


In the Appendix of this Tutorial, I will introduce useful Android common library/function. These are usually applicable not only for Android TV, but also for Android phone/tablet device as well.   Spinner Fragment – show loading progress bar While user is downloading big contents from web, you might want to show progress bar to notify user that some process (in this time downloading) is being done in background. It helps navigating user to wait this process. Here, SpinnerFragment can be used to show circle arrow progress bar. Starting by making class by right click on “ui” package → [New] → [Java Class] → put Name as “SpinnerFragment”. This class is a subclass of […]

Continue reading →

Refactoring source code construction
– Android TV app hands on Tutorial 14

Refactoring I have explained Android TV specific UI implementations (sample source code referenced from Android TV sample application) through this tutorial. So I conclude this project by reorganizing the source code files. I did refactoring based on the role of each classes, and finished with below structure. com.corochann.androidtvapptutorial common – common functions. This module has no dependency of this application’s specific implementation so that you can “re-use” the code in other project as well.  PlaybackController Utils data – the data set of “Model” MovieProvider model – “Model” part of MVP architecture Movie recommendation – Recommendation function part RecommendationBuilder RecommendationFactory ui – UI handling modules (Activity & Fragments) MainActivity & MainFragment DetailsActivity & […]

Continue reading →

Build executable file with Android NDK after Lollipop (Android API 21)

I’ll introduce more functionality of Android NDK continuing from Android NDK set up introduction. Android NDK is not only a tool to build up .so library to call through JNI, but it is also possible to build executable file itself. It is achieved by just changing Android.mk configuration.  Below is example implementation to build hello-exe file. 1. Write Native (C/C++ language) source code Make “hello-exe” folder anywhere and inside this folder make “jni” folder. Place “hello-exe.c” in “jni” folder and write following. So we have a folder construction like hello-exe/jni/hello-exe.c.

For this tutorial, it is enough for native source code implementation 2-1. Build configuration by Android.mk (Before Android L) Write Android.mk […]

Continue reading →

Starting Android NDK is easy!

Android NDK Develop environment set up summary Usually Android application is developed by Java, but you can use C/C++ source code together with Android NDK (Android Native Development Kit). It provides us a opportunity to re-use/integrate existing C source code as well. Below is summary for the steps how to start working with Android NDK. Step1. Download installer from official site Visit download site here, and choose installer depending on your development OS platform. In my case, I was working on Windows 7 64-bit OS, I chose android-ndk-r10e-windows-x86_64.exe. Step2. Execute installer  Double click to execute downloaded installer(.exe file in Windows case). It will just automatically extract the files to construct NDK working directory set. It takes […]

Continue reading →

Android Studio Live Templates Introduction


How to use Live Templates Go to [File] → [Setting] → [Live Templates], already registered live templates are shown. We can check the Abbreviation, Description and Template text here. During the coding, typing “Abbreviation”(shorcut command) followed by pressing [Tab], “Template text” will be expanded. Live templates are very useful to eliminate to write the code which we often use. For example, Abbreviation “fbc” can be used for coding findViewById method (You definitely often use it when you want a reference to UI, right?). Type “fbc” and press Tab, it will automatically expand

and the cursor is selected to inside the first (), so that you can start typing class […]

Continue reading →

In-app Search function implementation
– Android TV app hands on Tutorial 13

Search function implementation The usage of SearchFragment of Leanback support library and UI related implementation are explained in previous chapter. In this chapter, I will explain (background) search function logic. Most of the implementation in this chapter is just a explanation of googlesamples. In-app search algorithm Search algorithm is implemented in loadRows method, especially the main logic is in doInBackground method of AsyncTask. It is actually simple, just checking the string “query” is contained in either title or description of Movie items. The UI related task Adapter handling is done in UI thread. onPreExecute initializes mRowsAdapter, which will contain the search results, by clear method. Searching itself is executed in background thread in […]

Continue reading →