From eb63a0124b4744dd677c34e6f7dbb34fcdc16b90 Mon Sep 17 00:00:00 2001 From: Max Ogden Date: Mon, 27 Aug 2012 13:38:51 -0700 Subject: [PATCH] update readme and add more docs to statusbarnotification android plugin --- Android/StatusBarNotification/README.md | 37 +++++------------- .../StatusNotificationBuilder.java | 1 + .../StatusNotificationIntent.java | 1 + .../drawable-hdpi/notification.png | Bin 0 -> 1015 bytes .../drawable-mdpi/notification.png | Bin 0 -> 758 bytes .../drawable-xhdpi/notification.png | Bin 0 -> 1257 bytes 6 files changed, 11 insertions(+), 28 deletions(-) create mode 100644 Android/StatusBarNotification/drawable-hdpi/notification.png create mode 100644 Android/StatusBarNotification/drawable-mdpi/notification.png create mode 100644 Android/StatusBarNotification/drawable-xhdpi/notification.png diff --git a/Android/StatusBarNotification/README.md b/Android/StatusBarNotification/README.md index 75d16af..20b6d27 100644 --- a/Android/StatusBarNotification/README.md +++ b/Android/StatusBarNotification/README.md @@ -1,51 +1,31 @@ # StatusBarNotification plugin for Cordova # -Plugin allows you to display notifications in the status bar from your PhoneGap application. +This plugin allows you to display notifications in the status bar from your Cordova application. On Android you have to explicitly add things to the status bar (as opposed to iOS where push notifications automatically get displayed in the UI). The Android status bar is the UI component at the top of the screen that has a bunch of little icons. You can also drag the status bar down to view a list of notifications. ## Adding the Plugin to your project ## -Using this plugin requires [Android PhoneGap](http://github.com/phonegap/phonegap-android). +Using this plugin requires [Android Cordova](http://github.com/apache/incubator-cordova-android). -1. To install the plugin, move statusbarnotification.js to your project's www folder and include a reference to it in your html file after phonegap.js. +1. To install the plugin, move statusbarnotification.js to your project's www folder and include a reference to it in your html file after cordova.js. - <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8" src="statusbarnotification.js"></script> 2. Create a directory within your project called "src/com/phonegap/plugins/statusBarNotification" and move the .java files from this folder into it. -3. Add the following activity to your AndroidManifest.xml file. It should be added inside the <application> tag. - - <activity android:name="com.phonegap.DroidGap" android:label="@string/app_name">
- <intent-filter>
- </intent-filter>
- </activity> - -4. In your res/xml/plugins.xml file add the following line: +3. In your res/xml/plugins.xml file add the following line: <plugin name="StatusBarNotification" value="com.phonegap.plugins.statusBarNotification.StatusBarNotification"/> -5. You will need to add a nofication.png file to you applications res/drawable-ldpi, res/drawable-mdpi & res/drawable-hdpi directories. +4. You will need to add a notification.png file to your applications res/drawable-ldpi, res/drawable-mdpi & res/drawable-hdpi or res/drawable-xhdpi directories (depending on what resolutions you want to support). -6. You will need to add an import line like: +5. You will need to add an import line like this to the .java files (see commented out lines inside the files): import com.my.app.R; -Where com.my.app is your applications package name in order for this to compile. - ## Using the plugin ## -The plugin creates the object `window.plugins.statusBarNotification`. To use, call one of the following, available methods: - -
-  /**
-   * Displays new status bar notification
-   * 
-   * @param notificationTitle	The url to load
-   * @param notificationBody	Load url in PhoneGap webview [optional] - Default: false
-   */
-   
-  notify(notificationTitle, notificationBody);
-
+The plugin creates the object `window.plugins.statusBarNotification`. Sample use: @@ -54,6 +34,7 @@ Sample use: ## License ## Copyright (C) 2011 Dmitry Savchenko +Copyright (C) 2012 Max Ogden Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/Android/StatusBarNotification/StatusNotificationBuilder.java b/Android/StatusBarNotification/StatusNotificationBuilder.java index c33fb7b..623e452 100644 --- a/Android/StatusBarNotification/StatusNotificationBuilder.java +++ b/Android/StatusBarNotification/StatusNotificationBuilder.java @@ -1,3 +1,4 @@ +// This class is called on all Androids running Honeycomb or above package com.phonegap.plugins.statusBarNotification; // import com.yourapp.R; diff --git a/Android/StatusBarNotification/StatusNotificationIntent.java b/Android/StatusBarNotification/StatusNotificationIntent.java index 2c37187..53edc5a 100644 --- a/Android/StatusBarNotification/StatusNotificationIntent.java +++ b/Android/StatusBarNotification/StatusNotificationIntent.java @@ -1,3 +1,4 @@ +// This class is used on all Androids below Honeycomb package com.phonegap.plugins.statusBarNotification; // import com.yourapp.R; diff --git a/Android/StatusBarNotification/drawable-hdpi/notification.png b/Android/StatusBarNotification/drawable-hdpi/notification.png new file mode 100644 index 0000000000000000000000000000000000000000..00e8f8aec72845e04fb832a69019e2d67d926233 GIT binary patch literal 1015 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}trX+877l!}s{b%+Ad7K3vk;M!Q z+(IDCcKfnz$52J2-w_pT=#sO^rYi(^Q{;kVQFcZ-IL9Jen|i@S4NO`$6- z(BQ~1HGxS^TLjl$is*_x@c+Q2OR3S_2^)JCDBO6`ACRc%cT|7I*QDys-{0~x>v&n?ifz-F+)w=!DBfaP z(Ievf*h^UOg!sWTS1dU9o%~*NTudi! zvkJ%9j!Q<*TF|op$z>^%@6F8Ybq4F7&#TJx*(g;b@P5{+otdZq8?{}D@!cDJdp(Q% zZ;?F;x_WXS9uusF4@n!MGVCM7}jK{4GC_hlD%~98UW$>=B zrmerRsU^51yzTLqT{EXoW|)((cEDl!*cmAw$V>!I(nV;9C#EK(~;hG)G zm2Mt+dWe_w=W1*{=nmLLhQ*I51aQ3%S0?>&AMDZ>%Ct1 z{OHOl{`Z@kW|+S@v?BVdXG86}g4VxTCevhYJmob!YIIejqc+}W%9c;{yBFV>`d|Oe zbZv33Sl{!z?rWT$wX!;I=hHY-sq2?&&+A3{MvGJjTN@T!cu_EO=dasdA4=W(j_j)s z2~1g5`uXG;A6=a*%H?+?4z9mt@^Qxct)Gg2-TCuYzfRfh^Ml=bQi&-wv+@}`e@+em zbHH*R)4k8r_Wzh`+t)B-kxBg5heF-z|H)jPeqi|y>*VxRvECk?YV!O3 z3p@G>{*(UmheND-9 znO2Fe!N|(U0;1u%%CdJr4Kg4bg7ec#$`gxH85~pclTsDjGK*5n^NX^J6`X@j3%5Qt Q1FB>2boFyt=akR{0A{7XYXATM literal 0 HcmV?d00001 diff --git a/Android/StatusBarNotification/drawable-mdpi/notification.png b/Android/StatusBarNotification/drawable-mdpi/notification.png new file mode 100644 index 0000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