forked from kaixin1995/InformationPush
-
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
Kai
committed
Sep 12, 2019
1 parent
89a88f5
commit 6038954
Showing
53 changed files
with
1,406 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,13 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
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,30 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
buildToolsVersion "29.0.1" | ||
defaultConfig { | ||
applicationId "com.kaixin.mipush" | ||
minSdkVersion 24 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation 'com.android.support:appcompat-v7:28.0.0' | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | ||
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' | ||
implementation files('libs/MiPush_SDK_Client_3_6_19.jar') | ||
} |
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 @@ | ||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug"},"path":"app-debug.apk","properties":{}}] |
Binary file not shown.
Binary file not shown.
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
HappyPush/Android应用/app/src/androidTest/java/com/kaixin/mipush/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.kaixin.mipush; | ||
|
||
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.kaixin.mipush", 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,89 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.kaixin.mipush"> | ||
|
||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | ||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||
|
||
<permission | ||
android:name="com.kaixin.mipush.permission.MIPUSH_RECEIVE" | ||
android:protectionLevel="signature" /> | ||
|
||
<uses-permission android:name="com.kaixin.mipush.permission.MIPUSH_RECEIVE" /> | ||
<uses-permission android:name="android.permission.VIBRATE" /> | ||
|
||
<application | ||
android:name="com.kaixin.mipush.MyApplication" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcherhj" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity" | ||
android:launchMode="singleTask" > | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<!--小米推送开始--> | ||
<service | ||
android:name="com.xiaomi.push.service.XMJobService" | ||
android:enabled="true" | ||
android:exported="false" | ||
android:permission="android.permission.BIND_JOB_SERVICE" | ||
android:process=":pushservice" /> | ||
|
||
<service | ||
android:name="com.xiaomi.push.service.XMPushService" | ||
android:enabled="true" | ||
android:process=":pushservice" /> | ||
|
||
<service | ||
android:name="com.xiaomi.mipush.sdk.PushMessageHandler" | ||
android:enabled="true" | ||
android:exported="true" /> | ||
<service | ||
android:name="com.xiaomi.mipush.sdk.MessageHandleService" | ||
android:enabled="true" /> | ||
|
||
<receiver | ||
android:name="com.kaixin.mipush.DemoMessageReceiver" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE" /> | ||
</intent-filter> | ||
<intent-filter> | ||
<action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED" /> | ||
</intent-filter> | ||
<intent-filter> | ||
<action android:name="com.xiaomi.mipush.ERROR" /> | ||
</intent-filter> | ||
</receiver> | ||
<receiver | ||
android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> | ||
|
||
<category android:name="android.intent.category.DEFAULT" /> | ||
</intent-filter> | ||
</receiver> | ||
<receiver | ||
android:name="com.xiaomi.push.service.receivers.PingReceiver" | ||
android:exported="false" | ||
android:process=":pushservice"> | ||
<intent-filter> | ||
<action android:name="com.xiaomi.push.PING_TIMER" /> | ||
</intent-filter> | ||
</receiver> | ||
|
||
<!--小米推送结束--> | ||
</application> | ||
|
||
</manifest> |
32 changes: 32 additions & 0 deletions
32
HappyPush/Android应用/app/src/main/java/com/kaixin/mipush/DataMsg.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,32 @@ | ||
package com.kaixin.mipush; | ||
|
||
public class DataMsg { | ||
private String Time; | ||
private String Title; | ||
private String Msg; | ||
|
||
public DataMsg(String Time,String Title,String Msg) | ||
{ | ||
this.Time=Time; | ||
this.Title=Title; | ||
this.Msg=Msg; | ||
} | ||
|
||
//返回日期 | ||
public String GetTime() | ||
{ | ||
return Time; | ||
} | ||
|
||
//返回标题 | ||
public String GetTitle() | ||
{ | ||
return Title; | ||
} | ||
|
||
//返回详细文字 | ||
public String GetMsg() | ||
{ | ||
return Msg; | ||
} | ||
} |
Oops, something went wrong.