# svyPhonegap

## Overview

svyPhonegap is a service to provide native mobile functionality from a Servoy application. This guide will help you integrate and build your first mobile app using the service.

## Getting Started

Once you've gotten your main Servoy solution created, install the Phonegap Module. This is available under the [Servoy Package Manager](https://docs.servoy.com/reference/servoy-developer/package-manager). Alternatively you can also download this module directly from our [github repository](https://github.com/servoy/svyPhonegap).

<figure><img src="https://3933488479-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjpWd52BKwABWxF2lScUK%2Fuploads%2Fgit-blob-8d24a5611cadf566c6de5fda58256811943ef95a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Initialize the module

Select your main solution and hook up the onOpen event to a new scope method.

<figure><img src="https://3933488479-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjpWd52BKwABWxF2lScUK%2Fuploads%2Fgit-blob-00fb890b730f4c86839889551a96b9d0b0ffa9d7%2Fd7.png?alt=media" alt=""><figcaption></figcaption></figure>

You can also hook up a callback method if you need access to native functionality as soon as the device is ready. Your code might look like below

```javascript
function onSolutionOpen(arg, queryParams) {
//initialize phonegap module
scopes.phonegap.onSolutionOpen(arg,queryParams, onReadyCallback);

}	

function onReadyCallback(){
//device is ready, get information from a plugin
application.output(plugins.svyphonegapDevice.getDeviceInfo());
}
```

## Integrating with your first plugin

Integration examples can be found per plugin for example the [Camera plugin guide](https://docs.servoy.com/guides/develop/programming-guide/extensions/modules/svyphonegap/camera).

## Working Example

To see a Servoy solution that utilizes this module check out [svyMobile](https://github.com/Servoy/svyMobile/).

## Building a mobile binary

Once you are satisfied with the main solution and code. We will want to be able to export and run this app on a mobile device. First [deploy](https://docs.servoy.com/guides/deploy) the Servoy solution. Then follow the [Building Native Binary](https://docs.servoy.com/guides/develop/mobile-development/exporting-to-an-app-store) guide.

## Documentation on specific services or plugins

For the web services to function, we need to have also installed the particular phonegap plugins mentioned.

[Browser](https://docs.servoy.com/guides/develop/programming-guide/extensions/modules/svyphonegap/browser) In-app browser related functions

[Camera](https://docs.servoy.com/guides/develop/programming-guide/extensions/modules/svyphonegap/camera) Camera and media functions

[Location](https://docs.servoy.com/guides/develop/programming-guide/extensions/modules/svyphonegap/location) Geolocation functionality

[Push Notifications](https://docs.servoy.com/guides/develop/programming-guide/extensions/modules/svyphonegap/push-notifications) Push Notification functionality
