Giter VIP home page Giter VIP logo

android-rss's People

Contributors

a-iv avatar ahorn avatar astagi avatar fleker avatar jitpack-io avatar jvanwinden avatar maurizio-baldi avatar naba89 avatar rikkigibson avatar tanis2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-rss's Issues

Feedburner URLs

I tried to put a feedburner URL like this one and it didn't work.

Is there a way to get around this?

Using a custom User-Agent

I have to use a custom User-Agent string in the request to the server. One way of doing that (I think) would be to pass my own HttpClient to the constructor of RSSReader where I have set the correct user-agent beforehand. The problem is that I have to pass an RSSParser at the same time and I can't seem to use "new RSSParser(new RSSConfig())" from my own code as the RSSParser class is not public.

How about adding a constructor like this to RSSReader.java?

  /**
   * Instantiate a thread-safe HTTP client to retrieve RSS feeds. The injected
   * {@link HttpClient} implementation must be thread-safe.
   * Internal memory consumption and load performance can be tweaked with
   * {@link RSSConfig}.
   * 
   * @param httpclient thread-safe HTTP client implementation
   * @param config RSS configuration
   */
  public RSSReader(HttpClient httpclient, RSSConfig config) {
      this(httpclient, new RSSParser(config));
  }

Then it can be called like this:

  String userAgent = "custom-user-agent";
  AndroidHttpClient httpClient = AndroidHttpClient.newInstance(userAgent);
  RSSConfig rssConfig = new RSSConfig(5, 5);
  RSSReader reader = new RSSReader(httpClient, rssConfig);

ATOM support

I am sorry .. i dont know where to post this .. so making it a new issue.. Sorry for this ..

I am using ur library & it works fine for RSS. Now i need 2 support ATOM feed.
could u please suggest what modifications do i need 2 make to support ATOM.
will just modifying the parser code to support all ATOM tags will work. (i mean adding OR clauses ... example "item" or "entry" ..) will do the magic ?

Possible bug in MediaAttributes.java, inValue function

Hi,

I was getting the NumberFormatException while loading the rss feed from [http://spectrum.ieee.org/rss/fulltext] as below:

Caused by: java.lang.NumberFormatException: Invalid int: ""
at java.lang.Integer.invalidInt(Integer.java:138)
at java.lang.Integer.parseInt(Integer.java:358)
at java.lang.Integer.parseInt(Integer.java:334)
at org.mcsoxford.rss.MediaAttributes.intValue(MediaAttributes.java:47)
at org.mcsoxford.rss.RSSHandler$7.set(RSSHandler.java:210)
at org.mcsoxford.rss.RSSHandler.startElement(RSSHandler.java:269)
at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:143)
at org.apache.harmony.xml.ExpatParser.appendBytes(Native Method)
at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:513)
at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:474)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:316)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:279)
at org.mcsoxford.rss.RSSParser.parse(RSSParser.java:96)
at org.mcsoxford.rss.RSSParser.parse(RSSParser.java:65)
at org.mcsoxford.rss.RSSReader.load(RSSReader.java:107)

Caused by an empty string. The only check done in intValue function is for a null string. Added check for empty string to return the default value for my local version.
if((value == null) || (value.isEmpty())) { return defaultValue; }

Regards
Nabarun

Add possibility to add new tags

Add some kind of API that allows devs to add support for new tags. It can by adding setters to RSSHandler. I have to handle RSS feed where instead of pubDate there is dc:date, and there is no possibility to use that library.

Flag --library is not valid for update lib-project

Hi, I just want to try your library and it seems I'm not able to install it. It gives me error:

Error: Flag '--library' is not valid for 'update lib-project'.

I just today upgraded SDK Tools to revision 12. Maybe this is source of problem.

android -h update lib-project gives me:

Options:
  -p --path     The project's directory [required]
  -t --target   Target ID to set for the project

Thanks for help

Proguard Rules - Suggestion

It would be very helpful and time saving to add the proguard rules needed in order to add this library to a project.

Support for changing RSSHandler::RSS_ITEM

The feed I am Reading uses the tag "entry" instead of "item". The name of tag is encoded in a private final static field in class RSSHandler. So I have changed the string in the source code.

It would be nice a way to set this tag name without modifying the original source code.

Thank you.

Rfc822DateParser is not thread safe

Hi,

I'm using your library to read many rss feeds at a time.
I noted strange dates in my articles and searching the code I noticed that:

/**

  • @see RFC 822
    */
    private static final SimpleDateFormat RFC822 = new SimpleDateFormat(
    "EEE, dd MMM yyyy HH:mm:ss Z", java.util.Locale.ENGLISH);

SimpleDateFormat is NON thread-safe so you can't declare as static
https://stackoverflow.com/questions/6840803/why-is-javas-simpledateformat-not-thread-safe

Thanks for your great work.

Make RSSBase, RSSFeed and RSSItem Parcelable

To avoid requests on orientation change, being able to Parcel this items would make things easier.

I can make the PR, but it's terrible to still work on a Eclipse project structure :(

Class 'org.apache.http.conn.ssl.SSLSocketFactory' does not implement interface 'org.apache.http.conn.scheme.SchemeSocketFactory'

Tried to use your lib unfortunately got an error:

E/g.allatra.vest: Maybe bug 77342775, looking for Lorg/apache/http/conn/scheme/SchemeSocketFactory; 0x12e2c808[continuous;main space (region space)] defined in /data/app/org.allatra.vesti-6Ivn8VX5g-PnsnhK81HszA==/base.apk/0x7d2fdd40d7c0 with loader: dalvik.system.PathClassLoader/0x7d2f4ce29a50[hit:continuous;main space (region space)](/data/app/org.allatra.vesti-6Ivn8VX5g-PnsnhK81HszA==/base.apk/0x7d2fdd40d7c0);java.lang.BootClassLoader/0x7d2fdd373c30 in interface table for Lorg/apache/http/conn/ssl/SSLSocketFactory; 0x70398ba8[image;/system/framework/x86_64/boot-framework.art;+;0x7035e000] defined in /system/framework/framework.jar!classes3.dex/0x7d2fdd489140 ifcount=2 with loader BootClassLoader iface #0: org.apache.http.conn.scheme.SocketFactory iface #1: org.apache.http.conn.scheme.LayeredSocketFactory W/g.allatra.vest: Accessing hidden method Ljava/lang/Thread;->getUncaughtExceptionPreHandler()Ljava/lang/Thread$UncaughtExceptionHandler; (greylist,core-platform-api, reflection, allowed) E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1 Process: org.allatra.vesti, PID: 8644 java.lang.IncompatibleClassChangeError: Class 'org.apache.http.conn.ssl.SSLSocketFactory' does not implement interface 'org.apache.http.conn.scheme.SchemeSocketFactory' in call to 'java.net.Socket org.apache.http.conn.scheme.SchemeSocketFactory.createSocket(org.apache.http.params.HttpParams)' (declaration of 'org.apache.http.impl.conn.DefaultClientConnectionOperator' appears in /data/app/org.allatra.vesti-6Ivn8VX5g-PnsnhK81HszA==/base.apk) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136) at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:561) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732) at org.mcsoxford.rss.RSSReader.load(RSSReader.java:94) at org.allatra.vesti.rss.RssParser$fetchFeed$1.invokeSuspend(RssParser.kt:29) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594) at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742) I/Process: Sending signal. PID: 8644 SIG: 9 Application terminated.

Android Studio implementation

Hi,

I am new to android development. How do I make use of the library in Android Studio? What should I be adding to the build file?

How to handle Java.net.UnknownHostException ?

Hi ahorn, this is isn't an issue but I'm looking to manage in a polite way any eventual network disconnections in my app when using android-rss.

Can you recommend me how to catch and handle this kind of exception. I was trying to manage it in my code but that exception is not throwed directly from my code. The main idea is to prevent my app to break with a message error, and handle it whit a polite message to the user.

Thank you in advance,
Martin

Replace HttpClient with HttpURLConnection

Trying to compile with this library in my app on API level 25 and it's not working.

Error:(46, 13) Failed to resolve: org.apache.httpcomponents:httpclient:4.5

After examining some other help it seems like your library is using an old networking library that is not present in the latest versions of Android (and beyond).

Seems like the problem lies in the RSSReader class right at the start.

public RSSFeed load(String uri) throws RSSReaderException {
    HttpGet httpget = new HttpGet(uri);

With some slight tweaking of how the data is retrieved, it should be easy to replace this in the app without any other impact.

Eclipse reports error: "Default target help does not exist in this project"

Hervé Piedvache wrote:

I would like to use your android-rss library which seems to give me exactly
what I want to do ... but i'ts my first Android development with external
class. I'm a little lost ... may be you will solve this in two seconds ...

I have just start a new project ... nothing inside for the moment ... and want
to start integrating android-rss ...

So I have followed your instructions to reference this lib with my project :
./android update project -p ~/workspace/FootcowBlog/ -l ~/sources/android-rss/
-t 8
Resolved location of library project to: /home/herve/sources/android-rss
Updated default.properties
Updated local.properties
File build.xml is too old and needs to be updated.
Updated file /home/herve/workspace/FootcowBlog/build.xml
Updated file /home/herve/workspace/FootcowBlog/proguard.cfg

Nothing special here ... except that I get a build.xml file (attached) and
Eclipse said : Default target help does not exist in this project ...

I have tried to defined a target ... default one uncommenting "-pre-build" and
replace "help" by this ... running but when I just copy the 3 examples line
you gave :

RSSReader reader = new RSSReader();
String uri = "http://feeds.bbci.co.uk/news/world/rss.xml";
RSSFeed feed = reader.load(uri);

RSSReader is not found ... and I can't see what to include anywhere to solve
this, I mean I'm sure there is import to do ... but after a build, I don't see
any class ...

Could you please give me an answer about this ...

README extension

The extension of README should be .md, otherwise github doens't render it as markdown.

Android 1.6 not working

Seems the parser doesn't work when building for/running on android 1.6. It doesn't error just doesn't fill fields. When I call load feed returns 0 items, is not null but zero length. If I change the target to 2.2 then the feed returns items. If I debug through the code the difference appears here in RSSHandler:

public void startElement(String nsURI, String localName, String qname, org.xml.sax.Attributes attributes)

qname is "" in the Android1.6 where in 2.2 its filled.

thread will block forever when server not return all data

the default conection timeout and read timeout of HttpURLConnection is -1 which means the socket will always wait to read data and block the user thread forever if server not finish the connect,so the user thread seems to stop running.
to fix this bug may change "load" method of "RSSReader" like below:

    ......
    private int readTimeout=30000;
    private int connectTimeout=30000;
    ......
    public RSSFeed load(String uri) throws RSSReaderException{
            ......
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.setConnectTimeout(readTimeout);
            conn.setReadTimeout(connectTimeout);
            conn.connect();
            ......
}

Packege Names

All the classes package names are wrong - with an addition of words like "test,com.." or so.

unable to open the project

I'm kind of new to android - I'm unable to import this..

You think it's just missing a file for eclipse to import??

Would love the help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.