You can determine whether the user is typing or not you have to create one CustomEditText class which extends to EditText. This type of functionality is widely used in Chat application. Here is a snippet of CustomEditText public class CustomTypingEditText extends CustomEditTextNormal implements TextWatcher { …
Android
Firebase customise notification when app is in background or killed
Firebase will not call your onMessageReceived when your app is in background or killed, and you can’t customise your notification. System generated notification will show. to make firebase library to call your onMessageReived in every cases a) Foreground b) Background c) Killed you must not …
Defining item click listener for RecyclerView in Android
Android RecyclerView doesn’t come with the Item Click Listener that you have with ListView. You will have to implement the item clicke listener yourself. Below link have an example of how to implement the view holder item clicker listener in RecyclerView. In a nutshell, The Activity …
Facebook Background Post Sharing
Step 1 : Create project on facebook developer page and get facebook app id Step 2 : Insert following gradle file and sync your project compile ‘com.facebook.android:facebook-android-sdk:4.5.0’ Step 3 : Put your facebook app id in string resources as given below <string name=”facebook_app_id”>1763757463948957</string> Step 4 …
RecyclerView space between items expanding when scrolling
We need to change row child item layout parent properties android:layout_height=”match_parent” to android:layout_height=”wrap_content”
Turn on speakerphone whenever an outgoing call is made
You can set it through programmatically as below : AudioManager audioManager = (AudioManager)getApplicationContext().getSystemService(Context.AUDIO_SERVICE); audioManager.setMode(AudioManager.MODE_IN_CALL); audioManager.setSpeakerphoneOn(true); But, keep in mind that don’t forgot to set speaker off when stop the call: audioManager.setSpeakerphoneOn(false); And, Set permission in manifest: android.permission.RECORD_AUDIO android.permission.MODIFY_AUDIO_SETTINGS This code is working fine for me.hope …
How to log request and response body with Retrofit-Android?
Below code is working for both with header and without header to print log request & response. Note: Just comment .addHeader() line if are not using header.