# limitations under the License.
# Refines shared_preferences module to add API 11 services
-module shared_preferences_api11
+module shared_preferences_api11 is min_api_version(11)
import shared_preferences
in "Java" `{
import java.util.HashSet;
import java.util.Set;
+ import android.content.Context;
`}
redef extern class NativeSharedPreferences
end
# File access mode
- private fun multi_process_mode: Int in "Java" `{ return Content.MODE_MULTI_PROCESS; `}
+ private fun multi_process_mode: Int in "Java" `{ return Context.MODE_MULTI_PROCESS; `}
# Returns the `HashSet[JavaString]` value corresponding the given key or `null` if none
#
# User has to manage local stack deallocation himself
#
- # Example :
- # ~~~
- # var a_hash_set = shared_preferences.string_set("A key")
- # ...
+ # ~~~nitish
+ # var a_hash_set = app.shared_preferences.string_set("A key")
+ # # ...
# for element in a_hash_set do element.delete_local_ref
# ~~~
fun string_set(key: String): HashSet[JavaString]
#
# User has to manage local stack deallocation himself
#
- # Example :
- # ~~~
+ # ~~~nitish
# var foo = new HashSet[JavaString]
- # shared_preferences.add_string_set("A key", foo)
+ # app.shared_preferences.add_string_set("A key", foo)
# for element in foo do element.delete_local_ref
# ~~~
fun add_string_set(key: String, value: HashSet[JavaString]): SharedPreferences