Shared

A Simple Android SharedPreferences

License

License

GroupId

GroupId

com.devahoy
ArtifactId

ArtifactId

shared
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

Shared
A Simple Android SharedPreferences
Project URL

Project URL

https://github.com/devahoy/shared
Source Code Management

Source Code Management

https://github.com/devahoy/shared

Download shared

How to add to project

<!-- https://jarcasting.com/artifacts/com.devahoy/shared/ -->
<dependency>
    <groupId>com.devahoy</groupId>
    <artifactId>shared</artifactId>
    <version>0.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.devahoy/shared/
implementation 'com.devahoy:shared:0.0.1'
// https://jarcasting.com/artifacts/com.devahoy/shared/
implementation ("com.devahoy:shared:0.0.1")
'com.devahoy:shared:aar:0.0.1'
<dependency org="com.devahoy" name="shared" rev="0.0.1">
  <artifact name="shared" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.devahoy', module='shared', version='0.0.1')
)
libraryDependencies += "com.devahoy" % "shared" % "0.0.1"
[com.devahoy/shared "0.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Shared Build Status

Shared is a Simple Android SharedPreferences, annoyed when use SharedPreferences to save data. Why you must declare SharedPreference.Editor() and then save with apply() or commit() every time. This library is save your time.

Download

Download shared-0.0.1.jar and save to libs folder

or Gradle

dependencies {
    compile 'com.devahoy:shared:0.0.1'
}

Usage

// this : Context,
// name : String, a SharedPreferences file name.
Shared shared = new Shared(this, name);

// Save data
shared.save(key, value);

// Get data
shared.get(key, value);

// Remove data
shared.remove(key);

Example

Shared shared = new Shared(this, "MyData");

// Save data.
shared.save("name", "Hello Kitty");
shared.save("age", 40);
shared.save("isAlive", true);

// Get data.
String name = shared.getString("name", "n/a");
int age = shared.getInt("age", 0);
boolean isAlive = shared.getBoolean("isAlive", false);

// Delete data.
shared.remove("name");
shared.remove("age");
shared.remove("isAlive");

License

Copyright 2014 DevAhoy

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
com.devahoy

Devahoy Studios

Devahoy Playground & Experiment

Versions

Version
0.0.1