Created by Alex Hripak / @alexh58
You = Excellent web developer
Client = Thinks you know everything "techy"
We love our current Drupal website, but we want a mobile app now too. You guys do that, right?
Your ideal option.
Difficult to maintain multiple themes.
Only use if you need device features!
navigator.camera.getPicture(onSuccess, onFail, {
quality : 50,
destinationType : Camera.DestinationType.DATA_URL
});
function onSuccess(data) {
$('#myImage').attr('src', "data:image/jpeg;base64," + data);
}
function onFail(message) {
alert('Failed because: ' + message);
}
Pull up the camera, and put the contents into an image.
var user = {
username : 'test',
password : 'password'
};
$.ajax({
url : "http://localhost/api/user/login.json",
type : 'post',
data : $.param(user),
dataType : 'json',
error : function() {
console.log("Failed to login");
},
success : function(data) {
console.log("Logged in!");
}
});
Here the end point name is api.
data
attributes<div data-role="page">
<div data-role="header">
<h1>My Cool App</h1>
</div>
<div data-role="content">
<p>Your Content or listviews go here</p>
</div>
</div>
Slides and demo available at