-2

I am currently working on my finance project. And I want to import the data from an URL into my android app. Can somebody tell me how to fetch the data from a .js URL?

link: http://money18.on.cc/js/real/quote/00001_r.js

Tom
  • 39
  • 1
  • Go take a read on how to do HTTP request first, maybe with OkHTTP to make it simple. And then just do a GET request there. – ionizer Mar 11 '18 at 12:23
  • Possible duplicate of [Read contents of a URL in Android](https://stackoverflow.com/questions/2075836/read-contents-of-a-url-in-android) – Rishabh Maurya Mar 11 '18 at 13:26

1 Answers1

0

Just use fetch method

fetch('https://money18.on.cc/js/real/quote/00001_r.js')
  .then(function(response) {
    return response.json();
  })
  .then(function(myJson) {
    console.log(myJson);
  });
Muhammad Danial Iqbal
  • 1,546
  • 1
  • 9
  • 10