npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

com.zendrive.phonegap.sdk

v2.3.4

Published

Phonegap plugin for the Zendrive SDK.

Downloads

1

Readme

zendrive-sdk-phonegap-plugin

This is the official plugin for Zendrive in Apache Cordova/PhoneGap!

Zendrive is commited to improving driving and transportation for everyone through better data and analytics. You can integrate zendrive-sdk-phonegap-plugin in your application to get Zendrive's driver centric analytics and insights for your fleet.

var processStartOfDrive = function(zendriveDriveStartInfo) { alert("processStartOfDrive: " + JSON.stringify(zendriveDriveStartInfo)); }; var processEndOfDrive = function(zendriveDriveInfo) { alert("processEndOfDrive: " + JSON.stringify(zendriveDriveInfo)); }; var processLocationDenied = function() { alert("Location denied, please enable location services to keep Zendrive working"); };

var zendriveCallback = new Zendrive.ZendriveCallback(processStartOfDrive, processEndOfDrive, processLocationDenied);

Zendrive.setup(config, zendriveCallback, function() { alert("Setup done!"); }, function (error) { alert("Setup failed: " + error); } );


<ul style="list-style-position: inside">
<li>If you don't have the ZENDRIVE_APPLICATION_KEY, sign up on the Zendrive Developer Portal and get the key.</li>
<li>The <DRIVER_ID> is an ID for the driver currently using the application. Each driver using the application needs a unique ID</li>
</ul>
<p>See the <a target="_blank" href="http://zendrive-root.bitbucket.org/phonegap/docs/jsdoc-2.0.0/Zendrive.html#.setup">SDK Reference</a> for more details about setup.</p>

<h4>Manual Trip Tagging</h4>
<p>The Zendrive SDK works in the background and automatically detects trips and tracks driving behaviour. However, some applications already have knowledge of point-to-point trips made by the driver using the application. For example - a taxi metering app. If your application has this knowledge, it can indicate that to the Zendrive SDK explicitly.</p>

Zendrive.startDrive(<TRACKING_ID>); // A non empty <TRACKING_ID> must be specified Zendrive.stopDrive(<TRACKING_ID>); // The <TRACKING_ID> should be same as passed in startDrive

<p>The &lt;TRACKING_ID&gt; can be used to find Zendrive trips with this ID in the <a href="https://developers.zendrive.com/docs/api/" target="_blank">Zendrive Analytics API</a>. See the <a href="http://zendrive-root.bitbucket.org/phonegap/docs/jsdoc-2.0.0/Zendrive.html#.startDrive" target="_blank">SDK Reference</a> for more details about these calls.</p>

<h4>Driving Sessions</h4>
<p>Some applications want to track multiple point-to-point trips together as a single entity. For example, a car rental app may want to track all trips made by a user between a rental car pickup and dropoff as a single entity. This can be done using sessions in the Zendrive SDK.
Sessions can be used in the Zendrive SDK by making the following calls.</p>

Zendrive.startSession(<SESSION_ID>); // A non empty must be specified Zendrive.stopSession();

<p>All trips within a session are tagged with the session id. The session id can then be used to lookup Zendrive trips belonging to this session using the <a href="https://developers.zendrive.com/docs/api/" target="_blank">Zendrive Analytics API</a>. See the <a href="http://zendrive-root.bitbucket.org/phonegap/docs/jsdoc-2.0.0/Zendrive.html#.startSession" target="_blank">SDK Reference</a> for more details about these calls.</p>

<h4>Controlling Automatic Drive Detection</h4>
<p>The Zendrive SDK works in the background and automatically detects trips and tracks driving behaviour. If needed, an application can change this behaviour. For example, a rideshare app may want to automatically track all drives made by a driver only when the driver is on-duty and not collect any data for off-duty drives.</p>
<p>The application can specify the required behaviour via an additional argument during setup of the Zendrive SDK. ZendriveDriveDetectionModeAutoOFF disables automatic drive detection in the SDK.</p>

// ZendriveDriveDetectionMode.ZendriveDriveDetectionModeAutoOFF disables automatic drive detection in the SDK. config.driveDetectionMode = Zendrive.ZendriveDriveDetectionMode.ZendriveDriveDetectionModeAutoOFF;

<p>The application can also temporarily enable Zendrive's auto drive-detection. This can be done by setting the ZendriveDriveDetectionMode.</p>
<p> To Turn on automatic drive detection in the SDK.</p>

Zendrive.setDriveDetectionMode(Zendrive.ZendriveDriveDetectionMode.ZendriveDriveDetectionModeAutoON);

<p> To Turn off automatic drive detection in the SDK.</p>

Zendrive.setDriveDetectionMode(Zendrive.ZendriveDriveDetectionMode.ZendriveDriveDetectionModeAutoOFF);

<h4>Disable the SDK</h4>
<p>To disable the SDK at any point in the application, you can invoke this method. The Zendrive SDK goes completely silent after this call and does not track any driving behaviour again.</p>

Zendrive.teardown();

<p>The application needs to re-initalize the SDK to start tracking driving behaviour.</p>

<br/>
<br/>
<br/>