All source codes contains in the location : InteractiveNewsReader/app/src/main
All java code contains in the location: InteractiveNewsReader/app/src/main/java/com/x54/interactivenewsreader/
java source codes are
-
MainActivity.java
-
NewsActivity.java
-
DBOpenHelper.java
-
NewsSiteDetails.java
-
NewsDetails.java
This code do background task for the first activity of the application. This code contains following functions:
-
onCreate() : This function when this activity launch. In this function contains code for startButton and here we retrive all newspaper information from database. Here we initialize tts engine by calling initializeTTS() function.
-
initializeTTS() : This function intialize the tts engine by creating an instance of TextToSpeech class of android.speech.tts package.
-
speechInputScreen() : This function show prompt to user using RecognizerIntent class from package android.speech
-
selectNews() : This function check newspaper selected by user to retrieved data from database. siteArrayList is a arraylist which contains all newspaper information.
-
onActivityResult() : Get the speech recognition result . resultString is a string which contains the result. In this function, start NewsActivity when newspaper is selected.
This class contains following functions:
- loadDataToWebView(): This function load website to the webview.
- promptSpeechInput(): This function shows prompt to user.
- onActivityResult(): This function retrieve speech recognition result.
- selectNews(): This function read news headlines.
- selectCategory(): This function select news category
- initializeTextToSpeech(): This function initialize tts engine.
- startTts(): This function extract news content from downloaded html using boilerpiper and jsoup library.
- DownloadData: This class download html of news using jsoup library.
This class helps to access and query on the embedded SQLite database. This class contains the following functions:
- getAllNewsSite() :This function retrieve all newspaper information.
- getNewsSite(): This function retrieve news category information from selected newspaper.
This class helps to set news site details to arraylist.
This class helps to set news details to arraylist.
All the resource files contains in the location: InteractiveNewsReader/app/src/main/res
The resources are :
- layout : Layouts are user interface design of application. Location: InteractiveNewsReader/app/src/main/res/layout
- values : Values contains strings,dimens,colors which used in the application. Location: InteractiveNewsReader/app/src/main/res/values
Assets contains the database of the application. Location: InteractiveNewsReader/app/src/main/assets
libs contains library used in the application. 1. boilerpipe-1.2.2 dependencies: nekohtml, xercesImpl 2. Jsoup
-
build.gradle : which contains version of gradle . Version gradle on my android studio is 3.2.1
Location: InteractiveNewsReader/build.gradle
-
build.gradle : Which contains configuration for compiling the application. Location: InteractiveNewsReader/app/build.gradle
compileSdkVersion 27 minSdkVersion 16 targetSdkVersion 27