Skip to content

Commit a261a1d

Browse files
author
karthi
committed
Initial commit
0 parents  commit a261a1d

File tree

1,350 files changed

+40449
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,350 files changed

+40449
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2015-present, Facebook, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# React Native Async Storage
2+
3+
An asynchronous, persistent, key-value storage system for React Native.
4+
5+
6+
## Getting Started
7+
8+
9+
```
10+
# Install
11+
$ yarn add @react-native-community/async-storage
12+
13+
# Link
14+
$ react-native link @react-native-community/async-storage
15+
```
16+
17+
See docs for [manual linking guide.](docs/Linking.md)
18+
19+
20+
## Usage
21+
22+
### Import
23+
24+
```js
25+
import AsyncStorage from '@react-native-community/async-storage';
26+
```
27+
28+
### Store data
29+
```jsx
30+
31+
storeData = async () => {
32+
try {
33+
await AsyncStorage.setItem('@storage_Key', 'stored value')
34+
} catch (e) {
35+
// saving error
36+
}
37+
}
38+
39+
```
40+
41+
### Read data
42+
```jsx
43+
44+
getData = async () => {
45+
try {
46+
const value = await AsyncStorage.getItem('@storage_Key')
47+
if(value !== null) {
48+
// value previously stored
49+
}
50+
} catch(e) {
51+
// error reading value
52+
}
53+
}
54+
55+
```
56+
57+
See docs for [api and more examples.](docs/API.md)
58+
59+
## Contribution
60+
61+
See the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.
62+
63+
## License
64+
65+
MIT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id=":@react-native-community_async-storage" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/../../../../android" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android-gradle" name="Android-Gradle">
5+
<configuration>
6+
<option name="GRADLE_PROJECT_PATH" value=":@react-native-community_async-storage" />
7+
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.4.1" />
8+
<option name="LAST_KNOWN_AGP_VERSION" value="3.4.1" />
9+
</configuration>
10+
</facet>
11+
<facet type="android" name="Android">
12+
<configuration>
13+
<option name="SELECTED_BUILD_VARIANT" value="debug" />
14+
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
15+
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
16+
<afterSyncTasks>
17+
<task>generateDebugSources</task>
18+
</afterSyncTasks>
19+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
20+
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
21+
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
22+
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/build/generated/res/resValues/debug" />
23+
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
24+
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
25+
<option name="PROJECT_TYPE" value="1" />
26+
</configuration>
27+
</facet>
28+
</component>
29+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
30+
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes" />
31+
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes" />
32+
<exclude-output />
33+
<content url="file://$MODULE_DIR$">
34+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
35+
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out" isTestSource="false" generated="true" />
36+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
37+
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out" isTestSource="false" generated="true" />
38+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" generated="true" />
39+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" generated="true" />
40+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
41+
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out" isTestSource="true" generated="true" />
42+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
43+
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out" isTestSource="true" generated="true" />
44+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
45+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" generated="true" />
46+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
47+
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
48+
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
49+
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
50+
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
51+
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
52+
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
53+
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
54+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
55+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
56+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
57+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
58+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
59+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
60+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
61+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
62+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
63+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
64+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
65+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
66+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
67+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
68+
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
69+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
70+
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
71+
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
72+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
73+
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
74+
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
75+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
76+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
77+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
78+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
79+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
80+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
81+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
82+
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
83+
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
84+
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
85+
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
86+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
87+
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
88+
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
89+
<excludeFolder url="file://$MODULE_DIR$/build" />
90+
</content>
91+
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
92+
<orderEntry type="sourceFolder" forTests="false" />
93+
<orderEntry type="library" name="Gradle: com.facebook.infer.annotation:infer-annotation:0.11.2@jar" level="project" />
94+
<orderEntry type="library" name="Gradle: com.google.code.findbugs:jsr305:3.0.2@jar" level="project" />
95+
<orderEntry type="library" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
96+
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp-urlconnection:3.12.1@jar" level="project" />
97+
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.12.1@jar" level="project" />
98+
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.15.0@jar" level="project" />
99+
<orderEntry type="library" name="Gradle: androidx.collection:collection:1.0.0@jar" level="project" />
100+
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-common:2.0.0@jar" level="project" />
101+
<orderEntry type="library" name="Gradle: androidx.arch.core:core-common:2.0.0@jar" level="project" />
102+
<orderEntry type="library" name="Gradle: androidx.annotation:annotation:1.0.0@jar" level="project" />
103+
<orderEntry type="library" name="Gradle: com.facebook.react:react-native:0.59.5@aar" level="project" />
104+
<orderEntry type="library" name="Gradle: com.facebook.fresco:fresco:1.10.0@aar" level="project" />
105+
<orderEntry type="library" name="Gradle: com.facebook.fresco:fbcore:1.10.0@aar" level="project" />
106+
<orderEntry type="library" name="Gradle: com.facebook.fresco:drawee:1.10.0@aar" level="project" />
107+
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline:1.10.0@aar" level="project" />
108+
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-base:1.10.0@aar" level="project" />
109+
<orderEntry type="library" name="Gradle: com.facebook.soloader:soloader:0.6.0@aar" level="project" />
110+
<orderEntry type="library" name="Gradle: com.facebook.fresco:imagepipeline-okhttp3:1.10.0@aar" level="project" />
111+
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat:1.0.0@aar" level="project" />
112+
<orderEntry type="library" name="Gradle: androidx.fragment:fragment:1.0.0@aar" level="project" />
113+
<orderEntry type="library" name="Gradle: androidx.vectordrawable:vectordrawable-animated:1.0.0@aar" level="project" />
114+
<orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-core-ui:1.0.0@aar" level="project" />
115+
<orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-core-utils:1.0.0@aar" level="project" />
116+
<orderEntry type="library" name="Gradle: androidx.vectordrawable:vectordrawable:1.0.0@aar" level="project" />
117+
<orderEntry type="library" name="Gradle: androidx.loader:loader:1.0.0@aar" level="project" />
118+
<orderEntry type="library" name="Gradle: androidx.viewpager:viewpager:1.0.0@aar" level="project" />
119+
<orderEntry type="library" name="Gradle: androidx.coordinatorlayout:coordinatorlayout:1.0.0@aar" level="project" />
120+
<orderEntry type="library" name="Gradle: androidx.drawerlayout:drawerlayout:1.0.0@aar" level="project" />
121+
<orderEntry type="library" name="Gradle: androidx.slidingpanelayout:slidingpanelayout:1.0.0@aar" level="project" />
122+
<orderEntry type="library" name="Gradle: androidx.customview:customview:1.0.0@aar" level="project" />
123+
<orderEntry type="library" name="Gradle: androidx.swiperefreshlayout:swiperefreshlayout:1.0.0@aar" level="project" />
124+
<orderEntry type="library" name="Gradle: androidx.asynclayoutinflater:asynclayoutinflater:1.0.0@aar" level="project" />
125+
<orderEntry type="library" name="Gradle: androidx.core:core:1.0.0@aar" level="project" />
126+
<orderEntry type="library" name="Gradle: androidx.versionedparcelable:versionedparcelable:1.0.0@aar" level="project" />
127+
<orderEntry type="library" name="Gradle: androidx.cursoradapter:cursoradapter:1.0.0@aar" level="project" />
128+
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-runtime:2.0.0@aar" level="project" />
129+
<orderEntry type="library" name="Gradle: androidx.documentfile:documentfile:1.0.0@aar" level="project" />
130+
<orderEntry type="library" name="Gradle: androidx.localbroadcastmanager:localbroadcastmanager:1.0.0@aar" level="project" />
131+
<orderEntry type="library" name="Gradle: androidx.print:print:1.0.0@aar" level="project" />
132+
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-viewmodel:2.0.0@aar" level="project" />
133+
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata:2.0.0@aar" level="project" />
134+
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata-core:2.0.0@aar" level="project" />
135+
<orderEntry type="library" name="Gradle: androidx.arch.core:core-runtime:2.0.0@aar" level="project" />
136+
<orderEntry type="library" name="Gradle: androidx.interpolator:interpolator:1.0.0@aar" level="project" />
137+
</component>
138+
</module>

