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 6678379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:14:09+00:00 2026-05-26T04:14:09+00:00

In my android project I am reading a xml file which are continuously updated

  • 0

In my android project I am reading a xml file which are continuously updated by one python script. and for update data I am continuosly reading the xml file and whenever the data is updated in xml file by python script I used that in my app.

But now problem is, because of python script and my android project continuosly accessing one xml file (One resource so I think concurrency problem), it takes so much time to get data from xml file and write data to xml file through python script.

So, Is there any simply way to communicate between python script and android app so I will avoid the use of xml file and directly used the data send to me by python script?
And also it gives me faster execution.

I tried this, (This is my android code for accessing xml file)

public void getData() throws Exception {
try
{
    while(!isStop)
    {
        isStop=parseXmlData();          

    }   
 }
catch(Exception e)
{
    e.printStackTrace();
}
  }



private boolean parseXmlFile(){
    //get the factory
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    boolean flag=false;
    try {

        //Using factory get an instance of document builder
        DocumentBuilder db = dbf.newDocumentBuilder();
        //parse using builder to get DOM representation of the XML file

        File file=new File("/mnt/sdcard/xmldata.xml");
        FileInputStream fin=null;
        if(file.isFile())
            {
            try
            {
             fin=new FileInputStream(file);
            }catch(Exception e)
            {

            }

            }
        dom = db.parse(fin);
        flag =  parseDocument();

            // from this I am getting last xml value "stop" then it returns    
                      true and from while loop I am exited..

    }catch(ParserConfigurationException pce) {
        //pce.printStackTrace();
    }catch(SAXException se) {
        //se.printStackTrace();
    }catch(IOException ioe) {
        //ioe.printStackTrace();
    }
          return flag;
}

EDIT: In my mind I have three options,

  1. Using Pipe
  2. Socket Communication
  3. AIDL

So which one is better and why?

If Am going wrong then please guide me. Thanks

  • 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-26T04:14:10+00:00Added an answer on May 26, 2026 at 4:14 am

    You could try using Sockets to communicate. http://download.oracle.com/javase/tutorial/networking/sockets/clientServer.html

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

Sidebar

Related Questions

Im my android project i have 2 java class and 2 xml file. each
In my searchable.xml in my android project, I get to specify a hint that
I have an Android project that uses a library project (all of which I
In my android project, I use a external jar which will use the class
hai every one. i am new to android. in my project i had some
I currently have a .csv file with several unlabeled columns of data, which to
i created one android project on command line using android tool. After adding aidl
My android project crashes when I try to move from one class to another,
in an android-project I need to have a checkbox which may have an indeterminate
My android project gives and error but non of my classes have one. The

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.