Jun 24, 2014 Replies: 75 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: Code: Copy 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: Code: Copy 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: Attachments CustomRSSView_Sample.zip CustomRSSView_Sample.zip 12.3 KB · Views: 1,014 CustomRSSView_Lib_1.4.zip CustomRSSView_Lib_1.4.zip 14.3 KB · Views: 1,004 Last edited: Dec 5, 2014 Click to expand...
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: Code: Copy 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: Code: Copy 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:
Douglas Farias Expert Licensed User Longtime User Oct 1, 2014 #41 yes is my forum problem thx, about your problem really your panel is not correct need - pnlaction.height but the lib have a problem too only go show full if you use 0%y and 100%Y if u add your panel at a scrool view u can see what i say xD u need to talk with nj to add option to setlayout *-* or add blank lines at the end of all parse
yes is my forum problem thx, about your problem really your panel is not correct need - pnlaction.height but the lib have a problem too only go show full if you use 0%y and 100%Y if u add your panel at a scrool view u can see what i say xD u need to talk with nj to add option to setlayout *-* or add blank lines at the end of all parse
asales Expert Licensed User Longtime User Oct 1, 2014 #42 Douglas Farias said: but the lib have a problem too only go show full if you use 0%y and 100%Y ... u need to talk with nj to add option to setlayout *-* ... Click to expand... Hi @NJDude . Can you fix it? Thanks in advance.
Douglas Farias said: but the lib have a problem too only go show full if you use 0%y and 100%Y ... u need to talk with nj to add option to setlayout *-* ... Click to expand... Hi @NJDude . Can you fix it? Thanks in advance.
asales Expert Licensed User Longtime User Dec 2, 2014 #44 Douglas Farias said: but the lib have a problem too only go show full if you use 0%y and 100%Y... ... add option to setlayout... Click to expand... Hi @NJDude. Can I help me to fix the layout with an actionbar? Thanks in advance.
Douglas Farias said: but the lib have a problem too only go show full if you use 0%y and 100%Y... ... add option to setlayout... Click to expand... Hi @NJDude. Can I help me to fix the layout with an actionbar? Thanks in advance.
NJDude Expert Licensed User Longtime User Dec 5, 2014 #46 The library has been updated, new version and sample attached to first post.
J jdiperla Member Licensed User Longtime User Dec 12, 2014 #47 I didn't see this anywhere..But for rssView_ItemClicked, can we do more than just grab the URL? Can we grab things like GUID, Title, Author or even a custom field? If so, how? If not, is this planned? Thanks! ____ EDIT: I was also curious if we can limit how many news articles are displayed and if there was a way to do a next and previous page if that were the case. The last request/question I had on this was if there are ways to sort how the RSS news feed is presented. If these features are unavailable, I would like to make a formal request for them. A donation will be coming your way within the next day or two. Thank you NJDude! Last edited: Dec 12, 2014
I didn't see this anywhere..But for rssView_ItemClicked, can we do more than just grab the URL? Can we grab things like GUID, Title, Author or even a custom field? If so, how? If not, is this planned? Thanks! ____ EDIT: I was also curious if we can limit how many news articles are displayed and if there was a way to do a next and previous page if that were the case. The last request/question I had on this was if there are ways to sort how the RSS news feed is presented. If these features are unavailable, I would like to make a formal request for them. A donation will be coming your way within the next day or two. Thank you NJDude!
NJDude Expert Licensed User Longtime User Dec 13, 2014 #48 The _ItemClicked event only passes the URL of the RSS article which is in the RSS feed itself, what you are asking is not possible. Regarding the number of articles displayed and pagination, you could handle that yourself, the RSSView just displays the feed as is, the features you're requesting are more towards a RSS reader which this library is not.
The _ItemClicked event only passes the URL of the RSS article which is in the RSS feed itself, what you are asking is not possible. Regarding the number of articles displayed and pagination, you could handle that yourself, the RSSView just displays the feed as is, the features you're requesting are more towards a RSS reader which this library is not.
Douglas Farias Expert Licensed User Longtime User Feb 16, 2015 #50 Hi. @NJDude have a chance to you add this options?? 2 columns?
NJDude Expert Licensed User Longtime User Jun 17, 2015 #52 jhagerup said: Any plans for making an B4i version ? Click to expand... No plans whatsoever, sorry.
I ielliot Member Licensed User Longtime User Jun 24, 2015 #53 Hi Is there a way to hide the title bar Thanks
A Alisson Active Member Licensed User Apr 19, 2016 #54 NJDude, hello!!! I think develop the customRSS to B4I? Your code is cool!!!
DonManfred Expert Licensed User Longtime User Apr 20, 2016 #55 Alisson said: I think develop the customRSS to B4I? Click to expand... See answer #52
A Alisson Active Member Licensed User May 31, 2016 #57 Hello guys. I am using the CustomRss library to read an online XML file. After I download the file using the code. Code: Copy rssView.Initialize(Activity, Me, "rssView", 44dip, 100%y - 0dip) rssView.ParseRSS("http://www.site.com/rss.xml") link1 = "http://www.site.com/rss.xml" Dim job3 As HttpJob job3.Initialize("rss", Me) job3.Download(link1) When access a second view , the view of RSS appears. I'm using Activity.Finish correctly. My second code to download file: Code: Copy Sub JobDone (Job As HttpJob) If Job.Success = True Then Job.Download(link1) 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 When clicked to accsses the second view: Code: Copy Sub btn_Click StartActivity("online2") Activity.Finish End Sub My module online2 and view three, online: Code: Copy ... Activity.LoadLayout("online") ... If I access the online view , returns the view RSS reading rss. Please help me. Long time I'm trying to find the error and not against . Thanks very much! Last edited: May 31, 2016
Hello guys. I am using the CustomRss library to read an online XML file. After I download the file using the code. Code: Copy rssView.Initialize(Activity, Me, "rssView", 44dip, 100%y - 0dip) rssView.ParseRSS("http://www.site.com/rss.xml") link1 = "http://www.site.com/rss.xml" Dim job3 As HttpJob job3.Initialize("rss", Me) job3.Download(link1) When access a second view , the view of RSS appears. I'm using Activity.Finish correctly. My second code to download file: Code: Copy Sub JobDone (Job As HttpJob) If Job.Success = True Then Job.Download(link1) 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 When clicked to accsses the second view: Code: Copy Sub btn_Click StartActivity("online2") Activity.Finish End Sub My module online2 and view three, online: Code: Copy ... Activity.LoadLayout("online") ... If I access the online view , returns the view RSS reading rss. Please help me. Long time I'm trying to find the error and not against . Thanks very much!
NJDude Expert Licensed User Longtime User Jun 1, 2016 #58 If you want to parse an online RSS you only need: Code: Copy rssView.Initialize(Activity, Me, "rssView", 44dip, 100%y - 0dip) rssView.ParseRSS("http://www.site.com/rss.xml") You don't have to download it.
If you want to parse an online RSS you only need: Code: Copy rssView.Initialize(Activity, Me, "rssView", 44dip, 100%y - 0dip) rssView.ParseRSS("http://www.site.com/rss.xml") You don't have to download it.
A Alisson Active Member Licensed User Jun 1, 2016 #59 NJDUde the library is used to an online RSS parse . But I need to download the XML file. If a person is offline it can read RSS. I have downloaded the problem. If you use the code to download the module and RSS view are reset when you access a new view. Example, accsses the view to read RSS, after access teh view contacts. The view RSS overrides the contacts. Sorry, can't post the project because it is for corporate / company. Please, look my log: I need to solve this problem just to finish the project . NJDUde, thanks for the feedback. Attachments upload_2016-6-1_9-35-2.png 170 KB · Views: 499
NJDUde the library is used to an online RSS parse . But I need to download the XML file. If a person is offline it can read RSS. I have downloaded the problem. If you use the code to download the module and RSS view are reset when you access a new view. Example, accsses the view to read RSS, after access teh view contacts. The view RSS overrides the contacts. Sorry, can't post the project because it is for corporate / company. Please, look my log: I need to solve this problem just to finish the project . NJDUde, thanks for the feedback.
NJDude Expert Licensed User Longtime User Jun 1, 2016 #60 The information you posted is not telling me anything, however, for what you just mentioned, if you want to show an RSS even if offline then you should: 1- Check for internet connection. 2- If connected then download and parse. 3- if not connected then parse the previously downloaded RSS. or 1- Check for internet connection. 2- If connected then download and parse. 3- If not connected then display a message to connect to the internet or try later. I hope that helps.
The information you posted is not telling me anything, however, for what you just mentioned, if you want to show an RSS even if offline then you should: 1- Check for internet connection. 2- If connected then download and parse. 3- if not connected then parse the previously downloaded RSS. or 1- Check for internet connection. 2- If connected then download and parse. 3- If not connected then display a message to connect to the internet or try later. I hope that helps.