android/build.gradle

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
buildscript {
3+
repositories {
4+
google()
5+
jcenter()
6+
}
7+
8+
dependencies {
9+
classpath 'com.android.tools.build:gradle:3.2.1'
10+
}
11+
}
12+
13+
def getExtOrDefault(name) {
14+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['RNAsyncStorage_' + name]
15+
}
16+
17+
def getExtOrIntegerDefault(name) {
18+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['RNAsyncStorage_' + name]).toInteger()
19+
}
20+
21+
apply plugin: 'com.android.library'
22+
23+
android {
24+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
25+
buildToolsVersion getExtOrDefault('buildToolsVersion')
26+
27+
defaultConfig {
28+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
29+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
30+
}
31+
}
32+
33+
repositories {
34+
mavenCentral()
35+
}
36+
37+
dependencies {
38+
implementation 'com.facebook.react:react-native:+'
39+
}
40+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Automatically generated file. DO NOT MODIFY
3+
*/
4+
package com.reactnativecommunity.asyncstorage.test;
5+
6+
public final class BuildConfig {
7+
public static final boolean DEBUG = Boolean.parseBoolean("true");
8+
public static final String APPLICATION_ID = "com.reactnativecommunity.asyncstorage.test";
9+
public static final String BUILD_TYPE = "debug";
10+
public static final String FLAVOR = "";
11+
public static final int VERSION_CODE = -1;
12+
public static final String VERSION_NAME = "";
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Automatically generated file. DO NOT MODIFY
3+
*/
4+
package com.reactnativecommunity.asyncstorage;
5+
6+
public final class BuildConfig {
7+
public static final boolean DEBUG = Boolean.parseBoolean("true");
8+
public static final String APPLICATION_ID = "com.reactnativecommunity.asyncstorage";
9+
public static final String BUILD_TYPE = "debug";
10+
public static final String FLAVOR = "";
11+
public static final int VERSION_CODE = -1;
12+
public static final String VERSION_NAME = "";
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Automatically generated file. DO NOT MODIFY
3+
*/
4+
package com.reactnativecommunity.asyncstorage;
5+
6+
public final class BuildConfig {
7+
public static final boolean DEBUG = false;
8+
public static final String APPLICATION_ID = "com.reactnativecommunity.asyncstorage";
9+
public static final String BUILD_TYPE = "release";
10+
public static final String FLAVOR = "";
11+
public static final int VERSION_CODE = -1;
12+
public static final String VERSION_NAME = "";
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.reactnativecommunity.asyncstorage" >
4+
5+
<uses-sdk
6+
android:minSdkVersion="19"
7+
android:targetSdkVersion="28" />
8+
9+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":-1,"enabled":true,"outputFile":"@react-native-community_async-storage-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"com.reactnativecommunity.asyncstorage","split":""}}]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.reactnativecommunity.asyncstorage" >
4+
5+
<uses-sdk
6+
android:minSdkVersion="19"
7+
android:targetSdkVersion="28" />
8+
9+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":-1,"enabled":true,"outputFile":"@react-native-community_async-storage-release.aar","fullName":"release","baseName":"release"},"path":"AndroidManifest.xml","properties":{"packageId":"com.reactnativecommunity.asyncstorage","split":""}}]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

android/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt

Whitespace-only changes.

android/build/intermediates/annotations_typedef_file/release/extractReleaseAnnotations/typedefs.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)