The Download Manager is a service for handling long-running downloads. The Download Manager handles the HTTP connection and check for connectivity changes, system reboots, etc. to make sure that the download completes successfully. The Download Manager will notify the Activity using a broadcast receiver once …
Android
Simplest adapter for RecyclerView
Here is the easiest way to bind adapter to recycler view with few lines of code using Last Adapter. Don’t write recycler view adapter again. Not even viewHolder!. Basically Last Adapter use Data Binding to bind data with your views. Data Binding Library is a support …

Search Music/Sound/Song API – Deezer API
Deezer API can discover from 30 million track by simply making REST api call. Whenever there is requirement to search for such sound list inside any mobile application we can use this Deezer api. For instance tiktok can search over millions of short soundtrack(30 seconds). If there …
Concat two mp4 files using MP4Parser.
Below class to append/concat two mp4 files using mp4parser. public class Mp4ParserWrapper { public static final String TAG = Mp4ParserWrapper.class.getSimpleName(); public static final int FILE_BUFFER_SIZE = 1024; /** * Appends mp4 audio/video from {@code anotherFileName} to {@code mainFileName}. */ public static boolean append(String mainFileName, String …
Boomerang with FFMpeg – Android
If you want to create Boomerang with FFmpeg command then you can use below command to use. Single command to create boomerang video ffmpeg -y -i input.mp4 -filter_complex [0]reverse[1];[0][1]concat=n=2,setpts=0.5*PTS output/boomerrang.mp4 where setpts=0.5*PTS : This is for fast video. [0]reverse[1] : this is for reversing the input video Still …
Generic Recycleview with Adapter in Kotlin
Now I will show you how to use Generic RecycleView for different View Types. First of creating Generic Recycleview Adapter (GenericAdapter) class as below. import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup abstract class GenericAdapter : RecyclerView.Adapter { var listItems: List constructor(listItems: List) { this.listItems …
What is RecyclerView? And how to use it?
With the advent of Android Lollipop, the RecyclerView made its way officially. The RecyclerView is much more powerful, flexible and a major enhancement over ListView. below is detailed insight into it. 1) ViewHolder Pattern In a ListView, it was recommended to use the ViewHolder pattern but …
Endless listview
In some of cases, we need to repeat same data in listview for endless or we can say infinate listview. So, this code may be helpful in that case. You can use this adapter. public class CircularListAdapter extends BaseAdapter { // Debug static final boolean …
Access Shared preference data from one application to another application
Create Shared preferece data in first application set its mode to MODE_WORLD_READABLE. Here is a following snippet you can find how to create shared preference and store data into it. mSharedPrefs = getSharedPreferences(“Prefs_First”, MODE_WORLD_READABLE); SharedPreferences.Editor editor = mSharedPrefs.edit(); editor.putString(“name”, etName.getEditableText().toString()); editor.putString(“password”, etPassword.getEditableText().toString()); editor.commit(); In another …
AutoCompleteTextView: Remove soft keyboard on back press instead of suggestions
We can achieve that by override-ing onKeyPreIme in your custom AutoCompleteTextView. public class CustomAutoCompleteTextView extends AutoCompleteTextView { public CustomAutoCompleteTextView(Context context) { super(context); } public CustomAutoCompleteTextView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override …