I am trying to develop an app where I try to connect to the server through https. For this reason I have installed a self signed certificate. I have stored the certificate inside the raw folder. Now when I try to access it an exception is thrown which says "ENOENT. No such file or directory".
Here's my code :
try {
InputStream id=getResources().openRawResource(R.raw.introduceprojectssl);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
Uri url1 = Uri.parse("android.resource://" + getPackageName() + "/introduceprojectssl");
String Path = url1.toString();
InputStream caInput = new BufferedInputStream(new FileInputStream(Path));
}
catch(Exception e) {
Log.e("Exception caught",e.getMessage();
}