Is there any fake data generator that works with Android? - android

What I'm looking for is some library like Perl's Data::Faker, Ruby's factory_girl. Something that allows me to generate random Strings, Dates, ... for testing.
I saw this other question. But I want something that has been used by someone with Android.

I tried java-faker, jFairy - they don't work on android.
So I find fluttercode.datafactory - it's ok for android.
Add following to your app build.gradle to use it:
compile 'org.fluttercode.datafactory:datafactory:0.8'
Usage example: http://java.dzone.com/articles/generate-test-data-datafactory

From the link that you gave, it seems that you are looking for Mock libraries that could be used in Android.
This article, written by some Google engineers, use PowerMock library to do their unit tests in Android. You might want to try it out and follow the steps in the article to have your test up and running.

I've recently developed a library that can be used for generating test data for your applications in a programatic way.
Take a look at MockNeat: https://github.com/nomemory/mockneat
There are also two detailed examples on the wiki page:
Creating CSV with test data
Populating a SQL Schema with test data

Related

How to use Dokka to generate Docs like Kotlinlang.org

AFAIK Kotlin's Documentation was made using Dokka. But the Examples stated in Dokka's Readme is only generating ultra basic webpages/markdown files with no elegance whatsoever.
It just looks like this
Here's another one by Atrium, docs link.
I'm wondering if I'm doing anything wrong.
I've also looked at the issues page and been browsing through other open source github projects that has used Dokka and the result is always the same.
Now a good example of how a tool that generates beautiful documentation would be Jazzy by Realm for Swift/Obj-C. Using it can be as easy as running one command on the terminal.
Here's an example documentation created using Jazzy
Further research with suggests that I may have to use third party tools like Gitbook or Jekyll to generate the kind of documentation I'm looking, is that really the only way?
Kotlinlang uses some custom styles for one of the dokka's output formats. Development on some better looking docs is underway

What is the Android Best approach to write logs after deployment?

I am working on android project and have to write a logging system that will record everything happening in the app during production.
What is the best way to do this? I was thinking about writing my own simple writeToFile class but then I see some people use Logging libraries.
There are a number of libraries to log the data. One of the most popular and simple library that i came across is "Hugo" developed by Jake Wharton. Its simple easy to use and flexible.
You can find the link to the library here https://github.com/JakeWharton/hugo

Android libGDX game highscore implementation with tutorial

I have found a great tutorial to implement highscores with mySQL connection.
http://www.ikergarcia.com/en/juego-android-highscores
I have tried to use code, created my SQL database, but Java part is problematic. There aren't included the necessary package imports. I couldn't know, how to determine necessary imports and so code is useless.
I recommend using google play services if you want to implement high score. This is the link. Tutorials are included
However, if you insist in using mySQL I had found some interesting material that may answer your question. I believe that you need to download something.
libgdx-database-extention &
web Service libgdx

Code injection for Android

I want to write an ORM for Android as my final project.
My first idea is to inject code for each get and set.
Unfortunately I found a lot of posts saying there is no way to inject code in Android.
On the other hand I found "Dexmaker" to generate code on runtime.
My question is: Is it possible to somehow inject code in Android (by "Dexmaker" or anything else)?
If not how to do it ?
I also thought about reflections but I am afraid that it will be to slow.
Thanks in advance.
Edit
Simon:
Yes by ORM I ment object relational mapping.
I want to create a general framework. How else I could do this than not by code injection ?
You can inject code using Dexmaker. The project site has a HelloWorldMaker example that generates a class and then loads it.
You may find the performance of runtime code generation to be unsatisfying however. Projects like Dagger have had better success metaprogramming with code generation.

Are there Android compatible alternatives to Property Utils?

Is there a handy-dandy equivalent to org.apache.commons.beanutils.PropertyUtils on Android?
I can't seem to use bean utils in my android app due to some dependencies on PropertyDescriptor,and IndexedPropertyDescriptor. So I'm wondering if there are any alternatives?
Basically all I want to do is use a method name as a string "someMethod" and feed that into setMethod(anObject, "someMethod", value), much like PropertyUtils does; but without having to resort to the nasties of reflection...
Or are my hands tied and I need to use Reflection?
There is bridge library which works on Android: android-java-air-bridge.jar. Just include into project path and use all apache beanutils features in your Android project as you could use in ordinary java application. Moreover, there are lot of other classes which moved to this Android supporting library. Look at the list.
There is a possibilty to use libraries or write own code depending on the PropertyUtils. But it sure isn't dandy. You can get the general idea about what has to be done in this thread.
There are apparently some projects who have successfully solved the issue, so you can study thier solution. Take a look at Drawingpad-base and libgdx. You can find PropertyUtils in the package com.madrobot.beans in the first project and com.badlogic.gdx.beans in the second.

Categories

Resources