modificato index.html e config.xml

inserito in index.html

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

inserito in config.xml:

<gap:plugin name="org.apache.cordova.device.Device"/>