First of all i'm new to android development,so i'm not very good in android.... I'm creating a rss reader and i'm using asyntask i created a java class named ReadRss but it's showing a weird error.. i'm using the latest version of android studio...
ReadRss.java
public class ReadRss extends AsyncTask<Void,Void,Void> {
Context context;
ProgressDialog progressDialog;
String address = "https://rarbg.to/rssdd.php?categories=41";
URL url;
public ReadRss(Context context) {
this.context = context;
progressDialog = new ProgressDialog(context);
progressDialog.setMessage("loading....");
}
@Override
protected void onPreExecute() {
super.onPreExecute();
progressDialog.show();
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
}
@Override
protected Void doInBackground(Void... voids) {
ProcessXml(Getdata());
return null;
}
private void ProcessXml(Document data) {
if ( data !=null ){
Log.d("root",data.getDocumentElement().getNodeName());
}
}
public Document Getdata(){
try {
url = new URL(address);
HttpURLConnection connection =(HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
InputStream inputStream = connection.getInputStream();
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
Document xmlDoc = builder.parse(inputStream);
return xmlDoc;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
when i compiled it it show me a error like
C:\Users\Shinto chakkiath\AndroidStudioProjects\rssexample\app\src\main\java\com\tecpiranha\rssexample\ReadRss.java: uses or overrides a deprecated API. Recompile with -Xlint:deprecation for details.
my logcat shows
Caused by: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl=0xa7fc1000: Failure in SSL library, usually a protocol error
2019-06-02 01:26:08.035 20487-20504/com.tecpiranha.rssexample W/System.err: error:1000043e:SSL routines:OPENSSL_internal:TLSV1_ALERT_INAPPROPRIATE_FALLBACK (external/boringssl/src/ssl/s3_pkt.c:610 0xa7f85900:0x00000001)
2019-06-02 01:26:08.035 20487-20504/com.tecpiranha.rssexample W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
2019-06-02 01:26:08.035 20487-20504/com.tecpiranha.rssexample W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357)
2019-06-02 01:26:08.035 20487-20504/com.tecpiranha.rssexample W/System.err: ... 21 more
I guess you are an Indian like me and the RARGB is blocked in many countries including India, please refer https://waytohunt.org/rarbg-proxy/, to verify the issue turn on VPN in your testing device and have a try, it should work for some countries
User contributions licensed under CC BY-SA 3.0