-B4J HOWTO Project NewsReader
Copyright (c) 2015 by Robert W.B. Linn, Pinneberg, Germany, <!http://www.rwblinn.de> .
These apps are made available under the terms of the Mozilla Public License 2.0 ( <!https://www.mozilla.org/MPL/2.0/> ).
THIS SOFTWARE IS PROVIDED TO YOU "AS IS". WITHOUT WARRENTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. WE EXPRESSLY DISCLAIM ANY LIABILITY WHATSOEVER FOR ANY DIRECT, INDIRECT,
CONSEQUENTIAL, INCIDENTAL OR SPECIAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST REVENUES, LOST PROFITS, LOSSES RESULTING FROM BUSINESS
INTERRUPTION OR LOSS OF DATA, REGARDLESS OF THE FORM OF ACTION OR LEGAL THEORY UNDER WHICH THE LIABILITY MAY BE ASSERTED, EVEN IF ADVISED OF THE
POSSIBILITY OR LIKELIHOOD OF SUCH DAMAGES.

-Download
* <!file://b4j/b4jhowto/examples/b4jhowtonewsreader.zip|B4J News Reader(Open Source)>

-Introduction
A solution has been requested for a simple newsreader. Requirements for the news:
* Show Title, Link, Description and Publication Date
* Link mouse clickable and content displayed in default browser or webview
* News file XML format
* Simple client app for reading from Windows, Raspberry, Android, iOS
* Client settings in a textfile in the dirapp folder
* URL for the newsfile to be defined in the settings
* Maintain a single file on a server 
* Maintain News App

-Clients Available
B4A: Android with a webview, refresh button and message label
B4A-Toolbar: Android with a toolbar (with back button, message label, refresh button) and a webview
B4J-FX: JavaFX with with a webview, refresh button and message label
B4J-FXListView: JavaFX with a listview (with hyperlink event), refresh button and message label
B4J-NonUI: StandardJava Console output
B4J-NonUISwing:StandardJava with Swing UI webview, refresh button and message label
B4J-WebApp: StandardJava Websocket Server solution with refresh button, message label and news field

-Solution
Concept: A XML file is stored on a public server. The client sends a http get request to download the file.
After the XML file is successfully downloaded to the client, the XML file is parsed to HTML and then displayed in, depending on the client, a webview or listview or HTML page.

#News File XML Structure
Simple structure.
<news>
  <item id="NNN">
		<title></title>
		<link></link>
		<description></description>
		<pubdate></pubdate>
  </item>
</news>
#XML File Items:
The title is mandatory, all other fields are optional.
New News Items are to be placed on the top of the newsfile. The ID must be unique with autoincremental value.
Example:
<item id="3"><title>Title3</title></item>
<item id="2"><title>Title2</title><link>http://www.rwblinn.de</link><description></description><pubdate>20150518</pubdate></item>
<item id="1"><title>Title1</title><description>Diescription 1</description><pubdate>20150517</pubdate></item>
#XML Filename:
newsreader.xml
Defined in the newsreader.set file located in the dirapp folder.
newsfile=newsreader.xml
#XML File Storage:
Defined in the newsreader.set file located in the dirapp folder.
newsurl=http\://www.rwblinn.de/newsreader.xml

#Settings
A settingsfile (textformat), newsreader.set, is used. This file is stored in the dir app folder (B4J) or dirrootexternal/newsreader (B4A).

#Additional Notes
* Requires B4J v2.8 or higher, Additional Libraries: javaobject
* To learn more, visit the B4J HowTos <!http://www.rwblinn.de|here> 

#Installation
Unpack the zip file, select the project and load accordingly in the B4J IDE.

More information to find <!http://www.rwblinn.de|here> .
Many thanks for your interest. Any improvements or further ideas are welcomed.

-Change Log
20150521
NEW:First Version.

