-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Your Name
committed
Aug 10, 2018
0 parents
commit 0a549aa
Showing
92 changed files
with
2,918 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
apply plugin: 'com.mob.sdk' | ||
|
||
// 在MobSDK的扩展中注册SMSSDK的相关信息 | ||
MobSDK { | ||
appKey "263082c1bd6b4" | ||
appSecret "3c219b47cfcfc063177979d9c48640bb" | ||
|
||
SMSSDK {} | ||
} | ||
apply plugin: 'com.mob.sdk' | ||
|
||
MobSDK { | ||
appKey "263082c1bd6b4" | ||
appSecret "3c219b47cfcfc063177979d9c48640bb" | ||
MobIM {} | ||
} | ||
android { | ||
compileSdkVersion 28 | ||
defaultConfig { | ||
applicationId "com.example.dhy203dydhx" | ||
minSdkVersion 22 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' | ||
implementation 'com.android.support:design:28.0.0-alpha3' | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.1' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'com.android.support.test:runner:1.0.2' | ||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/com/example/dhy203dydhx/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.example.dhy203dydhx; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.example.dhy203dydhx", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.dhy203dydhx"> | ||
|
||
<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.READ_SMS" /> | ||
<uses-permission android:name="android.permission.GET_TASKS" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
|
||
<application | ||
|
||
android:allowBackup="true" | ||
android:icon="@mipmap/apptubiao" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:label="@string/app_name"> | ||
|
||
</activity> | ||
|
||
<activity | ||
android:name=".dengluActivity" | ||
android:label="@string/app_name"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity | ||
android:name=".gkgl" | ||
android:label="@string/app_name"> | ||
</activity> | ||
|
||
<activity | ||
android:name=".gysgl" | ||
android:label="@string/app_name"> | ||
</activity> | ||
|
||
<activity | ||
android:name=".sprk" | ||
android:label="@string/app_name"> | ||
</activity> | ||
<activity | ||
android:name=".hxxz" | ||
android:label="@string/app_name"> | ||
</activity> | ||
<activity | ||
android:name="com.example.dhy203dydhx.AddPeopleActivity" | ||
android:label="@string/app_name" > | ||
</activity> | ||
<provider android:name=".PeopleProvider" android:authorities="com.example.dhy203dydhx.Db_People" android:exported="true"/> | ||
|
||
</application> | ||
|
||
</manifest> |
Binary file not shown.
81 changes: 81 additions & 0 deletions
81
app/src/main/java/com/example/dhy203dydhx/AddPeopleActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package com.example.dhy203dydhx; | ||
|
||
import android.app.Activity; | ||
import android.content.ContentValues; | ||
import android.database.sqlite.SQLiteDatabase; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import android.widget.Toast; | ||
|
||
public class AddPeopleActivity extends Activity { | ||
private EditText edt_name; | ||
private EditText edt_phone; | ||
private EditText edt_mobile; | ||
private EditText edt_email; | ||
private Button bt_save; | ||
String name,phone,mobile,email; | ||
DbHelper dbhelper; | ||
SQLiteDatabase db; | ||
Bundle bundle; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
// TODO Auto-generated method stub | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.addpeople); | ||
|
||
edt_name=(EditText)findViewById(R.id.edt_name); | ||
edt_phone=(EditText)findViewById(R.id.edt_phone); | ||
edt_mobile=(EditText)findViewById(R.id.edt_mobile); | ||
edt_email=(EditText)findViewById(R.id.edt_email); | ||
bt_save=(Button)findViewById(R.id.bt_save); | ||
|
||
bundle=this.getIntent().getExtras(); | ||
if(bundle!=null) | ||
{ | ||
edt_name.setText(bundle.getString("name")); | ||
edt_phone.setText(bundle.getString("phone")); | ||
edt_mobile.setText(bundle.getString("mobile")); | ||
edt_email.setText(bundle.getString("email")); | ||
} | ||
bt_save.setOnClickListener(new Button.OnClickListener() | ||
{ | ||
@Override | ||
public void onClick(View v) { | ||
// TODO Auto-generated method stub | ||
name=edt_name.getText().toString(); | ||
phone=edt_phone.getText().toString(); | ||
mobile=edt_mobile.getText().toString(); | ||
email=edt_email.getText().toString(); | ||
|
||
ContentValues value=new ContentValues(); | ||
value.put("name", name); | ||
value.put("phone", phone); | ||
value.put("mobile", mobile); | ||
value.put("email", email); | ||
DbHelper dbhelper = new DbHelper(AddPeopleActivity.this, "Db_People",null, 1); | ||
SQLiteDatabase db=dbhelper.getWritableDatabase(); | ||
long status; | ||
if(bundle!=null) | ||
{ | ||
status=db.update("tb_people", value, "_id=?", new String[]{bundle.getLong("id")+""}); | ||
} | ||
else | ||
{ | ||
status=db.insert("tb_people", null, value); | ||
} | ||
if(status!=-1) | ||
{ | ||
Toast.makeText(AddPeopleActivity.this, "保存成功", Toast.LENGTH_LONG).show(); | ||
} | ||
else | ||
{ | ||
Toast.makeText(AddPeopleActivity.this, "保存失败", Toast.LENGTH_LONG).show(); | ||
} | ||
db.close(); | ||
} | ||
}); | ||
} | ||
} | ||
|
Oops, something went wrong.