Android Example : HTTP GET, POST Request with Retrofit

In our last tutorial we discussed about how to send a network request using Volley Library, while Volley is a widely used network library for basic HTTP operations there is one more library which is quite popular among Android developers- Retrofit. In fact many developers prefer Retrofit over Volley due to its ease of use, performance, extensibility etc.

Retrofit is basically an HTTP client for Android and Java developed by the awesome folks at Square. What makes it unique is that with Retrofit you don’t need to worry about parsing the response – meaning de-serialization is handled in the background itself, you just need to configure any convertor library (GSON, Jackson etc). Retrofit uses OkHttp by default for HTTP operations.

In this example we will develop an application which will send a network request with Retrofit and display the response. We will be using OpenWeather API to fetch current weather details. Its a free API service which provider number of APIs to fetch weather details anywhere on the Globe, you just need to register to obtain the API key. Read this for more

API:
https://api.openweathermap.org/data/2.5/weather?q=London,uk

Continue reading

Retrofit Android Example : Sending HTTP GET, POST Request

In our last tutorial we discussed about how to send a network request using Volley Library, while Volley is a widely used network library for basic HTTP operations there is one more library which is quite popular among Android developers- Retrofit. In fact many developers prefer Retrofit over Volley due to its ease of use, performance, extensibility etc.

Retrofit is basically an HTTP client for Android and Java developed by the awesome folks at Square. It uses OKHttp by default for network operations. What makes it unique is that with Retrofit you don’t need to worry about parsing the response – meaning de-serialization is handled in the background itself. You just need to configure any convertor library (GSON, Jackson etc) and the job is done.

In this example we will develop an application which will send a network request with Retrofit and display the response. We will be using OpenWeather API to fetch current weather details. Its a free API service which provides a number of APIs to fetch weather details anywhere on the Globe. You just need to register to obtain the API key. Read this for more

API:
https://api.openweathermap.org/data/2.5/weather?q=London,uk

Continue reading

Android Example : Writing text/pasting Image on Bitmap image programatically

In this example we will learn how to programatically write text/paste image on an Image in Android . Before beginning with the example lets clear some basics

What is Bitmap Image in Android ?

A Bitmap image is a series of tiny dots(called pixels) which are arranged in a pattern to form an Image. Each pixel is a small square assigned with a color. You can actually see this square pixel when you extra zoom into a image. The whole image can be edited by erasing or changing colors of individual pixels using different software tools. Android also allows us to work on Bitmaps with the help of various APIs.

bitmap_image.jpg

Continue reading

[Android Example] Writing text/pasting Image on Bitmap image programatically

In this example we will learn how to programatically write text/paste image on an Image in Android . Before beginning with the example lets clear some basics

What is Bitmap Image in Android ?

A Bitmap image is a series of tiny dots(called pixels) which are arranged in a pattern to form an Image. Each pixel is a small square assigned with a color. You can actually see this square pixel when you extra zoom into a image. The whole image can be edited by erasing or changing colors of individual pixels using different software tools. Android also allows us to work on Bitmaps with the help of various APIs.

bitmap_image.jpg

Continue reading

Android Example : Alarm Manager Complete Working

AlarmManager as the name itself suggests is used to schedule time based operations outside the lifecycle of your application. With the help of AlarmManager you can schedule your application to run at any scheduled time in future. Once the scheduled time arrives the target application starts running even if the device is asleep.

Photo_1521975251900

Continue reading