In this article, We try to understand the concept of Java Classes and Objects with an example. The key content of this article are- (i) What is class and Object (ii) Example of class and object (iii) Difference between Class and Object (i.a) Class In Java: A class is an entity that determines how an object will behave and what the object will contain. In other words, it is a blueprint or a set of instruction to build a specific type of object. It provides initial values for member variables and member functions or methods. (i.b) Object In Java: An object is nothing but a self-contained component that consists of methods and properties to make a data useful. It helps you to determines the behaviour of the class. i.e we say that " A class is a template for an object, and an object is an instance of a class ". That's why class is called as logical entity , where object is physical entity . So simply, a class does not allocate memory space when it is created, on other han...
How to fetch Latitude, Longitude from address and vice-versa(address from Latitude, Longitude) using Google Geo coder SDK in android| Kotlin
In this Android development related article, you will get a simple solution that, how to get address using Latitude, Longitude and vice-versa. i.e latitude, longitude from an address text. It is very easy and simple. Read full article and carefully follow all the steps. Here we use google Geocoder SDK. Okay, first we create an android project in kotlin and create an Activity say MainActivity.kt. Use the below code- Function get Latitude, Longitude from Address- fun getLatLngFromAddress (context: Context, mAddress: String): String { val coder = Geocoder(context) lateinit var address: List<Address> try { address = coder.getFromLocationName(mAddress, 5 ) if (address == null ) { return "Fail to find Lat,Lng" } val location = address[ 0 ] return " Latitude: ${location.latitude}\n Longitude: ${location.longitude}" } catch (e: Exception...