README.md in PackingPeanut-1.0.0 vs README.md in PackingPeanut-1.1.0

- old
+ new

@@ -30,13 +30,13 @@ App::Persistence[:foo] = true # App::Persistence[:foo] would now return true ``` Whirlwind Tour via the REPL -``` +```ruby # ONLY ANDROID REQUIRES CONTEXT! -# Set the context (required in the REPL or when not including the module). +# See the section on Android context for more info $ App::Persistence.context = self => #<MainActivity:0x1d20058e> $ App::Persistence['dinner'] = "nachos" => "nachos" $ App::Persistence['dinner'] @@ -46,15 +46,23 @@ $ App::Persistence.all => {"dinner"=>"nachos", "lunch"=>"tacos"} $ App::Persistence.storage_file = "some_new_file" => "some_new_file" $ App::Persistence['dinner'] -=> "" # empty because we're now outside the default storage file. +=> nil # empty because we're now outside the default storage file. +``` +Friendly aliases: +```ruby # You can use PP instead of App::Persistence if you like $ PP['some_boolean'] = true +# You can use PackingPeanut (true name) if you like +$ PackingPeanut['so_easy'] = true +``` +Access deeper features: +```ruby # On Android you can set prefrence_modes for cross/app communication $ App::Persistence.preference_mode = :world_readable => :world_readable ``` @@ -82,9 +90,32 @@ ## Tests? * **iOS:** Yup! * **Android:** Boy that would be nice wouldn't it? + +## PackingPeanut Alongside Bubblewrap on iOS? +It's meant to look just like BubbleWrap, not fight with it. If you include the BubbleWrap library, PackingPeanut will gracefully bow out of the App::Persistence namespace. You can still access PackingPeanut with `PP` or `PackingPeanut`. + +## Explain this Android `context` _thing_ Again +Just like a conversation taken out of context can be confusing, Android has a lot of moving parts and requires just about EVERYTHING that would be a lib component to understand the context. When accessing persistent data, context is required. You can easily handle this by giving PackingPeanut your application context in your Application startup file. + +PackingPeanut Context Examples: +```ruby +# Providing Context - Regular +class MyApplication < Android::App::Application + def onCreate + PP.context = self + end +end + +# Providing Context with BluePotion +class MyApplication < PMApplication + def on_create + PP.context = self + end +end +``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`)