Android-ConfigIO alternatives and similar packages
Based on the "Utility" category.
Alternatively, view Android-ConfigIO alternatives based on common mentions on social networks and blogs.
-
timber
A logger with a small, extensible API which provides utility on top of Android's normal Log class. -
ExpirableDiskLruCache
DISCONTINUED. Java implementation of a Disk-based LRU cache which specifically targets Android compatibility. -
Android-Templates-And-Utilities
Collection of source codes, utilities, templates and snippets for Android development. -
secure-preferences
DISCONTINUED. Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure. -
greenrobot-common
General purpose utilities and hash functions for Android and Java (aka java-common) -
Androl4b
A Virtual Machine For Assessing Android applications, Reverse Engineering and Malware Analysis -
vector-compat
A support library for VectorDrawable and AnimatedVectorDrawable classes introduced in Lollipop -
CastCompanionLibrary-android
DISCONTINUED. CastCompanionLibrary-android is a library project to enable developers integrate Cast capabilities into their applications faster and easier. -
motion
An Android library allowing images to exhibit a parallax effect that reacts to the device's tilt -
Colours
A beautiful set of predefined colors and a set of color methods to make your Android development life easier. -
Reservoir
DISCONTINUED. Android library to easily serialize and cache your objects to disk using key/value pairs.
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Android-ConfigIO or a related project?
README
Android-ConfigIO
A small and encapsulation library for creating, accessing, and modifying configuration file with Xml and Json format
Features
Read/Write configruation with json format
Read/Write configuration with xml format
Rx support
Usage
Binary / Import to your build.gradle
repositories {
maven {
url 'https://dl.bintray.com/tzutalin/maven'
}
}
dependencies {
compile 'com.tzutalin.configio:configio:1.0.3'
}
Use in code
If you would like to read and write in external storage, you need to decalre permissions in Manifest:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Sample
// Assign the target path
File sdcard = Environment.getExternalStorageDirectory();
String targetPath = sdcard.getAbsolutePath() + File.separator + "config.json";
// Instantiate ConfigIO
ConfigIO configIO = ConfigIO.newInstance(targetPath);
// === Write ===
ConfigIO.Writer writer = configIO.getWriter();
writer.putString("test_str", "12345678")
.putBoolean("test_bool", true)
.putInt("test_int", 10)
.putFloat("test_float", 0.5f)
.putLong("test_long", 100000000L);
// Blocking method. You can use writer.apply() to save it async
writer.commit();
// === Read ====
// It will load config from the file
configIO.loadFromFile();
String test_str = configIO.getString("test_str", "default_str");
boolean test_bool = configIO.getBoolean("test_bool", false);
int test_int = configIO.getInt("test_int", 0);
float test_float = configIO.getFloat("test_float", 0);
long test_long = configIO.getLong("test_long", 0);
Result: It will save to /sdcard/config.json
{
"test_str":"12345678",
"test_int":10,
"test_long":100000000,
"test_bool":true,
"test_float":0.5,
}
Rx support
String targetPath = sdcard.getAbsolutePath() + File.separator + "config.xml";
final ConfigIO configIO = ConfigIO.newInstance(targetPath);
// Using RxJava to subscribe on io thread
configIO.loadFromFileWithRx().subscribeOn(Schedulers.io()).subscribe(new Action1<Boolean>() {
@Override
public void call(Boolean isSuccess) {
String test_str = configIO.getString("test_str", "default_str");
boolean test_bool = configIO.getBoolean("test_bool", false);
int test_int = configIO.getInt("test_int", 0);
float test_float = configIO.getFloat("test_float", 0);
long test_long = configIO.getLong("test_long", 0);
}
});
For more example, you can check the sample code
LICNESE
Copyright 2016 Tzutalin
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.
*Note that all licence references and agreements mentioned in the Android-ConfigIO README section above
are relevant to that project's source code only.