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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:50:16+00:00 2026-05-25T02:50:16+00:00

I am trying to save some settings but the tutorial I am following(android tutorial)

  • 0

I am trying to save some settings but the tutorial I am following(android tutorial) is not helping as I am stuck on the first line of code since it seems monodroid does it differently?

             select your mode to be either private or public.

int mode= Activity.MODE.PRIVATE;

// get the sharedPreference of your context.

SharedPreference s mySharedPreferences ; mySharedPreferences=getSharedPreferences(“Name_of_your_preference”,mode);

// retrieve an editor to modify the shared preferences

SharedPreferences.Editor editor= mySharedPreferences.edit();

/* now store your primitive type values. In this case it is true, 1f and Hello! World  */

editor.putBolean(“myBoolean”,true);

editor.putFloat(“myFloat”,1f);

editor.putString(“myString”,” Hello! World”);

//save the changes that you made

editor.commit();

I don’t see Activity.MODE.PRIVATE; in monodroid.

  • 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-25T02:50:17+00:00Added an answer on May 25, 2026 at 2:50 am

    Here is my func to do this:

    protected void SaveSetting(string name, string value)
        {
            var prefences = GetSharedPreferences(Consts.Application.SETTINGS_FILE, FileCreationMode.Private);
            var editor = prefences.Edit();
            editor.Remove(name);
            editor.PutString(name, value);
            editor.Commit();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to save some XML-Data in my UserSettings (Properties.Settings.Default.UserSettings) in a .NET Winforms
I'm trying to save some settings from my app to a plist file when
I am trying to save some data from GPS to a local database. First
I'm trying to save some time / make my code readable. I have a
I am trying to save and read back some application settings stored as NSStrings
I'm trying to save some UserControl-Infos into a List like this: List<UserControlDetails> myList; public
I'm trying to save some layouts from DevExpress Grid Controls so that users can
I'm trying to save some lookup table data out to a YAML file so
Hi I am trying to use NSUserDefaults to save some default values in database.
I'm trying to create core data application. Some times when trying to save data,

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.