Faker


Source link: https://github.com/thiagokimo/Faker

Faker

Faker provides fake data to your Android MPVs. Now it's very handy to make screenshots of your apps without worrying with Google Play copyright infringments, e.g this app. Faker helps you to populate your views with random data quickly and painlessly.

##Screenshots

##Demo The sample application (the source is in the app folder) has been published on Google Play to facilitate the access:

The demo app has a very clean MVP architecture based in the idea of this post. Feel free to give me suggestions.

##Setup

Gradle:

Add the JitPack repository to your build file:

repositories {

  maven {

url "https://jitpack.io"  
}
 
}

Add the dependency in the form:

dependencies {

  compile 'com.github.thiagokimo:faker:VERSION' 
}

Maven:

If you use Maven, add this into your build file:

<repository>
  <id>jitpack.io</id>  <url>https://jitpack.io</url> </repository>
<dependency>
  <groupId>com.github.thiagokimo</groupId>
  <artifactId>faker</artifactId>
  <version>VERSION</version> </dependency>

##Usage

###The "lazy" way

Faker.with(context)

 .fill(rootView);

Faker will figure out all views inside the one you passed to it and fill it with proper data. Just like that!

By default faker will fill TextViews with lorem ipsum, ImageViews with a random color, CompoundButtons with a random state (check or uncheck) and ProgressBars with a random progress value.

###The specific way

Faker.with(context)

 .NameOfTheComponent

 .componentMethod();

###Targeting views

If you want Faker to fill specific views inside your ViewGroup you can pass your target views like the example below

Faker.with(context)

 .targetViews(collection-of-ids)

 .fill(rootView);

Check out all examples here.

##Components

Faker is organized in components that provides you specific types of data. Here is a list of the current components:

  • Lorem - The old good lorem ispum words, sentences and paragraphs.
  • Name - Firsts, lasts, full and complete names and profession/titles.
  • Number - It gives you numbers ¬¬
  • Phone - Phone masks \o/
  • Internet - It provides you random emails and domains.
  • Url - Gives you (valid) urls that you might use somewhere.
  • Color - Generates attractive colors thanks to lzyzsd!
  • Address - Gives random cities, countries, zipcodes, states and so on.

##Contribuiting

  1. Fork it
  2. Create your feature/bug-fix branch( git checkout -b my-new-feature-or-fix)
  3. Commit your changes ( git commit -am 'Add some feature/fix')
  4. Do your pull-request

Make sure you write tests for your code. Only code with passing tests will be accepted.

###Components

You can add more components or improve the existing ones. For new components, make sure you also add an example in the demo app.

###Localization You can help providing localized data to Faker components.

##License

Copyright 2011, 2012 Thiago Rocha  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 Studio / Eclipse ADT template for including icon resources from Material Design icons by Google in your project.

An Android application to analyse your notification history. It shows the number of received notifications during the day and the distribution across each application. An overview per day, week or month is available.

This application is available in the Google Play Store.

Best practices in Android development - lessons learned from Android developers in Futurice. Avoid reinventing the wheel by following these guidelines.

L Camera is an open-source experimental camera app for Android L devices using the new android.hardware.camera2 API.

Please note that this app is intended to test and study new features of the camera API, it is not for general uses as it lacks many basic camera features (location tagging, white balance, photo review, flash control, etc).

VTD-XML is the next generation XML parser / indexer/ editor / slicer / assembler / xpath-engine that goes beyond DOM, SAX and PULL in performance, memory usage, and ease of use.

android-parallax-recyclerview is an adapter which could be used to achive a parallax effect on RecyclerView.

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