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

  • Home
  • SEARCH
  • 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 7174625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:05:49+00:00 2026-05-28T16:05:49+00:00

package com.test.methods; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException;

  • 0
package com.test.methods;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

import android.R;
import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.crumbin.main.R.color;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;



public class JsonParserActivity extends Activity {


    String strLine = null;
    String[] values = null;
    @Override
        public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(com.main.R.layout.user_main);





              // Open the file that is the first 
              // command line parameter




            try {
                FileInputStream fstream = new FileInputStream("/home/hic/jdata.txt");

              // Get the object of DataInputStream
              DataInputStream in = new DataInputStream(fstream);
              BufferedReader br = new BufferedReader(new InputStreamReader(in));

              //Read File Line By Line

                while ((br.readLine()) != null)   {
                  // Print the content on the console
                      strLine = strLine + br.readLine();

                }
              this.parse(strLine);
              //Close the input stream

                in.close();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

              parse(strLine);


              ListView contactLV = (ListView) findViewById(com.crumbin.main.R.id.user_contact_list); 

              ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,com.main.R.layout.user_contact_list_item,com.main.R.id.contact_name,values);
                contactLV.setAdapter(adapter);




        }

    public void parse(String jsonLine) {
        JsonElement jelement = new JsonParser().parse(jsonLine);
        JsonObject  jobject = jelement.getAsJsonObject();


        JsonArray jarray = jobject.getAsJsonArray("contact");

        jobject = jarray.get(0).getAsJsonObject();


        values[0]= jobject.get("user").toString();

    }


}

I’ve tried file.CanRead() and file.exist() and both return False. The file exists. Also, the file is not being read by any other process.

  • 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-05-28T16:05:50+00:00Added an answer on May 28, 2026 at 4:05 pm

    If canRead doesn’t work and the file actually exists, it means there is a permission problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my FragmentListArraySupport.java package com.test.methods; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.ListFragment; import android.util.Log;
I have created following activity package com.ali.test; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import
I am using the following code for 2D-QR code decoder. package com.test.rim; import java.util.*;
package com.fitaxis.test; import java.sql.SQLException; import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer;
Let's say I have a file called test.txt within the package com.test.io within my
The error I'm receiving is listed here . That's my HibernateUtil.java package com.rosejapan; import
My Java application has got a package structure similar to this: src/com/name/app src/com/name/app/do src/com/name/utils/db
I have this below proram package com; import java.io.PrintStream; import java.net.URL; import java.net.URLConnection; public
java.lang.NullPointerException at com.android.deviceintelligence1.test.Testappdata.testappd(Testappdata.java:29) at java.lang.reflect.Method.invokeNative(Native Method) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:529) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1448)
Please consider the following java source: package com.stackoverflow; public class CondSpeed { private static

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.