diff --git a/docs/assets/shared-preferences.png b/docs/assets/shared-preferences.png new file mode 100644 index 000000000..1a761de85 Binary files /dev/null and b/docs/assets/shared-preferences.png differ diff --git a/docs/shared-preferences-plugin.md b/docs/shared-preferences-plugin.md new file mode 100644 index 000000000..87e176607 --- /dev/null +++ b/docs/shared-preferences-plugin.md @@ -0,0 +1,25 @@ +--- +id: shared-preferences-plugin +title: Shared Preferences +--- + +Easily inspect and modify the data contained within your app's shared preferences. + +![Shared Preferences Plugin](/docs/assets/shared-preferences.png) + +## Setup + +Note: this plugin is only available for Android. + +### Android + +```java +import com.facebook.sonar.plugins.sharedpreferences.SharedPreferencesSonarPlugin; + +client.addPlugin( + new SharedPreferencesSonarPlugin(context, "my_shared_preference_file")); +``` + +## Usage + +All changes to the given shared preference file will automatically appear in Sonar. You may also edit the values in Sonar and have them synced to your device. This can be done by clicking on the value of the specific key you wish to edit, editing the value and then pressing enter. diff --git a/website/i18n/en.json b/website/i18n/en.json index b4c0cff11..737b24f1e 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -19,8 +19,10 @@ "layout-plugin": "Layout Inspector", "logs-plugin": "Logs", "network-plugin": "Network", + "sandbox-plugin": "Sandbox", "send-data": "Sending Data to Plugins", "Send Data": "Send Data", + "shared-preferences-plugin": "Shared Preferences", "stetho": "Stetho Guidance", "Stetho Guidance": "Stetho Guidance", "styling-components": "Styling Components", diff --git a/website/sidebars.json b/website/sidebars.json index ff30995d4..25f01961c 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -5,7 +5,8 @@ "logs-plugin", "layout-plugin", "network-plugin", - "sandbox-plugin" + "sandbox-plugin", + "shared-preferences-plugin" ], "Plugins: Desktop part": [ "js-setup",