Android: how to get a link from Atom

I am doing an RSS reader for Android, but I have a problem with Atom. In RSS 2.0, I get a link to this:

if (xpp.getName().equalsIgnoreCase("link")) 

and he did the following:

 <link>http://wiadomosci.wp.pl/kat,1329,title,Kuratorium-odrzucilo-zastrzezenia-dyrektora-gimnazjum-salezjanskiego,wid,15039916,wiadomosc.html</link> 

therefore no problem. But in Atom, this is done differently:

 <link href="http://wiadomosci.onet.pl/media/spor-posla-po-z-wprost-czuje-sie-oszukany,1,5285815,wiadomosc.html" rel="alternate" ></link> 

How to get this link?

+4
source share
1 answer

There are many versions of Rss, Atom, etc. You can use Google Feed Api ( https://developers.google.com/feed ) to get one data structure for any version of RSS or Atom. You just need to get the result (e.g. Json - https://developers.google.com/feed/v1/jsondevguide ) and analyze it.
Hope this will be helpful.

0
source

Source: https://habr.com/ru/post/1442050/


All Articles