Giter VIP home page Giter VIP logo

expo-android-shared-preferences's Introduction

@wwdrew/expo-android-shared-preferences

npm version

Expo Module for Android SharedPreferences

Installation in managed Expo projects

npx expo install @wwdrew/expo-android-shared-preferences

API Reference

The filename parameter is optional for all functions. If you do not specify a filename, it will default to <bundleId>_preferences. This means the shared preferences will be accessed from a file named after your application's bundle identifier. This allows you to separate your application's shared preferences into different files, or use the default file associated with your application's bundle ID if no filename is specified.

contains(key: string, filename?: string): boolean

Checks if the shared preferences contains a value for the given key.

remove(key: string, filename?: string): void

Removes the value for the given key from the shared preferences.

clear(filename?: string): void

Clears all values from the shared preferences.

getString(key: string, defaultValue?: string, filename?: string): string

Retrieves a string value from the shared preferences.

setString(key: string, value: string, filename?: string): void

Sets a string value in the shared preferences.

getInt(key: string, defaultValue?: number, filename?: string): number

Retrieves an integer value from the shared preferences.

setInt(key: string, value: number, filename?: string): void

Sets an integer value in the shared preferences.

getLong(key: string, defaultValue?: number, filename?: string): number

Retrieves a long value from the shared preferences.

setLong(key: string, value: number, filename?: string): void

Sets a long value in the shared preferences.

getFloat(key: string, defaultValue?: number, filename?: string): number

Retrieves a float value from the shared preferences.

setFloat(key: string, value: number, filename?: string): void

Sets a float value in the shared preferences.

getBoolean(key: string, defaultValue?: boolean, filename?: string): boolean

Retrieves a boolean value from the shared preferences.

setBoolean(key: string, value: boolean, filename?: string): void

Sets a boolean value in the shared preferences.

addChangeListener(listener: (event: ChangeEventPayload) => void): Subscription

Adds a listener for changes to the shared preferences.

Types

ChangeEventPayload

The payload for change events.

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.

expo-android-shared-preferences's People

Contributors

wwdrew avatar

Stargazers

 avatar Serdar avatar Yunus TURE avatar

Watchers

 avatar

Forkers

vishaljak

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.