first commit

master
unknown 6 years ago
parent af18e75a6b
commit 16eb323fa1

@ -1,5 +1,29 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
@ -25,5 +49,29 @@
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
</code_scheme>
</component>

@ -0,0 +1,453 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DataExportManager">
<export-instructions>
<create-header value="true" />
<quote-values-containing-separator value="true" />
<quote-all-values value="false" />
<value-separator value="" />
<file-name value="" />
<file-location value="" />
<scope value="GLOBAL" />
<destination value="FILE" />
<format value="EXCEL" />
<charset value="GBK" />
</export-instructions>
</component>
<component name="DBNavigator.Project.DatabaseBrowserManager">
<autoscroll-to-editor value="false" />
<autoscroll-from-editor value="true" />
<show-object-properties value="true" />
<loaded-nodes />
</component>
<component name="DBNavigator.Project.EditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.MethodExecutionManager">
<method-browser />
<execution-history>
<group-entries value="true" />
<execution-inputs />
</execution-history>
<argument-values-cache />
</component>
<component name="DBNavigator.Project.ObjectDependencyManager">
<last-used-dependency-type value="INCOMING" />
</component>
<component name="DBNavigator.Project.ObjectQuickFilterManager">
<last-used-operator value="EQUAL" />
<filters />
</component>
<component name="DBNavigator.Project.ScriptExecutionManager" clear-outputs="true">
<recently-used-interfaces />
</component>
<component name="DBNavigator.Project.Settings">
<connections />
<browser-settings>
<general>
<display-mode value="TABBED" />
<navigation-history-size value="100" />
<show-object-details value="false" />
</general>
<filters>
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</filters>
<sorting>
<object-type name="COLUMN" sorting-type="NAME" />
<object-type name="FUNCTION" sorting-type="NAME" />
<object-type name="PROCEDURE" sorting-type="NAME" />
<object-type name="ARGUMENT" sorting-type="POSITION" />
</sorting>
<default-editors>
<object-type name="VIEW" editor-type="SELECTION" />
<object-type name="PACKAGE" editor-type="SELECTION" />
<object-type name="TYPE" editor-type="SELECTION" />
</default-editors>
</browser-settings>
<navigation-settings>
<lookup-filters>
<lookup-objects>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="false" />
<object-type name="ROLE" enabled="false" />
<object-type name="PRIVILEGE" enabled="false" />
<object-type name="CHARSET" enabled="false" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED VIEW" enabled="true" />
<object-type name="NESTED TABLE" enabled="false" />
<object-type name="COLUMN" enabled="false" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET TRIGGER" enabled="true" />
<object-type name="DATABASE TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="false" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE ATTRIBUTE" enabled="false" />
<object-type name="ARGUMENT" enabled="false" />
<object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="true" />
</lookup-objects>
<force-database-load value="false" />
<prompt-connection-selection value="true" />
<prompt-schema-selection value="true" />
</lookup-filters>
</navigation-settings>
<dataset-grid-settings>
<general>
<enable-zooming value="true" />
<enable-column-tooltip value="true" />
</general>
<sorting>
<nulls-first value="true" />
<max-sorting-columns value="4" />
</sorting>
<tracking-columns>
<columnNames value="" />
<visible value="true" />
<editable value="false" />
</tracking-columns>
</dataset-grid-settings>
<dataset-editor-settings>
<text-editor-popup>
<active value="false" />
<active-if-empty value="false" />
<data-length-threshold value="100" />
<popup-delay value="1000" />
</text-editor-popup>
<values-list-popup>
<show-popup-button value="true" />
<element-count-threshold value="1000" />
<data-length-threshold value="250" />
</values-list-popup>
<general>
<fetch-block-size value="100" />
<fetch-timeout value="30" />
<trim-whitespaces value="true" />
<convert-empty-strings-to-null value="true" />
<select-content-on-cell-edit value="true" />
<large-value-preview-active value="true" />
</general>
<filters>
<prompt-filter-dialog value="true" />
<default-filter-type value="BASIC" />
</filters>
<qualified-text-editor text-length-threshold="300">
<content-types>
<content-type name="Text" enabled="true" />
<content-type name="Properties" enabled="true" />
<content-type name="XML" enabled="true" />
<content-type name="DTD" enabled="true" />
<content-type name="HTML" enabled="true" />
<content-type name="XHTML" enabled="true" />
<content-type name="Java" enabled="true" />
<content-type name="SQL" enabled="true" />
<content-type name="PL/SQL" enabled="true" />
<content-type name="Groovy" enabled="true" />
<content-type name="AIDL" enabled="true" />
<content-type name="YAML" enabled="true" />
<content-type name="Manifest" enabled="true" />
</content-types>
</qualified-text-editor>
<record-navigation>
<navigation-target value="VIEWER" />
</record-navigation>
</dataset-editor-settings>
<code-editor-settings>
<general>
<show-object-navigation-gutter value="false" />
<show-spec-declaration-navigation-gutter value="true" />
<enable-spellchecking value="true" />
<enable-reference-spellchecking value="false" />
</general>
<confirmations>
<save-changes value="false" />
<revert-changes value="true" />
</confirmations>
</code-editor-settings>
<code-completion-settings>
<filters>
<basic-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="false" />
<filter-element type="OBJECT" id="view" selected="false" />
<filter-element type="OBJECT" id="materialized view" selected="false" />
<filter-element type="OBJECT" id="index" selected="false" />
<filter-element type="OBJECT" id="constraint" selected="false" />
<filter-element type="OBJECT" id="trigger" selected="false" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="false" />
<filter-element type="OBJECT" id="procedure" selected="false" />
<filter-element type="OBJECT" id="function" selected="false" />
<filter-element type="OBJECT" id="package" selected="false" />
<filter-element type="OBJECT" id="type" selected="false" />
<filter-element type="OBJECT" id="dimension" selected="false" />
<filter-element type="OBJECT" id="cluster" selected="false" />
<filter-element type="OBJECT" id="dblink" selected="false" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</basic-filter>
<extended-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</extended-filter>
</filters>
<sorting enabled="true">
<sorting-element type="RESERVED_WORD" id="keyword" />
<sorting-element type="RESERVED_WORD" id="datatype" />
<sorting-element type="OBJECT" id="column" />
<sorting-element type="OBJECT" id="table" />
<sorting-element type="OBJECT" id="view" />
<sorting-element type="OBJECT" id="materialized view" />
<sorting-element type="OBJECT" id="index" />
<sorting-element type="OBJECT" id="constraint" />
<sorting-element type="OBJECT" id="trigger" />
<sorting-element type="OBJECT" id="synonym" />
<sorting-element type="OBJECT" id="sequence" />
<sorting-element type="OBJECT" id="procedure" />
<sorting-element type="OBJECT" id="function" />
<sorting-element type="OBJECT" id="package" />
<sorting-element type="OBJECT" id="type" />
<sorting-element type="OBJECT" id="dimension" />
<sorting-element type="OBJECT" id="cluster" />
<sorting-element type="OBJECT" id="dblink" />
<sorting-element type="OBJECT" id="schema" />
<sorting-element type="OBJECT" id="role" />
<sorting-element type="OBJECT" id="user" />
<sorting-element type="RESERVED_WORD" id="function" />
<sorting-element type="RESERVED_WORD" id="parameter" />
</sorting>
<format>
<enforce-code-style-case value="true" />
</format>
</code-completion-settings>
<execution-engine-settings>
<statement-execution>
<fetch-block-size value="100" />
<execution-timeout value="20" />
<debug-execution-timeout value="600" />
<focus-result value="false" />
<prompt-execution value="false" />
</statement-execution>
<script-execution>
<command-line-interfaces />
<execution-timeout value="300" />
</script-execution>
<method-execution>
<execution-timeout value="30" />
<debug-execution-timeout value="600" />
<parameter-history-size value="10" />
</method-execution>
</execution-engine-settings>
<operation-settings>
<transactions>
<uncommitted-changes>
<on-project-close value="ASK" />
<on-disconnect value="ASK" />
<on-autocommit-toggle value="ASK" />
</uncommitted-changes>
<multiple-uncommitted-changes>
<on-commit value="ASK" />
<on-rollback value="ASK" />
</multiple-uncommitted-changes>
</transactions>
<session-browser>
<disconnect-session value="ASK" />
<kill-session value="ASK" />
<reload-on-filter-change value="false" />
</session-browser>
<compiler>
<compile-type value="KEEP" />
<compile-dependencies value="ASK" />
<always-show-controls value="false" />
</compiler>
<debugger>
<debugger-type value="ASK" />
<use-generic-runners value="true" />
</debugger>
</operation-settings>
<ddl-file-settings>
<extensions>
<mapping file-type-id="VIEW" extensions="vw" />
<mapping file-type-id="TRIGGER" extensions="trg" />
<mapping file-type-id="PROCEDURE" extensions="prc" />
<mapping file-type-id="FUNCTION" extensions="fnc" />
<mapping file-type-id="PACKAGE" extensions="pkg" />
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
<mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
</extensions>
<general>
<lookup-ddl-files value="true" />
<create-ddl-files value="false" />
<synchronize-ddl-files value="true" />
<use-qualified-names value="false" />
<make-scripts-rerunnable value="true" />
</general>
</ddl-file-settings>
<general-settings>
<regional-settings>
<date-format value="MEDIUM" />
<number-format value="UNGROUPED" />
<locale value="SYSTEM_DEFAULT" />
<use-custom-formats value="false" />
</regional-settings>
<environment>
<environment-types>
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
</environment-types>
<visibility-settings>
<connection-tabs value="true" />
<dialog-headers value="true" />
<object-editor-tabs value="true" />
<script-editor-tabs value="false" />
<execution-result-tabs value="true" />
</visibility-settings>
</environment>
</general-settings>
</component>
<component name="DBNavigator.Project.StatementExecutionManager">
<execution-variables />
</component>
</project>

