ProperDroid


Source link: https://github.com/JcMinarro/ProperDroid

ProperDroid

ProperDroid is a gradle plugin plus an Android library that simplifies the way to config different variants on your project.

How ProperDroid stores

It gets information from your build.gradle file and writes it to a json file inside your assets folder. You can recover this information very easily later, on runtime.

Download and setup

Add these dependencies to your build.gradle:

buildscript {

  repositories {

jcenter()
  
}

  dependencies {

classpath 'com.android.tools.build:gradle:1.5.0'

classpath 'com.jcminarro:properdroid-plugin:0.1.0'
  
}
 
}
 apply plugin: 'com.jcminarro.properdroid'  properdroid {
  properdroidvalues = [  // ProperDroid Config  ] 
}
  dependencies {

  compile 'com.jcminarro:properdroid:0.1.0' 
}

Configure ProperDroid

ProperDroid works with the data located inside properdroid closure. properdroidvalues will have a list of different configurations and one by default, called default. You can use flavor name, build type name or variant name for the rest. Inside each configuration you can add as many key-value pairs as you want. Keep in mind that ProperDroid allows you to use the same key on different configurations and it will be overridden in the following order: default < flavor < buildType < variant

Here is an example with a String value to all variants and another that will be overridden only on release variants:

properdroid {
  properdroidvalues = [
default: [
 projectName: "ProperDRoid",
 endpoint: "http://endpoint.dev"
],
release: [
 endpoint: "http://endpoint.dev"
]  ] 
}

There is an example with more options here

Usage

To use ProperDroid inside your app you need to get an instance of ProperDroid and ask it for the desired key.

ProperDroid properdroid = ProperDroid.with(context);
 String projectName = properdroid.getString("projectName");
 String endpoint = properdroid.getString("endpoint");

If you use git as your vcs, you should ignore every configuration file generated by ProperDroid, adding this line to your .gitignore file

# Ignore all ProperDroid generated file into your vcs **/properdroid.json 

Do you want to contribute?

Feel free to add any useful feature to the library, we will be glad to improve it with your help. I'd love to hear about your use case too, especially if it's not covered perfectly.

License

Copyright 2015 Jc MiƱarro  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. 

Resources

Android Button that morphs into a loading progress bar.

  • Fully customizable in the XML
  • Really simple to use
  • Makes your app looks cooler

A rxJava2 + ViewPager banner view for android. Automatically starts playing images and stops when on touching.

Transform any object into an async object (can be useful for VIPER).

Rx binding for AltBeacon.

Detect device shake in background (if you want), specifying sensitivity, range, counts.

This library helps android developers to implement something like iOS key value observer pattern (KVO).

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes