B4A Library CustomRSSView

This library will allow you to display RSS feeds "Magazine Style" on a nice custom view.

Requirements:

- B4A 3.8

- Internet connection

How to install:

- Copy the CustomRSSView.jar and CustomRSSView.xml to your additional libraries directory.

Usage:

B4X:
Private rssView As CustomRSSView

'Initialize the CustomRSSView
rssView.Initialize(Activity, Me, "rssView", 50dip, 100%y - 50dip)

'Enter the URL of the RSS feed you want to parse
rssView.ParseRSS("http://www.b4x.com/android/forum/forums/-/index.rss")

If you want to parse local feeds, do this:
B4X:
rssView.ParseOfflineRSS(File.DirAssets, "MagazineStyleTemplate.xml")

That's it!


Notes:

1- This library process only valid XML feeds and extracts the following fields: Title, Author, Description, Link, Image and PubDate.

2- If you want to parse XML feeds which might not be compliant or you want to extract other fields you will have to do it yourself and add the data to the view, there's a method to do that.

3- On some Android versions the images might not show. - Fixed.

4- Included a simple XML template to create a magazine style feed.


Check the attached sample for more details.


Screenshots:


zAaTzPXl.png



BlxFkdVl.jpg



mCcbp2ll.jpg
 

Attachments

  • CustomRSSView_Sample.zip
    12.3 KB · Views: 684
  • CustomRSSView_Lib_1.4.zip
    14.3 KB · Views: 670
Last edited:

Alisson

Active Member
Licensed User
The code work it:
1- User conected loading rss
2- the code downloaded file rss.

If the users is offline, the file rss downloaded is read.

But if use read rss online and downloaded.
When accsses other module/view, example:

Loading module1/view1, the module/view RSS override the module1/view1.

I'll talk to my boss, available apk .

Thanks help.
 

Alisson

Active Member
Licensed User
NJDUde a found the error:


B4X:
Sub JobDone (Job As HttpJob)
   If Job.Success = True Then
       Job.Download(link1) '' I repeat the line, It is the error
           Dim out As  OutputStream
          out = File.OpenOutput(File.DirRootExternal,"folder/rss.xml",False)
           File.Copy2(Job.GetInputStream,out)
           out.Close
           Job.Release
   End If
   ProgressDialogHide
End Sub

The line is repeat: Job.Download(link1)
It is error.

Thanks very much!
 

tpakis

Active Member
Licensed User
Longtime User
@NJDude I'm trying to use your library for a small project, which is excellent for this purpose, but i found two small problems:

1) At the initialize you can set height but not width. I tried to add the view in a panel smaller than the activity width and the rssview was "chopped" from the right.
2) At customrssviewbackgroundcolor if i set it to any color but with alpha = 0 the background turns white not transparent (as i wanted)
 

NJDude

Expert
Licensed User
Longtime User
@NJDude I'm trying to use your library for a small project, which is excellent for this purpose, but i found two small problems:

1) At the initialize you can set height but not width. I tried to add the view in a panel smaller than the activity width and the rssview was "chopped" from the right.
That is correct, only the width can be set.
2) At customrssviewbackgroundcolor if i set it to any color but with alpha = 0 the background turns white not transparent (as i wanted)
What's the color of the activity/panel you added the RSS view to? it might be white.
 

NJDude

Expert
Licensed User
Longtime User

Devv

Active Member
Licensed User
Longtime User
You will have to parse that XML yourself since that format is not supported by the library, after parsing you can add the results to the library.

how many rss formats is there ?
can you please give an example of parsing XML manually ?
 

Jomagom

Member
Licensed User
Longtime User
It could be implemented to change the order of the labels, ie the title first and then the image etc.
a greeting
 

Jack Cole

Well-Known Member
Licensed User
Longtime User
There seems to be an issue with this library and https. See screenshot. The site has a valid certificate, but the library seems to be doing something like resolving to the IP and reverse lookup?

upload_2019-2-4_8-44-43.png
 

jchal

Active Member
Licensed User
Longtime User
unfortunately jack i am facing the same problem did you manage to find a soloution with the libray?
 
Top