Giter Club home page Giter Club logo

Comments (12)

deshanonline avatar deshanonline commented on May 28, 2024

How to Add Other News Site

from android-news-app.

sooshin avatar sooshin commented on May 28, 2024

This app fetches data from the Internet with the Guardian API, so it only displays Guardian news.

from android-news-app.

Kshitizkhadka avatar Kshitizkhadka commented on May 28, 2024

how can i add the costom newa on this app

from android-news-app.

sooshin avatar sooshin commented on May 28, 2024

There's no feature that you can add custom news

from android-news-app.

esQmo avatar esQmo commented on May 28, 2024

Can I use it to display news from a respective news web site? The site generates data in JSON format what can be modified from your app to achieve this?

from android-news-app.

sooshin avatar sooshin commented on May 28, 2024

I'm sorry, but you cannot use this app to display news from a respective news web site. When I was building this app, I learned how to make an app that connects to the Internet in the Udacity course. The main idea of the code about Networking belongs to Udacity. The UI design is my idea though. The purpose of this repository is to help other Udacians, classmates of Udacity.

from android-news-app.

chakrapanibrahmam avatar chakrapanibrahmam commented on May 28, 2024

Can you share me Guardian business URL, as i am getting confuse NewsPreferences.java class.

from android-news-app.

sooshin avatar sooshin commented on May 28, 2024

Here it is.
https://content.guardianapis.com/search?q=&order-by=newest&page-size=10&order-date=published&from-date=2010-01-01&show-fields=thumbnail,trailText&format=json&show-tags=contributor&api-key=test&section=business

The base URL is "https://content.guardianapis.com/search" and then append query parameters using .appendQueryParameter.

You don't need to use all that query parameters that I used, but show-tags=contributor shows author name and show-fields=thumnail shows the images.

order-by, page-size, order-date, from-date are query parameters for preferences.

You may want to take a look at the requests and responses from the Guardian API:
https://open-platform.theguardian.com/explore/

from android-news-app.

chakrapanibrahmam avatar chakrapanibrahmam commented on May 28, 2024

Hi,
Here is the URL: https://newsapi.org/v2/top-headlines?country=in&category=business&apiKey=7ff1a4bf6f8541a8b8036d79a959a426 which i want to build. Well i am unable to append the URL with the same method which you used. please help me to clear this.

from android-news-app.

sooshin avatar sooshin commented on May 28, 2024

Hi,
Uri baseUri = Uri.parse("https://newsapi.org/v2/top-headlines");
Uri.Builder uriBuilder = baseUri.buildUpon();
uriBuilder.appendQueryParameter("country", "in")
uriBuilder.appendQueryParameter("category", "business");
uriBuilder.appendQueryParameter("apiKey", "7ff1a4bf6f8541a8b8036d79a959a426");

String url = uriBuilder.toString();

Let me know how it goes.

from android-news-app.

chakrapanibrahmam avatar chakrapanibrahmam commented on May 28, 2024

Hi,
Please check as in my case apikey comes at the end of the URL and category='business' comes before the apikey, where i am
unable to return Category (uriBuilder.appendQueryParameter(SECTION_PARAM, section).toString();) in getPreferrelUrl method and call that in Fragment.java NewsPreferences.getPreferredUrl(getcontext(),getString(R.string.bussiness));.

Well i am trying to create separate fragment for each category like

  1. Business
    2.Sports
    3.health
  2. Entertainment etc.

Guardian

https://content.guardianapis.com/search?q=&order-by=newest&page-size=10&order-date=published&
from-date=2010-01-01&show-fields=thumbnail,trailText&format=json&show-tags=contributor&api-key=test&section=business

Newsapi

https://newsapi.org/v2/top-headlines?country=in&category=business&apiKey=7ff1a4bf6f8541a8b8036d79a959a426

Please find the url and help me to solve the issue.

from android-news-app.

sooshin avatar sooshin commented on May 28, 2024

Hi,
Did you replace SECTION_PARAM with "category"?
Could you please share your code snippet?

from android-news-app.

Related Issues (7)

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.