Posts

Rest Template in Java

Image
  RestTemplate : 1) Why do we need RestTemplate?  ==> To communicate with different services in single application. Create Resttemplate object: // create an instance of RestTemplate RestTemplate restTemplate = new RestTemplate ( ) ; 2) Different methods of RestTemplate. exchange() <http_method>ForEntity      ex    getForEntity(),postForEntity() <http_method>ForObject         ex     getForObject(),postForObject() HttpPost Api with parameters:                                          Returns PostForObject(url,request,classType);                         ResponseBody PostForEntity(url,request,responseType);                    Response status,header,body PostForLocation(url,r...

API (Application Programming Inteface)

Image
   API ( Application Programming Interface )  API stands for " Application Programming Interface ". API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Example of API : When you use an application on your mobile phone, the application connects to the Internet and sends data to a server. The server then retrieves that data, interprets it, performs the necessary actions and sends it back to your phone. The application then interprets that data and presents you with the information you wanted in a readable way. This is what an API is - all of this happens via API. To explain this better, let us take a familiar real life example. Imagine you’re sitting at a table in a restaurant with a menu of choices to order from. The kitchen is the part of the “system” that will prepare your order. What is missing is the critical link to communicate your order to the kitchen and deliver your food b...

Android Activity Lifecycle

Image
                 "Android Activity Lifecycle" if we are new to Android development then we should learn what an Activity is in Android and what is the lifecycle of an Activity. In this blog, we will learn about, What is an activity  in Android? What is the Activity Lifecycle? Activity Lifecycle : To understand the activity lifecycle, consider an example of a human being. As human beings, we go through certain stages of our life starting from as a kid to a teenager. From an adult and then to an old person. These are the phases or states of life we go through. Similarly, for Activity in Android, we go through state changes in the total duration of the activity. An Android activity undergoes through a number of states during its whole lifecycle. The following diagram shows the whole Activity lifecycle:                                         ...

Android Core Building Blocks

Image
Android Core Building Blocks : An Android Component is a simply piece of code that has well defined life cycle. Android Manifest.xml File :    manifest file which contains the description of each component and how they interact.  The manifest file also contains the app’s metadata, its hardware configuration, and  platform requirements, external libraries, and required permissions. The basic components of any android application :  Activities Intent and broadcast receivers Services Content Providers Widgets and Notifications     1)  Activities :   Whenever we open an Android application, then you see some UI drawn over our screen.  That screen is called an Activity.   Activities are said to be the presentation layer of our applications.An activity is a class that represents a single screen.  For example , when we open our Gmail application, then we see our emails on the screen. Those emails are present in an Activity. If w...