Author Archives: jkoder

How to create an asynchronous HTTP call in JAVA

Java

This tutorial explains How to create an asynchronous HTTP call in JAVA. What is asynchronous HTTP call? Asynchronous HTTP Request call allows us to process a HTTP call using non-blocking I/O in seperate thread. The main use for Asynchronous HTTP call is where the client is calling a server with a delayed response, which may results in client blocking the ... Read More »

SSL handshake alert: unrecognized_name Exception

Java

This tutorial explains how to handle SSL handshake alert: unrecognized_name exception while calling an URL over SSL/https . When I tried to connect a web-server over SSL, I was getting the below error continuously. This happened with JDK1.7 and above. Below is the sample Java programme which I was running. Issue : private static String makeSSLCall(final String URL) throws Exception ... Read More »

URL shortening using google API

Java

URL shortening using Google API Sometimes we need to share a long URL or we need to tweet them. But because of the length of the URL we are not able to do so. Google provides a service using which we can convert our long URL and squeezes them to fewer character URL. This service of Google is also known ... Read More »

GSON encoding the string like \u003d

Java

This tutorial explains how to handle the encoding issue with using GSON. Below is a sample programme in which GSON was converting string, with some special character, into some encoded character. Map<String, String> dataMap = new HashMap<String, String>(); dataMap.put("userid", "sdswSSEdafsdy2y4=="); Gson gson = new Gson(); String json = gson.toJson(dataMap); System.out.println("Json result - "+json); But when we printed the GSON string ... Read More »

Integration of Android Studio and Git

android

This tutorial explains how to use Git Version Control with Android Studio. Git is a distributed version control system. Git is a best choice among all the version control software like CVS, SVN etc. Android studio comes with Git client. All we need to do is just enable and start using it. As a prerequisite, we need to have Git ... Read More »

How to encode decode String in Java base64 Encoding

Java

Base64 Encoding Algorithm Base64 encodes String using an algorithm which uses 64 printable characters to replace each character in original string in an algorithmic sequence so that it can be decoded later. Base64 encoding prevents misuse of data by encoding it into ASCII format. Base64 is real simple and easy to use for simple encoding needs. There are more advanced ... Read More »

How to read and parse CSV file

JavaIO

This tutorial shows how to read, parse and print out the values from a CSV file. Say we have a CSV file user-profile.csv where the user name, roll number, age, course name is stored, seperated by comma. Sample file data “Aman”,”A1234″,23,”B.Tech” “Rahul”,”A1235″,21,”B.Tech” “Ravi”,”A1236″,24,”B.Tech” “Maxwell”,”A1237″,23,”B.Tech” “Patrick”,”A1238″,26,”B.Tech” “John”,”A1239″,20,”B.Tech” Extracts the Roll Number and Course from above CVS file, and print it out. ... Read More »

How to install HTTP Apache, MySql, PHP, PhpMyAdmin from source-Part 2

apache

Install HTTP Apache from source 1. Download source mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz from http://dev.mysql.com/downloads/mysql/ 2. Copy the downloaded file to folder where you want to install MySql, for my case I copied in /opt/soft-install/ directory 3. Extract the file at this location, command to extract cp -av mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz /opt/soft-install/ tar -zxvf mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz mv mysql-5.6.24-linux-glibc2.5-x86_64 mysql-5.6 4. Go to the bin directory of the ... Read More »

How to install HTTP Apache, MySql, PHP, PhpMyAdmin from source-Part 1

apache

How to install HTTP Apache, MySql, PHP, PhpMyAdmin from source Install HTTP Apache from source 1. Download source httpd-2.2.29.tar.gz from http://httpd.apache.org/download.cgi 2. Copy the downloaded file to folder where you want to install apache http server 3. Extract the file at this location, command to extract tar -zxvf httpd-2.4.12.tar.gz cd httpd-2.4.12 4. Download apr-1.5.2.tar.gz and apr-util-1.5.4.tar.gz and extract the files ... Read More »