@ -27,4 +27,5 @@ dependencies {
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
}

@ -2,7 +2,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.cici.voice" >
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:name="com.mob.MobApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@ -18,6 +29,18 @@
</activity>
<activity android:name="com.example.cici.voice.RegistActivity" ></activity>
<activity android:name="com.example.cici.voice.ResPwdActivity" ></activity>
<activity
android:name="com.mob.tools.MobUIShell"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="stateHidden|adjustResize"/>
<meta-data android:name="Mob-AppKey" android:value="299f659dde262"/>
<meta-data android:name="Mob-AppSecret" android:value="3f4a4fc6406f4c97746cc972fec5785a"/>
</application>
</manifest>

@ -5,22 +5,25 @@ import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.Cursor;
import java.util.ArrayList;
public class DBOpenHelper extends SQLiteOpenHelper {
public DBOpenHelper(Context context,String name, CursorFactory factory,
int version) {
super(context, name, factory, version);
private SQLiteDatabase db;
public DBOpenHelper(Context context) {
super(context, "voice", null, 1);
db=getReadableDatabase();
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table if not exists user_tb(_id integer primary key autoincrement," +
"userID text not null," +
"pwd text not null," +
"name text not null," +
"birthday text not null," +
"sex text not null," +
"phonenum text not null," +
"headpic text not null)");
"name text ," +
"birthday text ," +
"sex text ," +
"headpic text )");
db.execSQL("create table if not exists voice_tb(_id integer primary key autoincrement," +
"voiceID text not null," +
"voicecontent text not null,"+
@ -34,8 +37,13 @@ public class DBOpenHelper extends SQLiteOpenHelper {
}
@Override
public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
db.execSQL("DROP TABLE IF EXISTS user_tb");
db.execSQL("DROP TABLE IF EXISTS voice_tb");
db.execSQL("DROP TABLE IF EXISTS publish_tb");
onCreate(db);
}
// public ArrayList<>
}

@ -0,0 +1,29 @@
package com.example.cici.util;
import android.os.CountDownTimer;
import android.widget.Button;
public class TimeCountUtil extends CountDownTimer {
private Button mButton;
public TimeCountUtil(Button button, long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
this.mButton = button;
}
@Override
public void onTick(long millisUntilFinished) {
// 按钮不可用
mButton.setEnabled(false);
String showText = millisUntilFinished / 1000 + "秒后可重新发送";
mButton.setText(showText);
}
@Override
public void onFinish() {
// 按钮设置可用
mButton.setEnabled(true);
mButton.setText("重新获取验证码");
}
}

@ -36,16 +36,16 @@ public class LoginActivity extends AppCompatActivity {
}
//call DBOpenHelper
DBOpenHelper helper = new DBOpenHelper(this,"voice.db",null,1);
DBOpenHelper helper = new DBOpenHelper(this);
SQLiteDatabase db = helper.getWritableDatabase();
Cursor c = db.query("user_tb",null,"userID=? and pwd=?",new String[]{editPhone.getText().toString(),editPwd.getText().toString()},null,null,null);
if(c!=null && c.getCount() >= 1){
String[] cols = c.getColumnNames();
while(c.moveToNext()){
/* while(c.moveToNext()){
for(String ColumnName:cols){
Log.i("info",ColumnName+":"+c.getString(c.getColumnIndex(ColumnName)));
}
}
}*/
c.close();
db.close();

@ -1,72 +1,271 @@
package com.example.cici.voice;
import java.util.Calendar;
import android.app.Activity;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;
import android.util.Log;
import android.widget.DatePicker;
import android.app.DatePickerDialog;
import android.app.DatePickerDialog.OnDateSetListener;
import com.example.cici.dao.DBOpenHelper;
import com.example.cici.util.pubFun;
import com.example.cici.util.TimeCountUtil;
import cn.smssdk.EventHandler;
import cn.smssdk.SMSSDK;
public class RegistActivity extends AppCompatActivity {
private EditText editPhone;
public class RegistActivity extends AppCompatActivity implements View.OnClickListener {
private EditText edit_phone;
private EditText edit_cord;
private EditText editPwd;
private Button btnRegist;
protected void onCreate(Bundle savedInstanceState){
private EditText editName;
private TextView now;
private Button btn_getCord;
private Button btn_register;
private RadioButton mMaleRb;
private RadioButton mFamaleRb;
private String phone_number;
private String cord_number;
EventHandler eventHandler;
private TimeCountUtil mTimeCountUtil;
private int time=60;
private boolean flag=true;
private TextView tvShowDialog;
private Calendar cal;
private int year,month,day;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.regist);
editPhone = (EditText) findViewById(R.id.editPhone);
editPwd = (EditText) findViewById(R.id.editPwd);
btnRegist = (Button) findViewById(R.id.btnRegist);
getDate();
getId();
mTimeCountUtil = new TimeCountUtil(btn_getCord, 10000, 1000);
eventHandler = new EventHandler() {
public void afterEvent(int event, int result, Object data) {
Message msg=new Message();
msg.arg1=event;
msg.arg2=result;
msg.obj=data;
handler.sendMessage(msg);
}
};
SMSSDK.registerEventHandler(eventHandler);
}
private void getDate() {
cal=Calendar.getInstance();
year=cal.get(Calendar.YEAR); //获取年月日时分秒
Log.i("wxy","year"+year);
month=cal.get(Calendar.MONTH); //获取到的月份是从0开始计数
day=cal.get(Calendar.DAY_OF_MONTH);
}
@Override
protected void onDestroy() {
super.onDestroy();
SMSSDK.unregisterEventHandler(eventHandler);
}
/**
* register event
* @param v
* 使HandlerMessage线
*/
public void OnMyRegistClick(View v)
Handler handler=new Handler()
{
boolean isTrue = true;
if(pubFun.isPhoneNumberValid(editPhone.getText().toString()) == false){
isTrue = false;
Toast.makeText(this, "手机号格式不正确!", Toast.LENGTH_SHORT).show();
return;
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
int event=msg.arg1;
int result=msg.arg2;
Object data=msg.obj;
if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
if(result == SMSSDK.RESULT_COMPLETE) {
boolean smart = (Boolean)data;
if(smart) {
Toast.makeText(getApplicationContext(),"该手机号已经注册过,请重新输入",
Toast.LENGTH_LONG).show();
edit_phone.requestFocus();
return;
}
}
}
if(result==SMSSDK.RESULT_COMPLETE)
{
if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
Toast.makeText(getApplicationContext(), "验证码输入正确",
Toast.LENGTH_LONG).show();
}
}
else
{
if(flag)
{
btn_getCord.setVisibility(View.VISIBLE);
Toast.makeText(getApplicationContext(),"验证码获取失败请重新获取", Toast.LENGTH_LONG).show();
edit_phone.requestFocus();
}
else
{
Toast.makeText(getApplicationContext(),"验证码输入错误", Toast.LENGTH_LONG).show();
}
}
}
if(pubFun.isEmpty(editPwd.getText().toString())){
isTrue = false;
Toast.makeText(this, "密码不能为空!", Toast.LENGTH_SHORT).show();
return;
};
/**
* id
*/
private void getId()
{
edit_phone=findViewById(R.id.editPhone);
edit_cord=findViewById(R.id.editCode);
btn_getCord=findViewById(R.id.btnGetcord);
btn_register=findViewById(R.id.btnRegist);
editPwd = (EditText) findViewById(R.id.editPwd);
editName=findViewById(R.id.editName);
mMaleRb = (RadioButton)findViewById(R.id.male);
mFamaleRb = (RadioButton)findViewById(R.id.famle);
tvShowDialog=(TextView) findViewById(R.id.tvShowDialog);
tvShowDialog.setOnClickListener(this);
btn_getCord.setOnClickListener(this);
btn_register.setOnClickListener(this);
}
/**
*
*/
public void onClick(View v)
{
switch (v.getId())
{
case R.id.btnGetcord:
if(judPhone())//去掉左右空格获取字符串
{
mTimeCountUtil.start();
SMSSDK.getVerificationCode("86",phone_number);
edit_cord.requestFocus();
}
break;
case R.id.btnRegist:
if(judCord())
SMSSDK.submitVerificationCode("86",phone_number,cord_number);
DBOpenHelper helper = new DBOpenHelper(this);
SQLiteDatabase db = helper.getWritableDatabase();
Cursor c = db.query("user_tb",null,"userID=?",new String[]{edit_phone.getText().toString()},null,null,null);
if(c!=null && c.getCount() >= 1){
Toast.makeText(this, "该用户已存在", Toast.LENGTH_SHORT).show();
c.close();
}
else{
//insert data
ContentValues values= new ContentValues();
values.put("userID",edit_phone.getText().toString());
values.put("pwd",editPwd.getText().toString());
values.put("name",editName.getText().toString());
values.put("birthday",tvShowDialog.getText().toString());
if(mMaleRb.isChecked()){
values.put("sex",mMaleRb.getText().toString());
}
else values.put("sex",mFamaleRb.getText().toString());
long rowid = db.insert("user_tb",null,values);
Toast.makeText(this, "注册成功", Toast.LENGTH_SHORT).show();
this.finish();
}
db.close();
flag=false;
break;
case R.id.tvShowDialog:
OnDateSetListener listener=new OnDateSetListener() {
@Override
public void onDateSet(DatePicker arg0, int year, int month, int day) {
tvShowDialog.setText(year+"-"+(++month)+"-"+day); //将选择的日期显示到TextView中,因为之前获取month直接使用所以不需要+1这个地方需要显示所以+1
}
};
DatePickerDialog dialog=new DatePickerDialog(RegistActivity.this, 0,listener,year,month,day);//后边三个参数为显示dialog时默认的日期月份从0开始0-11对应1-12个月
dialog.show();
break;
default:
break;
}
}
if(isTrue = true){
//call DBOpenHelper
DBOpenHelper helper = new DBOpenHelper(this,".db",null,1);
SQLiteDatabase db = helper.getWritableDatabase();
Cursor c = db.query("user_tb",null,"userID=?",new String[]{editPhone.getText().toString()},null,null,null);
if(c!=null && c.getCount() >= 1){
Toast.makeText(this, "该用户已存在", Toast.LENGTH_SHORT).show();
c.close();
}
else{
//insert data
ContentValues values= new ContentValues();
values.put("userID",editPhone.getText().toString());
values.put("pwd",editPwd.getText().toString());
long rowid = db.insert("user_tb",null,values);
Toast.makeText(this, "注册成功", Toast.LENGTH_SHORT).show();
this.finish();
private boolean judPhone()
{
if(TextUtils.isEmpty(edit_phone.getText().toString().trim()))
{
Toast.makeText(RegistActivity.this,"请输入您的电话号码",Toast.LENGTH_LONG).show();
edit_phone.requestFocus();
return false;
}
else if(edit_phone.getText().toString().trim().length()!=11)
{
Toast.makeText(RegistActivity.this,"您的电话号码位数不正确",Toast.LENGTH_LONG).show();
edit_phone.requestFocus();
return false;
}
else
{
phone_number=edit_phone.getText().toString().trim();
String num="[1][358]\\d{9}";
if(phone_number.matches(num))
return true;
else
{
Toast.makeText(RegistActivity.this,"请输入正确的手机号码",Toast.LENGTH_LONG).show();
return false;
}
db.close();
}else{
return;
}
}
}
private boolean judCord()
{
judPhone();
if(TextUtils.isEmpty(edit_cord.getText().toString().trim()))
{
Toast.makeText(RegistActivity.this,"请输入您的验证码",Toast.LENGTH_LONG).show();
edit_cord.requestFocus();
return false;
}
else if(edit_cord.getText().toString().trim().length()!=4)
{
Toast.makeText(RegistActivity.this,"您的验证码位数不正确",Toast.LENGTH_LONG).show();
edit_cord.requestFocus();
return false;
}
else
{
cord_number=edit_cord.getText().toString().trim();
return true;
}
}
}

@ -53,7 +53,7 @@ public class ResPwdActivity extends AppCompatActivity {
}
//调用DBOpenHelper
DBOpenHelper helper = new DBOpenHelper(this,"voice.db",null,1);
DBOpenHelper helper = new DBOpenHelper(this);
SQLiteDatabase db = helper.getWritableDatabase();
Cursor c = db.query("user_tb",null,"userID=?",new String[]{editPhone.getText().toString()},null,null,null);
if(c!=null && c.getCount() >= 1){

@ -1,69 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
style="@style/textstyle"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:gravity="center"
android:text="@string/regist"
android:textColor="#ffff"
android:textSize="24sp"
app:layout_constraintBottom_toTopOf="@+id/editPhone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="MissingConstraints" />
<!-- input phone -->
<EditText
android:id="@+id/editPhone"
style="@style/textstyle"
android:layout_width="fill_parent"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:hint="手机号"
android:inputType="number"
android:lines="1"
android:maxLength="11"
android:singleLine="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteY="144dp" />
<!-- input password -->
<EditText
android:id="@+id/editPwd"
style="@style/textstyle"
android:layout_width="fill_parent"
android:layout_marginStart="8dp"
android:layout_marginTop="48dp"
android:layout_marginEnd="8dp"
android:hint="密码"
android:lines="1"
android:maxLength="16"
android:password="true"
android:singleLine="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editPhone"
tools:ignore="MissingConstraints" />
<!-- the regist button -->
<Button
android:id="@+id/btnRegist"
style="@style/textstyle"
android:layout_width="fill_parent"
android:layout_marginStart="8dp"
android:layout_marginTop="44dp"
android:layout_marginEnd="8dp"
android:onClick="OnMyRegistClick"
android:text="@string/regist"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editPwd"
tools:ignore="MissingConstraints" />
android:layout_height="match_parent"
tools:layout_editor_absoluteY="81dp">
<TextView
android:id="@+id/tvShowDialog"
android:layout_width="173dp"
android:layout_height="33dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:gravity="center"
android:text="出生年月日"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.503"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editPwd" />
<EditText
android:id="@+id/editPhone"
style="@style/textstyle"
android:layout_width="fill_parent"
android:layout_marginTop="8dp"
android:hint="手机号"
android:inputType="number"
android:lines="1"
android:maxLength="11"
android:singleLine="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.454"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tableRow"
tools:ignore="MissingConstraints" />
<!-- input password -->
<EditText
android:id="@+id/editPwd"
style="@style/textstyle"
android:layout_width="fill_parent"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:hint="密码"
android:lines="1"
android:maxLength="16"
android:password="true"
android:singleLine="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editName"
tools:ignore="MissingConstraints" />
<!-- the regist button -->
<Button
android:id="@+id/btnRegist"
style="@style/textstyle"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginEnd="44dp"
android:layout_marginBottom="48dp"
android:onClick="OnMyRegistClick"
android:text="@string/regist"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="MissingConstraints" />
<EditText
android:id="@+id/editCode"
android:layout_width="210dp"
android:layout_height="45dp"
android:layout_below="@+id/editPhone"
android:layout_alignStart="@+id/btnRegist"
android:layout_marginStart="16dp"
android:layout_marginTop="28dp"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="请输入验证码"
android:inputType="textPersonName"
app:layout_constraintBottom_toTopOf="@+id/btnRegist"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editPhone"
tools:ignore="MissingConstraints" />
<Button
android:id="@+id/btnGetcord"
android:layout_width="100dp"
android:layout_height="44dp"
android:layout_alignBaseline="@+id/editCode"
android:layout_alignEnd="@+id/editPhone"
android:layout_alignBottom="@+id/editCode"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:background="@color/colorPrimary"
android:text="获取验证码"
android:textColor="@color/colorAccent"
app:layout_constraintBottom_toTopOf="@+id/btnRegist"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/editCode"
app:layout_constraintTop_toBottomOf="@+id/editPhone"
tools:ignore="MissingConstraints" />
<EditText
android:id="@+id/editName"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:ems="10"
android:gravity="center"
android:hint="用户名"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="MissingConstraints" />
<TableRow
android:id="@+id/tableRow"
android:layout_width="282dp"
android:layout_height="38dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.636"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvShowDialog">
<TextView
android:layout_width="91dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:text="性别:" />
<RadioGroup
android:id="@+id/rg"
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
<RadioButton
android:id="@+id/male"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="男" />
<RadioButton
android:id="@+id/famle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="女" />
</RadioGroup>
</TableRow>
</android.support.constraint.ConstraintLayout>
Loading…
Cancel
Save