An open API service indexing awesome lists of open source software.

https://github.com/pengmaster/commonmodule

一款公共Library库,封装设备验证,用户信息,Base类,公共Utils类
https://github.com/pengmaster/commonmodule

Last synced: 22 days ago
JSON representation

一款公共Library库,封装设备验证,用户信息,Base类,公共Utils类

Awesome Lists containing this project

README

          

公共库



Latest Stable Version


Build Status


Min Sdk Version


License



   开启旅程

- ## 功能简介
- 封装设备验证
- 封装用户信息
- 封装Base类
- 封装常用Utils类

- ## 使用方法
### 1.Add it in your root build.gradle
```java
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
### 2.Add it in your App build.gradle
```java
dependencies {
compile 'com.github.pengMaster:commonModule:v1.1'
}
```

### 3.App下AndroidManifest.xml中添加权限
```java




```

### 4.在App的Application下初始化
```java
InitApplicationContext.i().initContext(mAppContext);
```

- ## 功能

### 1.获取用户
```java
//----------------- 用户1 ---------------
User user1 = ConstantUtils.i().getUser1();
//----------------- 用户2 ---------------
User user2 = ConstantUtils.i().getUser2();
```

### 1.设备验证
```java
String baseUrl = "http://200.200.********/nhis/";
IsDeviceValid.i().isDeviceValid(baseUrl, LoginUtils.LoadMode.FORMAL,
MainActivity.this, new ValidCallBack() {
@Override
public void onSuccess(String serverUrl) {
//验证成功
LogUtils.debugInfo("onSuccess:"+serverUrl);
}

@Override
public void onError(String error) {
//验证失败
LogUtils.debugInfo("onError:"+error);
}
});
```

### 3.Base类以及Utils类直接调取使用


---------------------
注: [github地址:https://github.com/pengMaster/commonModule](https://github.com/pengMaster/commonModule)