Sometimes we have to calculate the distance between 2 locations when we have coordinates latitude and longitude for those locations. This article will discuss how you can calculate a straight line distance between 2 locations 2 programming languages, JAVA & Swift. 1. Code to Find Distance in JAVA In JAVA we don’t have any builtin […]
How to Save and Load Bitmap from Cache using LruCache in Java Android
During mobile Apps development, it’s a good practice to save images in the cache for next time fast loading. Most of the time we use Image caching libraries like Fresco, Picasso, or Glide for caching when we load images from a remote URL. But we can also use Android’s native LruChache class for this purpose. […]
Pass Object from One Activity to Another using Serializable in Android – Java
Serializable is a Java Interface through which we can convert a class object into a byte stream. We can pass object from one activity to another using Serializable in Android. Although it is considered a slow method to pass data between activities as compare to Parcelable but it’s easiest to implement. In the following example, […]
Basic RecyclerView Custom Adapter in Java Android
RecyclerView is a UI component in Android to show lists & grid of items. we usually write the RecyclerView Custom Adapter to populate data to each item of the list. In the following code, I have shared a basic RecyclerView custom adapter in Java. You can just copy-paste this code in your project and modify it […]
Lint found fatal errors while assembling a release target Android
I recently found that people are struggling while generating a release APK from Android studio with the error, “Lint found fatal errors while assembling a release target”. Although their App is running successfully in Debug mode. This error happens when we have some issues in some XML files or some other issue not allowing the […]
A guide to integrating Paypal with Spring Boot application.
In this article, I am going to integrate Paypal with Java Spring Boot application. Please note I am using PayPal Checkout with Smart Payment Button https://developer.paypal.com/docs/checkout/ which is the preferred method since February 2019. You have to generate client id and secret from the PayPal developer site as well. I am using Spring MVC. So […]
Put Constant Non-editable Text in EditText Android
Sometimes we have to put constant non-editable text in EditText in Android. For example, when we have to take phone number as input we can put fix country code as a prefix. In the case of website address as input, we can put “https://” as hardcoded string at the start. For this purpose, you can […]
Generating Pdf Table Using Java + IText
Here in this article, I am going to show you how we can create a pdf file with a table using java and iText. IText is a library to read and write pdf files. If you want to learn about iText visit https://itextpdf.com/en/get-started . See below image we are going to create a pdf file […]
Easiest Way to Implement Facebook Login in Android
As an Android developer, we have to add Facebook login in Apps in our routine life. Every time we have to copy-paste code in our Activity class. For that problem, I have written a Facebook Activity class, which you can just copy-paste in your App and extend your Activity class from this FacebookActivity instead of […]
Ultimate Guide to Realm Database Migration in Android
If you are using Realm Database in your Android App, you must have faced the migration issue while submitting new versions. If we don’t migrate Realm database properly, it causes crashes when users update the App. This article is a guide to Realm database migration in Android. Basic Realm Database Migration Steps Add the following […]