Code Monkey home page Code Monkey logo

reactor's Introduction

Reactor

License API

Reactor is a fast and secure key-value library for Android, and has an embedded database based on the JSON structure and is a great alternative to Shared Preferences.

Features + Road map
First Edition 1.x.x
  • Save and restore a variety of objects (serialization and deserialization)
  • Symmetric encryption of objects (signed by target application at runtime + Hardware_ID)
  • Very high performance‍
  • Very low library size (No need for other libraries)
  • Supported and tested in API 15 and above
  • Minimal and easy to use :)
Second Edition 2.x.x
  • Save and restore all temporary object pool at runtime in RAM
  • Add a data branch (branches can be independent of the main branch)
  • Imports safe data from Shared Preferences to Reactor
  • ‍‍Change the underlying AES password generation
  • Change the storage infrastructure
  • ‍‍‍Add concurrency + thread-safe functionality

Donate BTC: 1HPZyUP9EJZi2S87QrvCDrE47qRV4i5Fze

Donate ETH or USDT: 0x4a4b0A26Eb31e9152653E4C08bCF10f04a0A02a9

Getting Started :

Add to your root build.gradle :Ï

allprojects {
  repositories {
      ...
      maven { url 'https://jitpack.io' }
    }
  }

Add the dependency :

dependencies {
    implementation 'com.github.aaaamirabbas:reactor:1.5.6'
}
Simple API (default) :

In Kotlin :

val reactor = Reactor(context)
val reactor = Reactor(context, false) // disable encryption

-----------------------------------------------------------

reactor.put("firstName", "abbas")
reactor.put("lastName", null)
reactor.put("age", 23)
reactor.put("customDataClass", SampleData())

-----------------------------------------------------------

val firstName = reactor.get<String>("firstName")
val lastName : String? = reactor.get("lastName")
val isDay = reactor.get<Boolean>("isDay", false)
val customDataClass = reactor.get("customDataClass")

-----------------------------------------------------------

reactor.remove<Int>("year", "week")
reactor.eraseAllData()

In Java :

Reactor reactor = new Reactor(getContext());
Reactor reactor = new Reactor(getContext(), false); // disable encryption

-----------------------------------------------------------

reactor.put("firstName", "abbas");
reactor.put("lastName", null);
reactor.put("age", 23);
reactor.put("customDataClass", new SampleData());

-----------------------------------------------------------

String firstName = reactor.get("firstName", "abbas");
String lastName = reactor.get("lastName", null);
Integer age = reactor.get("age", 26);
SampleData customDataClass = reactor.get("array");

-----------------------------------------------------------

reactor.remove("age", 0);
reactor.eraseAllData();
Custom data class Sample :
// definition
data class SampleData(
    val id: Int = 24,
    val name: String = "abbas"
) : ReactorContract

-----------------------------------------------------------

// save, restore, remove
reactor.put("simpleData", SampleData())
reactor.get<SampleData>("simpleData") // return null if is not found
reactor.remove<SampleData>("simpleData")
FAQ :
Need more help?
How to store and restore the custom class ?

reactor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

reactor's Issues

return null for class

reactor return null object when i use this code:

public UserModel getUserModel() {
	return reactor.get("UserModel", new UserModel());
}

public void updateUserModel(UserModel value) {
	reactor.put("UserModel", value);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.