Langsung ke konten utama

Postingan

Menampilkan postingan dari November, 2016

Android ButterKnife View Binding

In this android tutorial, I am going to show how to use Android ButterKnife View Binding in android application development. If you have been developing android application, you will realized that there are lots of boilerplate codes in your application. In some cases, it will be too much that the onCreate() method will be bloated with boilerplate codes. This is where Android ButterKnife comes to your help. How it can help us to Improve your code Eliminate findViewById calls by using @BindView on fields.  Group multiple views in a list or array. Operate on all of them at once with actions, setters, or properties.  Eliminate anonymous inner-classes for listeners by annotating methods with @OnClick and others. Eliminate resource lookups by using resource annotations on fields.  In this post, I am going to show the method of using ButterKnife in RecyclerView and Each Single Views. Project Setup:  Open Project Level build.gradle file and add the following line. buildscript { repositor

Firebase Cloud Messaging in Android

Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features. If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future. Firebase Cloud Messaging is very easy to integrate into your Application. Just like GCM, FCM is a cross-platform messaging solution that allows you to send messages. FCM is completely free and there are no limitations Firebase Setup The Feature and Settings up of Application in Application is Explained in  Previous post . After this, follow the tutorial as in below. In This post, I am not explaining about any Layouts. Simply explains the Java code build to FCM Application. Adding Firebase Messaging to Your Project Now come back to your android project. Go to app folder and paste  google-services.json   file. Now go to your root level build.gradle file and add the followin