Git Product home page Git Product logo

news24-7-rv's Introduction

News 24/7 Open Source Love

This app is developed as a part of Udacity's Android Basics Nanodegree course

For successful build, please place your NEWS and OPEN WEATHER API Keys in gradle.properties file

Click here to download this app via Play Store.

Features or implementations:

  • Recycler View
  • Welcome Screen
  • Splash Screen
  • Adaptive icon
  • Ads
  • Crash reports by Firebase and Fabric
  • News articles from NEWS API and Telugu One
  • Fetched from JSON and RSS feed
  • Weather feature
  • Search news articles
  • Various settings (preferences)
  • Custom Tabs by Chrome

news24-7-rv's People

Contributors

sdzshn3 avatar amy6 avatar codersanjeev avatar abhinavlamba avatar pawank0411 avatar

Stargazers

Ege Adıgüzel avatar pankaj avatar  avatar Piyush Malaviya avatar Wade avatar Vaibhav Khulbe avatar Samad Talukder avatar  avatar ammyl33t avatar  avatar  avatar Poojan Savani avatar

Watchers

James Cloos avatar ammyl33t avatar  avatar  avatar

news24-7-rv's Issues

Move all reusable code to a separate class

Identify the reusable methods/code and move them to a separate helper class. For example, we have methods for setting up the API URL, checking the internet connection, and so on in the fragment classes. We can move all these to a separate class so that they can be reused across all fragment classes.
This has to be re-iterated across ViewModel, Repository and other classes as applicable.

Update gitignore to include unversioned files

We are not checking in google-services.json and gradle.properties files to VCS to ensure the API keys are not made public. Need to add these to gitignore so git does not track it when the files are created/updated locally.

Fetch news according to the country

All you need to do is, get the country name using the FusedLocationProviderClient and is already already available in MainActivity. And then convert the country name to code. For example, for India, code is in. For remaining codes, check in NEWS API website. Then save the country code in Preference manager using the PrefManager class. If the country code is null or empty, don't save it to PrefManager.
And then while generating url, get the country code from PrefManager and append it to url. If the country code is null here too, then just fetch international news.

Detect city automatically for weather feature

Use Google Maps API to detect the current city where user is and load the weather info.
Also, add a preference in settings whether to use GPS for location or use the city name which user entered.

Add Google news

Add Google News in our app which is available in NEWS API.
This news should be accessed via a button with image as Google News. This button should be placed below the action bar and also below the weather. There should be possibility to add more buttons beside the Google News button. So, buttons should be horizontally aligned and also scrollable.

Is separate ViewModels and Repository necessary?

You can see that each each news category has one separate ViewModel class and repository class.

If you think we can club all the ViewModel classes in a single ViewModel class and similarly, all repositories in a single repository class, then club them.

What do you say guys?

Add repository class for all AndroidViewModel classes

There should be a mediater repository class between Android ViewModel class and retrofit callback.
Here's what you need to do,
Create new repository for each ViewModel class.
Place the retrofit callback inside repository class, also, save the List data into a LiveData variable, add a getter method to get data.

Then in ViewModel class get data from the repository class instead of from retrofit callback.

Modularize Fragment classes

In reference to issue #12, this is a separate issue to modularize fragment classes. Add a 'BaseFragment' class defining the common functionality for all fragment classes and have the different fragment classes extend the BaseFragment class.

Include room Database and implement offline feature

When the app launches for first time, get the news info and show it to user and also save it to DB.
Or first save news info to DB and after completion, show to user by taking data from DB.

When the user launches app next time (not first time) if internet connection is active, then remove old data and save new data to DB & show to user.

If the internet connection is not active, check if data is available in DB or not. If available, show it to user and let the user know that, the content is old and offline.

recyclerView couldn't retain it's position after orientation change

If we scroll down through the articles and then we change the orientation of the screen, then app couldn't retain where it was at. It just scrolls to top again.

Steps to reproduce issue:
Open app > select language > in any of the news category, scroll down through the list > change orientation / rotate your phone.
Now you can see list is scrolled to top automatically which shouldn't happen.

Use Retrofit to handle XML RSS feed

Telugu news is fetched from an RSS feed. Data is being parsed manually and fed to the adapter. We can use Retrofit to convert the XML data from RSS feed to POJO. Refer to this link for an example.

Instructions for how to setup the project

Add the instructions on how to build and run this project in Android Studio in README file.
Particularly, the instructions about the google-services.json file which needs to be added to successfully build and run the project.

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.