diff --git a/PushNotification/.gitignore b/PushNotification/.gitignore new file mode 100644 index 0000000..afbdab3 --- /dev/null +++ b/PushNotification/.gitignore @@ -0,0 +1,6 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build diff --git a/PushNotification/.idea/.name b/PushNotification/.idea/.name new file mode 100644 index 0000000..a344f67 --- /dev/null +++ b/PushNotification/.idea/.name @@ -0,0 +1 @@ +PushNotifi \ No newline at end of file diff --git a/PushNotification/.idea/compiler.xml b/PushNotification/.idea/compiler.xml new file mode 100644 index 0000000..217af47 --- /dev/null +++ b/PushNotification/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/PushNotification/.idea/copyright/profiles_settings.xml b/PushNotification/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/PushNotification/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PushNotification/.idea/encodings.xml b/PushNotification/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/PushNotification/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/PushNotification/.idea/gradle.xml b/PushNotification/.idea/gradle.xml new file mode 100644 index 0000000..736c7b5 --- /dev/null +++ b/PushNotification/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/PushNotification/.idea/misc.xml b/PushNotification/.idea/misc.xml new file mode 100644 index 0000000..99b2e43 --- /dev/null +++ b/PushNotification/.idea/misc.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + 1.8 + + + + + + + + + diff --git a/PushNotification/.idea/modules.xml b/PushNotification/.idea/modules.xml new file mode 100644 index 0000000..cd857ea --- /dev/null +++ b/PushNotification/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/PushNotification/.idea/scopes/scope_settings.xml b/PushNotification/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/PushNotification/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/PushNotification/.idea/vcs.xml b/PushNotification/.idea/vcs.xml new file mode 100644 index 0000000..def6a6a --- /dev/null +++ b/PushNotification/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/PushNotification/PushNotifi.iml b/PushNotification/PushNotifi.iml new file mode 100644 index 0000000..2a02201 --- /dev/null +++ b/PushNotification/PushNotifi.iml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/PushNotification/app/.gitignore b/PushNotification/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/PushNotification/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/PushNotification/app/app.iml b/PushNotification/app/app.iml new file mode 100644 index 0000000..1b60db0 --- /dev/null +++ b/PushNotification/app/app.iml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PushNotification/app/build.gradle b/PushNotification/app/build.gradle new file mode 100644 index 0000000..965f7e2 --- /dev/null +++ b/PushNotification/app/build.gradle @@ -0,0 +1,25 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 21 + buildToolsVersion "21.1.2" + + defaultConfig { + applicationId "com.vtplus.pushnotifi" + minSdkVersion 15 + targetSdkVersion 21 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:21.0.3' +} diff --git a/PushNotification/app/proguard-rules.pro b/PushNotification/app/proguard-rules.pro new file mode 100644 index 0000000..eb6c1d3 --- /dev/null +++ b/PushNotification/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/van/android-sdks/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# 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 *; +#} diff --git a/PushNotification/app/src/androidTest/java/com/vtplus/pushnotifi/ApplicationTest.java b/PushNotification/app/src/androidTest/java/com/vtplus/pushnotifi/ApplicationTest.java new file mode 100644 index 0000000..868aa52 --- /dev/null +++ b/PushNotification/app/src/androidTest/java/com/vtplus/pushnotifi/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.vtplus.pushnotifi; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/PushNotification/app/src/main/AndroidManifest.xml b/PushNotification/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..682747a --- /dev/null +++ b/PushNotification/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/PushNotification/app/src/main/java/com/vtplus/pushnotifi/MainActivity.java b/PushNotification/app/src/main/java/com/vtplus/pushnotifi/MainActivity.java new file mode 100644 index 0000000..6165bd0 --- /dev/null +++ b/PushNotification/app/src/main/java/com/vtplus/pushnotifi/MainActivity.java @@ -0,0 +1,45 @@ +package com.vtplus.pushnotifi; + +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.ActionBarActivity; +import android.view.Menu; +import android.view.View; +import android.widget.EditText; + + +public class MainActivity extends ActionBarActivity { + + NotificationManager NM; + EditText one, two, three; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + one = (EditText) findViewById(R.id.editText1); + two = (EditText) findViewById(R.id.editText2); + three = (EditText) findViewById(R.id.editText3); + } + + + @SuppressWarnings("deprecation") + public void notify(View vobj) { + String title = one.getText().toString(); + String subject = two.getText().toString(); + String body = three.getText().toString(); + NM = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + Notification notify = new Notification(android.R.drawable. + stat_notify_more, title, System.currentTimeMillis()); + PendingIntent pending = PendingIntent.getActivity( + getApplicationContext(), 0, new Intent(), 0); + notify.setLatestEventInfo(getApplicationContext(), subject, body, pending); + NM.notify(0, notify); + } + + +} diff --git a/PushNotification/app/src/main/res/drawable-hdpi/ic_launcher.png b/PushNotification/app/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..96a442e Binary files /dev/null and b/PushNotification/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/PushNotification/app/src/main/res/drawable-mdpi/ic_launcher.png b/PushNotification/app/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..359047d Binary files /dev/null and b/PushNotification/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/PushNotification/app/src/main/res/drawable-xhdpi/ic_launcher.png b/PushNotification/app/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..71c6d76 Binary files /dev/null and b/PushNotification/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/PushNotification/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/PushNotification/app/src/main/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..4df1894 Binary files /dev/null and b/PushNotification/app/src/main/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/PushNotification/app/src/main/res/layout/activity_main.xml b/PushNotification/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..c36d543 --- /dev/null +++ b/PushNotification/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,81 @@ + + +