Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8459663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:23:34+00:00 2026-06-10T13:23:34+00:00

I am using url to take the file for parsing. Now i want read

  • 0

I am using url to take the file for parsing. Now i want read the file which is in sdcard for parsing.How can i do this?
here my code

reading file from url

    private static String url = "http://10.0.2.2/device1.json";
    JSONObject  json = jParser.getJSONFromUrl(url);
            devices = json.getJSONArray(TAG_DEVICES);

now i want do this from reading the file in sdcard

    java.io.File device = new java.io.File("/mnt/sdcard/device1.json");
    FileReader device_Fr = new FileReader(device);

next how to pass this file for parsing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:23:36+00:00Added an answer on June 10, 2026 at 1:23 pm

    Use this code

    read data from file into string & pass that to JSONObject.

    BufferedReader reader = new BufferedReader(new FileReader(filePath));
        String line, results = "";
        while( ( line = reader.readLine() ) != null)
        {
            results += line;
        }
        reader.close();
    
    
    JSONObject obj = new JSONObject(results);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using url to take the file for parsing. i want read the
I am using the Google Maps api. When I take the following URL and
I'm currently passing some date-time info to a web page using url parameters, which
I am using this URL http://search.twitter.com/search.json to grab tweets with the hash tag #SameHashTag
I am using the following code to play a sound file using the java
So I started using FlexPMD for static code analysis, and I want to add
Here's what my file picker looks like filepicker.pick({ mimetypes: ['image/*'], services: ['COMPUTER', 'URL'], maxSize:
I've started using a WebRequest to retrieve a file from a given URL. If
I am using File Helpers and I am unsure how to take my data
I'm using google maps with PHP/MSQL, i've read the documentation on google and take

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.