Coder Social home page Coder Social logo

abdulqayoomaldhabab / sharedpreferencesmanager Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 129 KB

Helps to Store local data using Shared Preferences Manager

Java 100.00%
sharedpreferencesmanager shared-preferences-manager db database store shared-preferences sharedpreferences

sharedpreferencesmanager's Introduction

SharedPreferencesManager

Helps to Store local data using Shared Preferences Manager

Setup

Add it in your root build.gradle at the end of repositories:

allprojects {
		repositories {
			maven { url 'https://jitpack.io' }
		}
	}
	

dependencies

dependencies {
	        implementation 'com.github.AbdulQaYoomAldhabab:SharedPreferencesManager:v1.0.0'
	}

Initialze

  • initialize SharedPreferences Using One of The folowing methods

1 - this initialize shared Preferences with default name of application

SharedPreferencesManager.initialize(context);

or

2 - use this message if you want to set custom name for shared Preferences

SharedPreferencesManager.initialize(context, "shared Preferences Name");

Usage

To save your data use put method to set any type of data

        SharedPreferencesManager.put("key", data);

        or  --> multiple string sets

        Set<String> strings = new HashSet<>();
        strings.add("string 1");
        strings.add("string 2");
        strings.add("string 3");
        
        SharedPreferencesManager.put("SetsKey", strings);

to get saved data use the spicific get of the data type ex.

      int mInt = SharedPreferencesManager.getInt("key");
      float mFloat = SharedPreferencesManager.getFloat("key");
      String mString = SharedPreferencesManager.getString("key");
      boolean mBoolean = SharedPreferencesManager.getBoolean("key");
      Set<String> mSet = SharedPreferencesManager.getStringSet("key");

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

sharedpreferencesmanager's People

Contributors

abdulqayoomaldhabab avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.