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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:51:54+00:00 2026-06-15T14:51:54+00:00

I have an XML setting file for my android application. When application is published

  • 0

I have an XML setting file for my android application.
When application is published it has some default values that have to published with app. And after changing settings by user the value of this setting file has to be changed.
I use an XML asset file to implement this feature.
This file has some default values. And by publishing an app, it’s also copied in device. But when I write to this file and come back it seems that the file was never changed.
I use a file manager and look to my file on the device and see that this file had never been changed and have it has default values.
I’m using monondroid and this is the code that I use for writing in my xmlsetting file:

public bool writeToFile (string newXmlContent)
        {
            try {
                Stream sw= Application .Context .OpenFileOutput (AppConstants .xmlSettingFileName ,
                                                                 FileCreationMode .Private  );
                StreamWriter stw= new StreamWriter (sw);
                stw.Write (newXmlContent );
                stw.Flush ();
                XmlContent = newXmlContent ;
                stw.Close ();
                sw=null;
                return true;

            } catch (Exception ex) {
                Common .HandleException (ex);
                return false ;
            }

        }

What’s wrong with this?

  • 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-15T14:51:55+00:00Added an answer on June 15, 2026 at 2:51 pm

    I found that to implementing setting page and using settings for application the best way is using from Preferences.for more information see:

    developer.android.com/design/patterns/settings.html

    developer.android.com/guide/topics/ui/settings.html

    but if any body wants to implement a config file.can use assets for this propose.to writing and reading in asset file must override application class and copy the asset file in oncereate of this class in sd or device memory.after this you can work with this file.

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

Sidebar

Related Questions

I have an ImageButton with a background image that has some transparency. By default,
I have an ImageView object that I'm setting the android:src=@drawable/some_xml_file instead of a standard
I have the following code in my application in res/xml/preferences.xml: <PreferenceScreen xmlns:android=http://schemas.android.com/apk/res/android> <PreferenceCategory android:title=Wi-Fi
Update After adding the following style and setting it for my application, I have
I am working with an Android application. In my app I have to change
I have been following this tutorial for setting up tabs in your application. http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
I have defined a local mirror for all repositories in the settings.xml file: <mirror>
I recently changed my password and have to change my maven settings.xml file to
In my extended PreferenceActivity class I call addPreferencesFromResource(R.xml.livewallpaper_settings) so I have a xml file
I have a flash element (I know, but please don't) with a settings.xml file.

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.