├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ccj │ │ └── archdesigns │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ccj │ │ │ └── archdesigns │ │ │ ├── HttpMainActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── MyApplication.java │ │ │ └── bean │ │ │ ├── City.java │ │ │ ├── LoginRespense.java │ │ │ └── User.java │ └── res │ │ ├── layout │ │ ├── activity_main.xml │ │ └── activity_main_http.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── ccj │ └── archdesigns │ └── ExampleUnitTest.java ├── build.gradle ├── dbhelper ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── ccj │ │ └── dbhelper │ │ ├── BaseDaoFactory.java │ │ ├── ExceptionHander.java │ │ ├── TLog.java │ │ ├── annotion │ │ ├── DBFiled.java │ │ ├── DBPrimaryKey.java │ │ └── DBTable.java │ │ └── dao │ │ ├── BaseDao.java │ │ ├── CityDao.java │ │ ├── IBaseDao.java │ │ └── UserDao.java │ └── res │ └── values │ └── strings.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── nethelper ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ccj │ │ └── nethelper │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ccj │ │ │ └── nethelper │ │ │ ├── User.java │ │ │ └── helper │ │ │ ├── NetHelper.java │ │ │ ├── RequestHolder.java │ │ │ ├── RequestTask.java │ │ │ ├── ThreadPoolManager.java │ │ │ ├── interfaces │ │ │ ├── CallBackListener.java │ │ │ ├── IHttpListener.java │ │ │ └── IHttpService.java │ │ │ └── json │ │ │ ├── JsonDetailListener.java │ │ │ └── JsonRequestService.java │ └── res │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── ccj │ └── nethelper │ └── ExampleUnitTest.java ├── networkhelper ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ccj │ │ └── networkhelper │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ccj │ │ │ └── networkhelper │ │ │ ├── MainActivity.java │ │ │ └── MainActivityFragment.java │ └── res │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── content_main.xml │ │ └── fragment_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── ccj │ └── networkhelper │ └── ExampleUnitTest.java └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | #DBHelper 3 | #面向对象的SQLite框架 4 | 5 | --- 6 | 7 | #To Use 8 | 9 | ## 1.In Gradle 10 | 11 | ```gradle 12 | 13 | compile 'me.ccj.dbhelper:dbhelper:1.0.0' 14 | 15 | ``` 16 | ## 2.In Maven 17 | 18 | ```maven 19 | 20 | 21 | me.ccj.dbhelper 22 | dbhelper 23 | 1.0.0 24 | pom 25 | 26 | 27 | ``` 28 | 29 | 30 | --- 31 | 32 | 33 | 34 | #Geting Started 35 | 36 | ## 1.建立bean文件,配置注解 37 | ```java 38 | /** 39 | * Created by ccj on 2017/1/10. 40 | */ 41 | 42 | /** 43 | * Bean文件 用注解#{@DBTable},绑定表名, 44 | * 用#{@DBPrimaryKey},来设置自增长,主外键关系. 45 | * 其他,用属性名作为表属性 46 | */ 47 | @DBTable("tb_user") 48 | public class User { 49 | 50 | @DBPrimaryKey 51 | private Long id; 52 | 53 | public String name; 54 | 55 | public String password; 56 | 57 | public User(String name, String password) { 58 | this.name = name; 59 | this.password = password; 60 | } 61 | 62 | public User() { 63 | } 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "User{" + 69 | "id=" + id + 70 | ", name='" + name + '\'' + 71 | ", password='" + password + '\'' + 72 | '}'; 73 | } 74 | } 75 | /** 76 | create table if not exists tb_user ( id integer PRIMARY KEY autoincrement, name text, password text ); 77 | */ 78 | 79 | ``` 80 | 81 | ## 2.在`Application`初始化`BaseDaoFactory` 82 | 83 | ```java 84 | public class MyApplication extends Application{ 85 | 86 | 87 | private String databaseDir = Environment.getExternalStorageDirectory().getAbsolutePath()+"/database/"; 88 | private String databaseName = "design.db"; 89 | 90 | @Override 91 | public void onCreate() { 92 | super.onCreate(); 93 | 94 | 95 | BaseDaoFactory.init(databaseDir,databaseName); 96 | 97 | } 98 | } 99 | 100 | 101 | ``` 102 | 103 | ## 3.工厂调用 104 | 105 | ``` 106 | public class MainActivity extends AppCompatActivity { 107 | int index = 0; 108 | BaseDao cityDao; 109 | BaseDao userDao; 110 | 111 | @Override 112 | protected void onCreate(Bundle savedInstanceState) { 113 | super.onCreate(savedInstanceState); 114 | setContentView(R.layout.activity_main); 115 | //要保证初始化一次,避免重复新建对象 116 | userDao = BaseDaoFactory.getInstance().getDBDao(User.class); 117 | cityDao = BaseDaoFactory.getInstance().getDBDao(City.class); 118 | 119 | } 120 | 121 | /** 122 | * 保存城市 123 | * @param v 124 | */ 125 | public void saveCity(View v) { 126 | City city = new City("青岛" + (index++), "0200"); 127 | cityDao.insert(city); 128 | 129 | 130 | } 131 | 132 | /** 133 | * 保存用户 134 | * @param v 135 | */ 136 | public void saveUser(View v) { 137 | index++; 138 | User user = new User("ccj" + index, "123456"); 139 | TLog.error(user.toString()); 140 | userDao.insert(user); 141 | 142 | } 143 | 144 | /** 145 | * 更新用户 146 | * @param v 147 | */ 148 | public void updateUser(View v) { 149 | User old = new User(); 150 | old.name = "ccj1"; 151 | User news = new User("ccj1", "123"); 152 | userDao.update(old, news); 153 | 154 | } 155 | 156 | /** 157 | * 查询用户 158 | * @param v 159 | */ 160 | public void getUser(View v) { 161 | User user = new User(); 162 | List userList = userDao.query(user, null, null); 163 | for (Object user1 : userList) { 164 | TLog.error(user1.toString()); 165 | } 166 | } 167 | 168 | /** 169 | * 删除用户 170 | * @param v 171 | */ 172 | public void deleteUser(View v) { 173 | User user = new User(); 174 | userDao.delete(user); 175 | 176 | } 177 | 178 | } 179 | 180 | ``` 181 | 182 | 183 | 184 | 185 | 186 | 187 | --- 188 | #Thinking 189 | 190 | 1.**注解**`DBPrimaryKey`得到主外键关系,`DBTable`得到表名. 191 | 192 | 2.根据 上述两个注解修饰的`Bean`文件**建表**,没有注解修饰的属性,以小写的形式生成字段. 193 | 194 | 3.顺便在`步骤2`中,将`Bean`中`Field`的集合`fieldArray`,缓存到类`DBDao`中,方便后续调用. 195 | 196 | 3.在单例工厂`DBDaoFactory`, **反射**,实例化`DBDao`文件. 197 | 198 | 4.增删改查,根据对象拿到对象的Field,需要Field的值,就用` field.set(object, value)`拿到属性的值.作为搜索,或者添加条件. 199 | 200 | 5.查询,直接将数据通过`fieldArray`,对反射得到的对象,进行赋值. 201 | 202 | 203 | 204 | #优点: 205 | 一套机制,完成所有对象的操作. 206 | 207 | #缺点: 208 | 功能有限,后续将会扩展 209 | 210 | 211 | #liscense license 212 | 213 | 214 | 215 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 24 5 | buildToolsVersion "24.0.2" 6 | defaultConfig { 7 | applicationId "com.ccj.archdesigns" 8 | minSdkVersion 15 9 | targetSdkVersion 24 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:24.2.1' 28 | testCompile 'junit:junit:4.12' 29 | compile project(':dbhelper') 30 | compile project(':nethelper') 31 | } 32 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/ccj/archdesigns/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.ccj.archdesigns; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.ccj.archdesigns", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/ccj/archdesigns/HttpMainActivity.java: -------------------------------------------------------------------------------- 1 | package com.ccj.archdesigns; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.util.Log; 6 | import android.view.View; 7 | import android.widget.TextView; 8 | 9 | import com.ccj.archdesigns.bean.User; 10 | import com.ccj.archdesigns.bean.LoginRespense; 11 | import com.ccj.nethelper.helper.NetHelper; 12 | import com.ccj.nethelper.helper.interfaces.CallBackListener; 13 | 14 | 15 | public class HttpMainActivity extends AppCompatActivity { 16 | public static final String url="http://123.234.82.23/flyapp/Login.ashx/"; 17 | private static final String TAG = "HttpMainActivity"; 18 | TextView textView; 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | setContentView(R.layout.activity_main_http); 23 | 24 | } 25 | 26 | /** 27 | * 1 28 | * 2 29 | * @param view 30 | */ 31 | public void login(View view) 32 | { 33 | User user=new User(); 34 | user.name="13343491234"; 35 | user.password="123456"; 36 | for (int i=0;i<50;i++) 37 | { 38 | NetHelper.postJsonRequest( url,user, LoginRespense.class, new CallBackListener() { 39 | @Override 40 | public void onSuccess(LoginRespense loginRespense) { 41 | Log.i(TAG,loginRespense.toString()); 42 | } 43 | 44 | @Override 45 | public void onErro() { 46 | Log.i(TAG,"获取失败"); 47 | } 48 | }); 49 | } 50 | 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/ccj/archdesigns/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.ccj.archdesigns; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | 7 | import com.ccj.archdesigns.bean.City; 8 | import com.ccj.archdesigns.bean.User; 9 | import com.ccj.dbhelper.BaseDaoFactory; 10 | import com.ccj.dbhelper.TLog; 11 | import com.ccj.dbhelper.dao.BaseDao; 12 | 13 | import java.util.List; 14 | 15 | public class MainActivity extends AppCompatActivity { 16 | int index = 0; 17 | BaseDao cityDao; 18 | BaseDao userDao; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_main); 24 | //要保证初始化一次,避免重复新建对象 25 | userDao = BaseDaoFactory.getInstance().getDBDao(User.class); 26 | cityDao = BaseDaoFactory.getInstance().getDBDao(City.class); 27 | 28 | } 29 | 30 | /** 31 | * 保存城市 32 | * @param v 33 | */ 34 | public void saveCity(View v) { 35 | City city = new City("青岛" + (index++), "0200"); 36 | cityDao.insert(city); 37 | 38 | 39 | } 40 | 41 | /** 42 | * 保存用户 43 | * @param v 44 | */ 45 | public void saveUser(View v) { 46 | index++; 47 | User user = new User("ccj" + index, "123456"); 48 | TLog.error(user.toString()); 49 | userDao.insert(user); 50 | 51 | } 52 | 53 | /** 54 | * 更新用户 55 | * @param v 56 | */ 57 | public void updateUser(View v) { 58 | User old = new User(); 59 | old.name = "ccj1"; 60 | User news = new User("ccj1", "123"); 61 | userDao.update(old, news); 62 | 63 | } 64 | 65 | /** 66 | * 查询用户 67 | * @param v 68 | */ 69 | public void getUser(View v) { 70 | User user = new User(); 71 | List userList = userDao.query(user, null, null); 72 | for (Object user1 : userList) { 73 | TLog.error(user1.toString()); 74 | } 75 | } 76 | 77 | /** 78 | * 删除用户 79 | * @param v 80 | */ 81 | public void deleteUser(View v) { 82 | User user = new User(); 83 | userDao.delete(user); 84 | 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /app/src/main/java/com/ccj/archdesigns/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.ccj.archdesigns; 2 | 3 | import android.app.Application; 4 | import android.os.Environment; 5 | 6 | import com.ccj.dbhelper.BaseDaoFactory; 7 | 8 | 9 | /** 10 | * Created by ccj on 2017/1/13. 11 | */ 12 | 13 | public class MyApplication extends Application{ 14 | 15 | 16 | private String databaseDir = Environment.getExternalStorageDirectory().getAbsolutePath()+"/database/"; 17 | private String databaseName = "design.db"; 18 | 19 | @Override 20 | public void onCreate() { 21 | super.onCreate(); 22 | 23 | 24 | BaseDaoFactory.init(databaseDir,databaseName); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/ccj/archdesigns/bean/City.java: -------------------------------------------------------------------------------- 1 | package com.ccj.archdesigns.bean; 2 | 3 | 4 | import com.ccj.dbhelper.annotion.DBPrimaryKey; 5 | import com.ccj.dbhelper.annotion.DBTable; 6 | 7 | /** 8 | * Created by ccj on 2017/1/10. 9 | */ 10 | @DBTable("tb_city") 11 | public class City { 12 | 13 | public City( String name, String cityCode) { 14 | this.name = name; 15 | this.cityCode = cityCode; 16 | } 17 | 18 | @DBPrimaryKey 19 | private Long id; 20 | 21 | public String name; 22 | 23 | public String cityCode; 24 | 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/ccj/archdesigns/bean/LoginRespense.java: -------------------------------------------------------------------------------- 1 | package com.ccj.archdesigns.bean; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.reflect.TypeToken; 5 | 6 | import java.lang.reflect.Type; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Administrator on 2017/1/13 0013. 12 | */ 13 | public class LoginRespense 14 | { 15 | 16 | /** 17 | * code : 400 18 | * msg : 手机号或密码错误登录失败 19 | * result : {} 20 | */ 21 | 22 | public String code; 23 | public String msg; 24 | public ResultBean result; 25 | 26 | public static LoginRespense objectFromData(String str) { 27 | 28 | return new Gson().fromJson(str, LoginRespense.class); 29 | } 30 | 31 | public static List arrayLoginRespenseFromData(String str) { 32 | 33 | Type listType = new TypeToken>() { 34 | }.getType(); 35 | 36 | return new Gson().fromJson(str, listType); 37 | } 38 | 39 | public static class ResultBean { 40 | public static ResultBean objectFromData(String str) { 41 | 42 | return new Gson().fromJson(str, ResultBean.class); 43 | } 44 | 45 | public static List arrayResultBeanFromData(String str) { 46 | 47 | Type listType = new TypeToken>() { 48 | }.getType(); 49 | 50 | return new Gson().fromJson(str, listType); 51 | } 52 | } 53 | 54 | 55 | @Override 56 | public String toString() { 57 | return "LoginRespense{" + 58 | "code='" + code + '\'' + 59 | ", msg='" + msg + '\'' + 60 | ", result=" + result + 61 | '}'; 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/ccj/archdesigns/bean/User.java: -------------------------------------------------------------------------------- 1 | package com.ccj.archdesigns.bean; 2 | 3 | 4 | import com.ccj.dbhelper.annotion.DBPrimaryKey; 5 | import com.ccj.dbhelper.annotion.DBTable; 6 | 7 | /** 8 | * Created by ccj on 2017/1/10. 9 | */ 10 | 11 | /** 12 | * Bean文件 用注解#{@DBTable},绑定表名, 13 | * 用#{@DBPrimaryKey},来设置自增长,主外键关系. 14 | * 其他,用属性名作为表属性 15 | */ 16 | @DBTable("tb_user") 17 | public class User { 18 | 19 | @DBPrimaryKey 20 | private Long id; 21 | 22 | public String name; 23 | 24 | public String password; 25 | 26 | public User(String name, String password) { 27 | this.name = name; 28 | this.password = password; 29 | } 30 | 31 | public User() { 32 | } 33 | 34 | 35 | @Override 36 | public String toString() { 37 | return "User{" + 38 | "id=" + id + 39 | ", name='" + name + '\'' + 40 | ", password='" + password + '\'' + 41 | '}'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 17 |