Posts

Showing posts with the label Android

I had 6 Android interviews during the last two years, here’s the questions plus some lessons I’ve learned

Image
I wrote this blog post at the Udacity forum, thought sharing it here is a good thing. 2 years passed since I started Android development, I was amazed by the amount of resources out there to learn Android, how the community share knowledge and co-operate to make Android development more fun, and how the Android developers attitude grows from just building things to create testable, maintainable, and easy way to communicate … code. Through those 2 years I had bunch of interviews, some go smooth, some not, but each time I look back and see what I missed. Usually the purpose of interviews is to land a job, but it’s also a great way to sense your level of understanding of tools, language and development cycle. I’ve figured a lot of stuff from reading, watching talks, tutorial and of course Udacity materials, I even had this course with MAL, was named “Android fundamentals” back then, and from that point was my start with Android development. So after counting the interviews,...

Handling data change in RecyclerView gracefully using DiffUtil

Image
DiffUtil  is an Android support library utility class which helps to ease out the process of finding which item changed in a list of data. It helps to calculate the difference between an old list and a new list and trigger updates to list items. If you are new to RecyclerView checkout my previous  posts . DiffUtil can be very useful when showing a list of data using RecyclerView where the data can be changed in future based on new values. Unlike ListView,  RecyclerView’s adapter  provides the following notify methods to only update those items that changed. notifyItemChanged(int) notifyItemInserted(int) notifyItemRemoved(int) notifyItemRangeChanged(int, int) notifyItemRangeInserted(int, int) notifyItemRangeRemoved(int, int) But since it only provides the methods, it is your responsibility to identify what are the changes in the new list compared to the old one and which method to call. This is where DiffUtil is very useful. It can identify data ch...

Beginners Guide for Publishing a Kotlin Library to jCenter

Image
I haven’t published an open source library before but always wanted to. If you are in a similar situation, having troubles with Javadoc generation or bintray configuration, than this post could be handy. So one day I decided to make it happen and here is what I have learned in the process. Since the idea was a proof of concept, please don’t expect  my library  to be shiny, very useful, or useful at all actually… 1.Creating a library If you don’t have a library there will be nothing to upload, so let’s begin with this step.  Here  is the official documentation. Create a new project Right click on app → New → Module Android Library → Next Enter the name → Finish You should see the new module in the Project’s view. I won’t be talking what a library is and what it contains since it is offtopic. So, assuming you are ready. Let’s continue. 2. Bintray You may be asking what Bintray has to do with jCente...