Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. React Native
  3. react-native-shared-preferences

react-native-shared-preferences

Javav1.0.2

A React Native module that provides access to Android's native key-value storage system (SharedPreferences).

GitHubGitHub
125 stars54 forks0 contributors

What is react-native-shared-preferences?

React Native Shared Preferences is a React Native module that provides a JavaScript interface to Android's native SharedPreferences system. It allows developers to store and retrieve small amounts of persistent key-value data in React Native apps, using the same underlying storage mechanism as native Android apps. This solves the need for a simple, reliable, and performant storage solution in React Native applications targeting Android.

Target Audience

React Native developers building Android applications who need a straightforward, native-backed solution for persistent key-value storage, such as for user preferences, settings, or small cached data.

Value Proposition

Developers choose this module because it directly leverages Android's built-in SharedPreferences API, ensuring reliability, performance, and compatibility without the overhead of third-party storage libraries. It offers a minimal, easy-to-use JavaScript API that mirrors native Android patterns.

Overview

Android's Native key value storage system in React Native

Use Cases

Best For

  • Storing user preferences and settings in React Native Android apps
  • Caching small amounts of persistent data like authentication tokens
  • Managing simple app state that needs to survive app restarts
  • Implementing lightweight data persistence without external dependencies
  • Android-only React Native projects needing native storage integration
  • Migrating native Android storage logic to React Native

Not Ideal For

  • Cross-platform React Native applications needing storage on both Android and iOS
  • Projects requiring large-scale or complex data storage beyond simple key-value pairs
  • Modern React Native setups using Expo or relying on auto-linking for native modules

Pros & Cons

Pros

Native Android Integration

Directly accesses Android's SharedPreferences API for high performance and compatibility, as emphasized in the project description as a bridge module.

Simple Key-Value API

Provides intuitive methods like setItem and getItem, mirroring web storage patterns for easy adoption, as shown in the usage examples.

Batch Operations Support

Includes getItems and getAllKeys functions for efficient data retrieval, allowing multiple items to be fetched at once, per the README.

Customizable Storage Files

Allows setting a custom preferences file name via setName, enabling organized data separation for different app components.

Cons

Manual Native Setup

Requires manual editing of Android files like settings.gradle and MainApplication.java, which is complex and error-prone compared to auto-linking in newer React Native versions.

Android-Only Limitation

Exclusively supports Android, making it unsuitable for iOS or cross-platform apps, forcing separate storage implementations for other platforms.

Basic Feature Set

Limited to simple key-value storage without built-in encryption or support for complex data types, which may require additional work for advanced use cases.

Frequently Asked Questions

Quick Stats

Stars125
Forks54
Contributors0
Open Issues7
Last commit5 years ago
CreatedSince 2016

Tags

#data-persistence#storage#key-value-storage#android#bridge-module#react-native#persistent-storage#mobile-development#shared-preferences

Built With

A
Android
J
Java
R
React Native

Included in

React Native35.6k
Auto-fetched 10 hours ago

Related Projects

react-native-vector-iconsreact-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.

Stars17,917
Forks2,105
Last commit21 hours ago
lottie-react-nativelottie-react-native

Lottie wrapper for React Native.

Stars17,211
Forks1,801
Last commit5 days ago
react-native-mapsreact-native-maps

React Native Mapview component for iOS + Android

Stars15,997
Forks4,954
Last commit1 day ago
react-native-paperreact-native-paper

Material Design for React Native (Android & iOS)

Stars14,457
Forks2,244
Last commit16 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub