jQuery.sap.includeScript("/webapp/src/src/cordova.js");
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("jatin.app.barcode.controller.Main", {
onScan: function () {
cordova.plugins.barcodeScanner.scan(this.scanSuccessCallback,this.scanErrorCallback);
},
scanSuccessCallback: function(result) {
alert(result.text);
},
scanErrorCallback: function(error) {
navigator.notification.alert("Scanning failed: " + JSON.stringify(error));
}
});
});
jQuery.sap.includeScript("/webapp/src/src/cordova.js");
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("jatin.app.geolocation.controller.Main", {
onGetLocation:function(){
navigator.geolocation.getCurrentPosition(this.onSuccess2, this.onError2);
},
onSuccess2:function(position){
alert('Latitude: ' + position.coords.latitude + '\n' +
'Longitude: ' + position.coords.longitude + '\n' +
'Altitude: ' + position.coords.altitude + '\n' +
'Accuracy: ' + position.coords.accuracy + '\n' +
'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' +
'Heading: ' + position.coords.heading + '\n' +
'Speed: ' + position.coords.speed + '\n' +
'Timestamp: ' + position.timestamp + '\n');
},
onError2:function(){
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
}
});
});
jQuery.sap.includeScript("/webapp/src/src/cordova.js");
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("jatin.app.controller.Main", {
getDeviceInfo:function(){
var dev="Serial No"+device.serial;
dev+="Cordova version"+device.cordova;
dev+= "device model"+device.model;
dev+= "device platform"+device.platform;
dev+= "device uuid"+device.uuid;
dev+="device version"+device.version;
dev+="device manufacturer"+device.manufacturer;
alert(dev);
}
});
});
jQuery.sap.includeScript("/webapp/src/src/cordova.js");
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("jatin.app.contact.controller.Main", {
coRead: function(){
var options = new ContactFindOptions();
options.filter="";
options.multiple=true; // return multiple results
var fields = ["displayName", "name"];
navigator.contacts.find(fields, this.onSuccess1, this.onError1, options);
},
onSuccess1:function(contacts){
var aco="";
for (var i=0; i<contacts.length; i++) {
//alert("Display Name = " + contacts[i].displayName);
aco+=contacts[i].displayName;
}
alert(aco);
},
onError1:function(){
alert('onError!');
}
});
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
12 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |