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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:16:42+00:00 2026-05-31T06:16:42+00:00

I am writing an application for android and i wish to be able to

  • 0

I am writing an application for android and i wish to be able to sync content from a web server, IE: The layouts XML to the device and cache it so that if the device is not connected to the internet it uses an old version of the XML so as soon as the device is on the internet is able to update and gather the latest XML.

Couldn’t find much on the internet, so if someone could point me in the right direction or give me some ideas this would be quite helpful.

Cheers,
Alex

  • 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-31T06:16:44+00:00Added an answer on May 31, 2026 at 6:16 am

    This is how it works with a normal xml file:

    1. Create an on your device HTTP Client
    2. Prepare a GET request to your server
    3. Send the request and retrieve the HTTP Response
    4. Read the content using an InputStreamReader
    5. Write the Stream to a file on the external storage name it e.g. newes_version.xml
    6. catch all exception, and just use the file newest_version.xml file.

    But it can’t work for Layout files

    Why? Every time you load your app on an device, everything (except /raw) in the /res folder is being compiled. Therefore your ‘stylsheets’ doesn’t exist anymore the way they did in your IDE. It’s not as simple as in html/css where you can just exchange on file. (Well, you can, put not an runtime)

    Solution

    If you really want to change your layout on Run time, you would have to load the xml (see above), parse it, and apply the information given by file using the R.id reference of the View elements.

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

Sidebar

Related Questions

I'm writing an Android application that I want to be able to send requests
Hi I'm writing a application for android that is started from boot up and
I am writing an android application to make server socket and receive messages from
I am writing an Android application that interfaces with a RESTful service. This web
I'm writing an application that synchronize android contact info with server info. After server
I'm currently writing an Android application that should be able to receive push notifications
I'm writing an android application that draws directly to the canvas on the onDraw
I am writing an android application, which communicates with server when the user logs
I'm writing an Android application, which uses AccountManager to get the token. From an
I am writing a little application in android which would have a server part

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.