I found lots of posts in Stackoverflow but could not get the solution working for :
How to create an https Connection in Android?
Code is :
There are couple of things that you have to do when you are doing https communication with server.
Create a cretificate using OpenSSL tool using Bouncy Castle.
Load the cretificate into code and teach your code to use that.
A nice example which define how it works by step by step guide is explained in this link http://www.compiletimeerror.com/2013/01/login-application-for-android-android.html#.VSE1ftyUfTB