项目作者: nichbar

项目描述 :
Generate your chinese name in Android.
高级语言: Java
项目地址: git://github.com/nichbar/YourName.git
创建时间: 2017-02-24T01:47:01Z
项目社区:https://github.com/nichbar/YourName

开源协议:GNU General Public License v3.0

下载


YourName

YourName is a Android library.

You can generate your own Chinese name with it.

Download

Add it in your root build.gradle at the end of repositories:

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }

Then add the dependency:

  1. dependencies {
  2. compile 'com.github.nichbar:YourName:v1.0'
  3. }

Usage

Generate a random Chinese name with three characters

Use generateName()

  1. YourName yourName = new YourName();
  2. Toast.makeText(this, yourName.generateName(), Toast.LENGTH_SHORT).show();

Generate a random Chinese name with custom length

Use generateName(int length)

  1. YourName yourName = new YourName();
  2. Toast.makeText(this, yourName.generateName(YourName.TWO_CHARACTER), Toast.LENGTH_SHORT).show();

Only family name

Use generateFamily(int length)

  1. YourName yourName = new YourName();
  2. Toast.makeText(this, yourName.generateFamily(YourName.ONE_CHARACTER), Toast.LENGTH_SHORT).show();

Only given name

Use generateGivenName(), only one character will return. You may call twice to get two characters.

  1. YourName yourName = new YourName();
  2. Toast.makeText(this, yourName.generateGivenName(), Toast.LENGTH_SHORT).show();

TODO

  • Generate names with FengShui option.

Thanks

chinese-random-name by XadillaX