Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to cordova 2.0.0 #91

Open
wants to merge 330 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
330 commits
Select commit Hold shift + click to select a range
26f0ed9
VideoPlayer will now start YouTube without having to ask the user first
macdonst Nov 18, 2011
1baba50
Fixing escaped xml tag in BarcodeScanner Readme
macdonst Nov 21, 2011
43a7e7a
* Java code to java convention (functions starts with a lowercase cha…
Nov 24, 2011
ea73d38
copyright
Nov 24, 2011
509f936
Update iPhone/GoogleAnalytics GoogSDK to 1.4
mgcrea Nov 24, 2011
c241c2a
Updated iPhone/GoogleAnalytics `readme.md`.
mgcrea Nov 24, 2011
44a72e6
JSONKit and ARC
MrBuzzy Nov 25, 2011
da8b169
Updated VolumeSlider for PhoneGap 1.2.0
devgeeks Nov 25, 2011
7b3f119
Allow customization of the interface using a optional xib file
oswell Nov 25, 2011
3d8f61c
Clean up.
oswell Nov 25, 2011
3c26bb4
clean up js style and make readme more accurate. adds to #248
max-mapper Nov 26, 2011
1ebc2ee
add compose new tweet bindings, clean up readme. adds to #226
max-mapper Nov 26, 2011
194b25d
add note about phonegap version requirement. adds to #253
max-mapper Nov 26, 2011
5d96af7
clean up mapkit js style
max-mapper Nov 26, 2011
7990c9a
Added new iPhone/MessageBox plugin.
mgcrea Nov 26, 2011
f6d39ae
add examples to readme and cleanup js style. adds to #178
max-mapper Nov 27, 2011
498d112
cleanup sharekit readme
max-mapper Nov 27, 2011
ebed46a
cleaning up readme and js style in emailcomposer
max-mapper Nov 27, 2011
ed13a20
add plugin mapping note to emailcomposer readme
max-mapper Nov 27, 2011
f01e48e
Stop messing with textField background color
Nov 27, 2011
c0f2740
Updated `iPhone/MessageBox/README.md` to be more descriptive.
mgcrea Nov 27, 2011
014a687
Created `iPhone/ActionSheet` plugin.
mgcrea Nov 28, 2011
e8c6405
Small fixes for `iPhone/ActionSheet` plugin.
mgcrea Nov 28, 2011
6fa1847
Minor readme changes.
mgcrea Nov 28, 2011
17268bc
add oswell's instructions on how to customize barcodescanner overlay.…
max-mapper Nov 28, 2011
cff054d
Speech in progress fix
Nov 29, 2011
599d850
Full example provided
Nov 29, 2011
b3fd9fe
copyright modification
Nov 29, 2011
d7d7b1a
copyright layout
Nov 29, 2011
931335b
copyright layout
Nov 29, 2011
3acdd8b
copyright layout
Nov 29, 2011
703c639
Add ChildBrowser plugin for BlackBerry.
Nov 30, 2011
28db856
Fix issues in BarcodeScanner README.md.
Dec 1, 2011
1b7f5fa
Fix BarcodeScanner and ChildBrowser README
Dec 2, 2011
396ce29
Fix for Issue #225 (https://github.com/phonegap/phonegap-plugins/issu…
trentonstrong Dec 3, 2011
f9ba944
1.2 json support
brianantonelli Dec 7, 2011
d90941e
Revert "1.2 json support"
brianantonelli Dec 7, 2011
f730de2
pg 1.2 json support
brianantonelli Dec 7, 2011
952380b
fix package info, cleaning readme
brianantonelli Dec 7, 2011
ab2041a
Fix IAP for iOS: apply()'s "this" argument needs to be set.
buddydvd Dec 8, 2011
f0a982b
stop web view loading when child browser dialog is closed
kwellman Dec 11, 2011
e23b649
add pushnotification ios plugin
max-mapper Dec 16, 2011
ab8f3c0
add default appdelegate classes
max-mapper Dec 16, 2011
4755887
add pushnotification specific code to appdelegate files
max-mapper Dec 16, 2011
4b19ab9
add installation note to ios pushnotification readme
max-mapper Dec 16, 2011
d1efb8d
hand various device environment values back to js notify callback
max-mapper Dec 18, 2011
187813f
remove log function from pushnotification ios plugin
max-mapper Dec 19, 2011
3e38d3d
add note about weak_linking EXC_BAD_ACCESS issue in twitter ios plugi…
max-mapper Dec 19, 2011
1d31216
Fixing the example which had bad JSON objects. As per issue #293
macdonst Dec 20, 2011
0b4c26f
Updated applicationPreferences to 1.2.0 +
ttopholm Dec 27, 2011
65d3465
Small update
ttopholm Dec 27, 2011
e548f26
Fixed a small error in js file, thx Michael DeSimone
ttopholm Dec 28, 2011
cae78fa
AddService code no longer needed in PhoneGap 1.0.
lindstedt Dec 29, 2011
6079b4b
Add missing plugins.xml instructions
lindstedt Dec 29, 2011
d4812ed
Issue 210: comment out showHelpOnFirstLaunch
macdonst Dec 31, 2011
fa7f8f8
first commit
anto-acube Jan 1, 2012
4645325
Display a message when navigation failed
tomasfejfar Jan 11, 2012
65b0591
Added ExternalScreen plugin for iOS devices
triceam Jan 17, 2012
ba7bef0
iOS > EmailComposer > FIX: Without email account there is an error, t…
tomasfejfar Jan 17, 2012
cf78331
Added instructions to README to help with EXC_BAD_ACCESS issue when u…
Jan 17, 2012
df26495
adding error handler for if tweet is too long
brianantonelli Jan 19, 2012
095f875
fixing memory leaks
brianantonelli Jan 19, 2012
cae9ad5
Calendar Plugin
Jan 18, 2012
7028684
calendar plugin
Jan 21, 2012
c5450f4
Revert "calendar plugin"
Jan 21, 2012
26d40e7
calendar plugin
Jan 21, 2012
1fb8c53
Typo in the AccountList README (#329)
macdonst Jan 23, 2012
4a84e46
Issue #330: One more typo in the AccountList README
macdonst Jan 23, 2012
4c3fe75
Reworking compose tweet
brianantonelli Jan 24, 2012
2cf5e9f
Updated collabs
Jan 24, 2012
c19f6ed
updated collab list
Jan 24, 2012
d60a472
Added onNewIntent and getUri for WebIntent plugin
yuvipanda Jan 24, 2012
23d1a9c
Support for adding both local and remote images.
brianantonelli Jan 25, 2012
6c83adc
added LowLatencyAudio plugins for iOS and Android, with usage examples
triceam Jan 25, 2012
746223f
Added EXTRA_STREAM
RaananW Jan 26, 2012
df11b04
Added the possibility to share an image and html encoded text
RaananW Jan 26, 2012
42e7214
Adds the ability to set custom variables to the Android Analytics plu…
Jan 26, 2012
b3f00b5
Android datepicker that uses the same interface as the existing iPhon…
Jan 31, 2012
5d9fa20
Update Android/StatusBarNotification/statusbarnotification.js
manijshrestha Feb 5, 2012
18fa763
Update Android/StatusBarNotification/StatusBarNotification.java
manijshrestha Feb 5, 2012
32e48b8
Update Android/StatusBarNotification/StatusBarNotification.java
manijshrestha Feb 5, 2012
21394f1
Fix issue #280, include overlay view file and fix xib loading.
oswell Feb 6, 2012
03f41d0
Local Notifications for Android
Feb 8, 2012
e94dd14
Updated format of Readme.md
Feb 8, 2012
66a34b5
Update iPhone/VolumeSlider/README.md
devgeeks Feb 8, 2012
96fdfd1
Fix for deprecations in PhoneGap 1.4.x
devgeeks Feb 18, 2012
6df7b61
Tidy up for README.md
devgeeks Feb 18, 2012
ddbb5d4
Updated the DatePicker class to use standard iOS conventions for dele…
samsoir Feb 22, 2012
5c336d0
Fixed a few minor errors with releasing to early. Also ensure the JS …
samsoir Feb 22, 2012
c0a0917
Using ISO standard date formatting within the iOS DatePicker.m class
samsoir Feb 22, 2012
3c3dd88
Created a new datetime mode to allow date and time to be sent
samsoir Feb 22, 2012
4ef6b02
More refactoring of the DatePicker implmentation. Created one init me…
samsoir Feb 22, 2012
1858b51
removed instructions for new activity in AndroidManifest.xml
libbybaldwin Feb 23, 2012
0e129b1
fixed bug that prevented content to be loaded in external screen's we…
triceam Feb 24, 2012
77eb69c
put license back into file
triceam Feb 24, 2012
7cc65cf
Cordova 1.5 Support for iOS iAd plugin
RandyMcMillan Mar 5, 2012
e985294
Cordova 1.5 Support for ActionSheet iOS plugin
RandyMcMillan Mar 5, 2012
2750f21
Begin Migration to /iOS from /iPhone
RandyMcMillan Mar 6, 2012
004a536
Manually recreated ActionSheet pull request 346 / Linted .js file
RandyMcMillan Mar 6, 2012
9a1e502
ChildBrowser with Cordova only support
RandyMcMillan Mar 7, 2012
088bdde
Cordova Support for BarCodeScanner
RandyMcMillan Mar 8, 2012
2d0a54d
Initial import of Cordova version of the VolumeSlider plugin
devgeeks Mar 8, 2012
3f778db
Missed a PHONEGAP reference
devgeeks Mar 8, 2012
a903694
fixes for issue #380
pmuellr Mar 8, 2012
ce0cb75
Cordova 1.5 support
RandyMcMillan Mar 9, 2012
83880c9
Email Composer Cordova 1.5 support
RandyMcMillan Mar 9, 2012
4609ad6
README update
RandyMcMillan Mar 9, 2012
5ae10ee
README notes
RandyMcMillan Mar 9, 2012
19d2bf5
Converted the Badge plugin to Cordova for a project and thought other…
JStuhr Mar 9, 2012
4ad083c
Added additional type: "decimalpad" to show the UIKeyboardTypeDecimal…
antijingoist Mar 12, 2012
1d7efb6
Added NativeControls with support for Cordova 1.5
danjordan Mar 13, 2012
a95e23f
Updated DatePicker to Cordova1.5.0
danjordan Mar 14, 2012
5858694
orientation note
RandyMcMillan Mar 14, 2012
d52fa47
Now works with cordova-1.5.0.jar
alculquicondor Mar 14, 2012
8a664a5
now works with cordova-1.5.0.jar
alculquicondor Mar 14, 2012
e52c489
PayPal Plugin update to 1.4.1
RandyMcMillan Mar 15, 2012
7a9c489
PayPal Cordova 1.5.0
RandyMcMillan Mar 15, 2012
2cc5687
comment out this alert
RandyMcMillan Mar 15, 2012
ef5a281
callback bug fixed
Mar 20, 2012
5169fe8
Updated Twitter plugin to support Cordova
Mar 20, 2012
4c488e6
fixed compilation error for 'Html' class usage.
GopinathMR Mar 20, 2012
039704f
need to change Phonegap to Cordova, since 1.5 called Phonegap as Cordova
leo-zhao Mar 21, 2012
8d7dd48
fixed the header for 1.5
leo-zhao Mar 21, 2012
2fbb82f
FileUploader CDV 1.5.0 only
RandyMcMillan Mar 22, 2012
f0ffb0a
Rollback iphone/FileUploader to PhoneGap
RandyMcMillan Mar 24, 2012
fed0d6e
PrintPlugin CDV 1.5.0 support
RandyMcMillan Mar 26, 2012
8bfb360
Updated /iOS/README.md
RandyMcMillan Mar 26, 2012
61423ea
Initial release version 1.0 of WAC NAPI PhoneGap Plugin
WACSUPPORT Mar 28, 2012
f80d9ff
Updating ChildBrowser for 1.5.0
macdonst Mar 5, 2012
81a26df
Updating FTPClient for 1.5.0
macdonst Mar 28, 2012
9b5589a
Updating TTS for 1.5.0
macdonst Mar 28, 2012
0bb5111
Fixing ChildBrowser rebase error
macdonst Mar 28, 2012
f3850fd
Added ability for videos in assets folder to play
ssherriff Mar 29, 2012
6f01da7
Android Plugin To Extract Zip File
vishalrajpal Mar 29, 2012
d6f35ab
VideoPlayer can now play files from the assests folder and updated to…
macdonst Mar 29, 2012
7bbdcb2
SMSComposer (iOS) CDV 1.5.0 support
RandyMcMillan Mar 29, 2012
dc0f15d
Deleted to rename the project name
WACSUPPORT Mar 29, 2012
9bd2732
Initial version(1.0) of WAC Napi Payment Plugin
WACSUPPORT Mar 29, 2012
05a2b69
for complete API consistency, this method should return the browser o…
cewing Mar 29, 2012
8f3990d
install function should also be defined on the ChildBrowser, not the …
cewing Mar 29, 2012
51618f1
Added License file
WACSUPPORT Mar 29, 2012
cd03333
Fixing issue in VideoPlayer README
macdonst Mar 30, 2012
86713cb
Cordova 1.5.0 support of AudioRecord plugin.
siuying Mar 31, 2012
5d17403
SMSComposer (iOS) Quick fix for issue 431
RandyMcMillan Mar 31, 2012
55da81e
added emailaddress support
svendroid Mar 31, 2012
e4b8cea
SMSComposer (iOS) StatusBarHidden fix
RandyMcMillan Apr 1, 2012
cd8986b
Twitter plugin (iOS) update and issue #430 fix
RandyMcMillan Apr 1, 2012
3d9498b
Add AppiraterPlugin
jamesnw Apr 2, 2012
6a6bb88
Update iOS/AppiraterPlugin/README.md
jamesnw Apr 2, 2012
57e2a17
Replace PGPlugin interface with CDVPlugin
jamesnw Apr 2, 2012
303d105
Twitter (iOS) Plugin Issue #430
RandyMcMillan Apr 2, 2012
8ee1c40
Initital version of new bluetooth plugin for cordova / phonegap
Apr 3, 2012
7dbf984
Update Android/ExtractZipFile/www/index.html
vishalrajpal Apr 3, 2012
6643bc3
Add v0 of card.io iOS plugin
josharian Apr 3, 2012
534f01a
Changes for PhoneGap
vishalrajpal Apr 4, 2012
78275e1
NativeControls (iOS) with orientation support and demo index.html iss…
RandyMcMillan Apr 4, 2012
c81042d
Added a card.io (iOS) plugin README.md note
RandyMcMillan Apr 4, 2012
2b2e07c
Manual merge per https://github.com/phonegap/phonegap-plugins/pull/447
RandyMcMillan Apr 7, 2012
c084f18
Added a ApplicationPreferences (iOS) plugin note to ReadMe.md
RandyMcMillan Apr 7, 2012
d446386
Adding enable / disable functionality for bluetooth
Apr 7, 2012
fc2db39
Added Cordova support for `iOS/MessageBox`.
mgcrea Apr 8, 2012
cf53c7c
Updated `iOS/ActionSheet` for Cordova-1.6.
mgcrea Apr 9, 2012
a10b9c1
`iOS/MessageBox/README.md` tweaks.
mgcrea Apr 9, 2012
985ea13
Added new `iOS/PickerView` plugin for Cordova-1.6+.
mgcrea Apr 9, 2012
53761e0
Small bugfix for `iOS/ActionSheet`.
mgcrea Apr 9, 2012
5f8906b
Remove trailing NSLog() calls in `iOS/PickerView`.
mgcrea Apr 9, 2012
dc465ed
Update Globalization plugin for 1.5.0.
brycecurtis Apr 9, 2012
943d2e5
Styling hints per user request https://github.com/phonegap/phonegap-p…
RandyMcMillan Apr 9, 2012
76a6516
PayPalPlugin - Updated for 1.6.0 and JavaScript global namespace cleanup
shazron Apr 9, 2012
33feafe
AdPlugin - Updated for 1.6.0 and JavaScript global namespace cleanup
shazron Apr 9, 2012
d5ca1a1
PayPalPlugin README tweak
shazron Apr 9, 2012
f1f848d
add Cordova support to GoogleAnaltics for iOS
Apr 9, 2012
f7aab12
Modified plugin and example for Cordova 1.5
dshookowsky Apr 10, 2012
400f99e
checked for one argument too less
allesmi Apr 10, 2012
cfba9a0
Updated Testflight plugin for Cordova 1.6
fform Apr 11, 2012
24b153b
The readme tries to tell people to update the application tag but bec…
macdonst Apr 12, 2012
2ecf724
ReadMe has been updated.
WACSUPPORT Apr 12, 2012
8963a5d
Updated Globalization plugin for use with Cordova 1.5 and 1.6
Apr 12, 2012
d92b52b
Update BlackBerry plugins for Cordova 1.6.
Apr 12, 2012
3583fe7
1.6.0 note
RandyMcMillan Apr 12, 2012
37be3db
1.6.0 Note
RandyMcMillan Apr 12, 2012
99de072
Plugin Notes update for 1.6.0
RandyMcMillan Apr 12, 2012
1e6d82b
Fix iOS/DatePicker/DatePicker.js for Cordova 1.5 and 1.6
Apr 13, 2012
9af0561
Twitter iOS plugin 1.6.0
RandyMcMillan Apr 13, 2012
6fbcc76
Email Composer iOS 1.6.0
RandyMcMillan Apr 13, 2012
6a33255
Commented the missing function viewUpdate() and added a navigator.not…
manishkungwani Apr 14, 2012
b3e66c7
updated calendar plugin for cordova use
Apr 15, 2012
2afc23e
modified readme for updated cordova use
Apr 15, 2012
08df1e2
added calendar plugin for cordova 1.6.0 use
Apr 15, 2012
be02e34
Added Cordova Support & documentation
DrewDahlman Apr 15, 2012
ab09012
Updated to support sound & callbacks
DrewDahlman Apr 15, 2012
d225638
Version support notes for /iPhone repository
RandyMcMillan Apr 15, 2012
2435eba
Fresh rewrite of LocalNotifications for use with Cordova 1.6
DrewDahlman Apr 16, 2012
fa80ebe
Removed references / dual support of Cordova
DrewDahlman Apr 16, 2012
52533fc
Cleanup
DrewDahlman Apr 16, 2012
eee615e
Fixing the call to Cordova
DrewDahlman Apr 16, 2012
750295d
Revert "Fixing the call to Cordova"
DrewDahlman Apr 16, 2012
81131f9
Fixed Childbrowser for use in Cordova 1.6
DrewDahlman Apr 16, 2012
3a42a47
InAppPurchaseManager (iOS) 1.6.0 support edits
RandyMcMillan Apr 16, 2012
bebfe52
Changed Cordova.exec to cordova.exec for Cordova 1.6
dak Apr 17, 2012
5050e7e
Added iOS 5 Twitter.framework notice
RandyMcMillan Apr 18, 2012
caf9027
Updated the Badge plugin for Cordova 1.6.1.
JStuhr Apr 19, 2012
562e55c
Added a ReadMe to help install and use the plugin.
JStuhr Apr 19, 2012
546d11f
Added new method getPage
DrewDahlman Apr 19, 2012
56cbde4
Clean up
DrewDahlman Apr 19, 2012
3713a4d
UA PushNotification (iOS) 1.6.0 support
RandyMcMillan Apr 19, 2012
ba9bbbb
Simple IMEI plugin for Android
macdonst Apr 20, 2012
908974e
"Plugins" is in the PhoneGap.plist file.
antoniopironti Apr 21, 2012
72117df
Tweaking `iOS/MessageBox`, added callable checks on callbacks.
mgcrea Apr 22, 2012
fbc45cb
TwitterPlugin (iOS) note
RandyMcMillan Apr 24, 2012
ae061e8
Updating the ChildBrowser so the web view shows full screen on Android.
macdonst Apr 24, 2012
a5f316d
PowerManagement Plugin update for Cordova 1.6+
Apr 25, 2012
f49d878
Added new `iOS/ProgressHud` plugin for Cordova-1.6+.
mgcrea Apr 26, 2012
0cd6458
Updated NotificationEx for Cordova
shazron Apr 27, 2012
da56d5a
Missing definition in `iOS/ProgressHud` header interface.
mgcrea Apr 27, 2012
0659ccd
Updating BarcodeScanner plugin to Cordova
macdonst Apr 27, 2012
fe723f3
Changed README with proper instructions.
vishalrajpal Apr 30, 2012
4139af5
Add iOS Retina display detection for button icons
Apr 30, 2012
f8ce2bd
TwitterPlugin (iOS) tested on Cordova 1.7.0
Apr 30, 2012
3581ed5
Added getTwitterUsername api call
mdreeling May 1, 2012
ae92aef
Remove unused variable
mdreeling May 2, 2012
42709c2
Sync to master
mdreeling May 2, 2012
be40fd3
Updating PowerManagement plugin for iOS and Cordova 1.6
May 2, 2012
8e13447
UAPushNotification
RandyMcMillan May 2, 2012
b66b2a6
UAPushNotification
RandyMcMillan May 2, 2012
38ac83b
update for depricated ADBannerContentSizeIdentifier480/320 -> landsca…
sebbie1o1 May 3, 2012
7a2e848
Fix problem for case sensitive file systems.
macdonst May 3, 2012
3d18045
Initial commit - Diagnostic Plugin
avantic May 4, 2012
c0eb49f
.
RandyMcMillan May 5, 2012
91f5426
Removed UAPushNotification
RandyMcMillan May 5, 2012
ad3e76d
Added a refactored `iOS/PushNotification` plugin for Cordova 1.6+.
mgcrea May 6, 2012
3e4fe94
UAPushNotifications Plugin Folder
RandyMcMillan May 6, 2012
a2416fe
Memory crash fixes for `iOS/ProgressHud`.
mgcrea May 7, 2012
70f99ff
Update IOS LowLatencyAudio plugin for Cordova 1.7
alexdrel May 7, 2012
0dadeaa
Existing audio ID reference switched from error to warning (status of…
alexdrel May 7, 2012
7cd85fb
The version of Appirater compatible with PG added to Class folder.
alexdrel May 7, 2012
9dd92c1
add iOS/WebInspector plugin
pmuellr May 8, 2012
b1d1f3c
Allow ChildBrowser to read file:// links
macdonst May 9, 2012
158f29a
Enabling JavaScript in ChildBrowser
macdonst May 9, 2012
3a4cd22
Added support for setDeviceIdentifier
jschwartz73 May 9, 2012
556a5a4
Enabling localStorage in ChildBrowser.
macdonst May 10, 2012
3f54ce6
Improvements for `iOS/PushNotification`.
mgcrea May 10, 2012
c769125
Update `iOS/PushNotification` to fix concurrent callbacks failure.
mgcrea May 11, 2012
8381143
Spelling fix - "retrieve", not "retreive"
May 13, 2012
3de6bbc
More spelling fixes
May 13, 2012
017340d
Merge pull request #80 from purplecabbage/NewMaster
purplecabbage May 16, 2012
e1b20fe
Merge pull request #68 from sgrebnov/WP7-DateTimePicker
purplecabbage May 16, 2012
3b1aab6
Added WindowsPhone/VideoPlayer plugin for Cordova.
gloob May 23, 2012
59031c6
Merge pull request #83 from gloob/master
purplecabbage May 24, 2012
90a4eef
Updated to cordova 2.0.0
EstebanFuentealba Jul 27, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 42 additions & 0 deletions Android/AccountList/AccountList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.seltzlab.mobile;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.accounts.Account;
import android.accounts.AccountManager;

import com.phonegap.api.Plugin;
import com.phonegap.api.PluginResult;

public class AccountList extends Plugin {

@Override
public PluginResult execute(String action, JSONArray args, String callbackId) {

try {
JSONObject obj = args.getJSONObject(0);

AccountManager am = AccountManager.get(this.ctx);

Account[] accounts;
if (obj.has("type"))
accounts = am.getAccountsByType(obj.getString("type"));
else
accounts = am.getAccounts();

JSONArray res = new JSONArray();
for (int i = 0; i < accounts.length; i++) {
Account a = accounts[i];
res.put(a.name);
}

return new PluginResult(PluginResult.Status.OK, res);

} catch (JSONException e) {
return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
}
}

}
34 changes: 34 additions & 0 deletions Android/AccountList/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
AccountList Phonegap Plugin for Android
=======================================
This plugin allows you to obtain an array containing all the accounts configured on the device

Adding the Plugin to your project
=================================

To install the plugin, copy accountlist.js to your project's www folder and include a reference to it in your html files.

<script type="text/javascript" src="accountlist.js"></script>

Create a folder called 'com/seltzlab/mobile' within your project's src folder and copy AccountList.java file into that new folder.

Add a plugin line to res/xml/plugins.xml
<plugin name="AccountList" value="com.seltzlab.mobile.AccountList" />

Add a permission line to the AndroidManifest.xml
<uses-permission android:name="android.permission.GET_ACCOUNTS" />

Using the plugin
================
window.plugins.AccountList.get(
{
type: 'account type' // if not specified get all accounts
},
function (result) {
console.log(result.length);
for (i in res)
console.log(result[i]);
},
function (error) {
console.log(error);
}
);
13 changes: 13 additions & 0 deletions Android/AccountList/accountlist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var AccountList = function() {};

AccountList.prototype.get = function(params, success, fail) {
return PhoneGap.exec( function(args) {
success(args);
}, function(args) {
fail(args);
}, 'AccountList', '', [params]);
};

PhoneGap.addConstructor(function() {
PhoneGap.addPlugin('AccountList', new AccountList());
});
4 changes: 4 additions & 0 deletions Android/Analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Using this plugin requires [Android PhoneGap](http://github.com/phonegap/phonega

4. Copy "lib/libGoogleAnalytics.jar" into the libs directory within your project. You will also need to right click on this file in eclipse and add the jar to the build path.

5. In your res/xml/plugins.xml file add the following line:

<plugin name="GoogleAnalyticsTracker" value="com.phonegap.plugins.analytics.GoogleAnalyticsTracker" />

## Using the plugin ##

The plugin creates the object `window.plugins.analytics`. To use, call one of the following, available methods:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
public class GoogleAnalyticsTracker extends Plugin {
public static final String START = "start";
public static final String TRACK_PAGE_VIEW = "trackPageView";
public static final String TRACK_EVENT = "trackEvent";
public static final String TRACK_EVENT = "trackEvent";
public static final String SET_CUSTOM_VARIABLE = "setCustomVariable";

public static final int DISPATCH_INTERVAL = 20;
private com.google.android.apps.analytics.GoogleAnalyticsTracker tracker;
Expand Down Expand Up @@ -52,6 +53,12 @@ public PluginResult execute(String action, JSONArray data, String callbackId) {
} catch (JSONException e) {
result = new PluginResult(Status.JSON_EXCEPTION);
}
} else if (SET_CUSTOM_VARIABLE.equals(action)){
try {
setCustomVar(data.getInt(0), data.getString(1), data.getString(2), data.getInt(3));
} catch (JSONException e) {
result = new PluginResult(Status.JSON_EXCEPTION);
}
} else {
result = new PluginResult(Status.INVALID_ACTION);
}
Expand All @@ -69,4 +76,8 @@ private void trackPageView(String key) {
private void trackEvent(String category, String action, String label, int value){
tracker.trackEvent(category, action, label, value);
}

private void setCustomVar(int index, String label, String value, int scope) {
tracker.setCustomVar(index, label, value, scope);
}
}
21 changes: 19 additions & 2 deletions Android/Analytics/www/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,29 @@ Analytics.prototype.trackEvent = function(category, action, label, value, succes
typeof label === "undefined" ? "" : label,
(isNaN(parseInt(value,10))) ? 0 : parseInt(value, 10)
]);
}
};

Analytics.prototype.setCustomVar = function(index, label, value, scope, successCallback, failureCallback){
return PhoneGap.exec(
successCallback,
failureCallback,
'GoogleAnalyticsTracker',
'setCustomVariable',
[
(isNaN(parseInt(index,10))) ? 0 : parseInt(index, 10),
label,
value,
(isNaN(parseInt(scope,10))) ? 0 : parseInt(scope, 10)
]);
};

/**
* Load Analytics
*/
PhoneGap.addConstructor(function() {
PhoneGap.addPlugin('analytics', new Analytics());
PluginManager.addService("GoogleAnalyticsTracker", "com.phonegap.plugins.analytics.GoogleAnalyticsTracker");

// @deprecated: No longer needed in PhoneGap 1.0. Uncomment the addService code for earlier
// PhoneGap releases.
// PluginManager.addService("GoogleAnalyticsTracker", "com.phonegap.plugins.analytics.GoogleAnalyticsTracker");
});
Loading