Hi there, i am a student creating an app. But having some problems, i still cudn't found that what are the plugins and how we can use i used many from list but all they are not responding. Phonegap Team please help me i just want to create an app with camera(to capture images) and Call(to a particular number) how i can use them? I am using build.phonegap.com using dreamweaver. Thanks in advance. I also attached the screen shot of my app
- 724 Posts
- 3 Reply Likes
Posted 4 years ago
- 724 Posts
- 3 Reply Likes
Petra, I checked Sir, backbutton event is working as expected on offline page, but at index page iit's not working on back button it's showing last visited page, not exiting.
onOnline, onOffline and mybackButton callback should out from deviceready funtion?
onOnline, onOffline and mybackButton callback should out from deviceready funtion?
(Edited)
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Your code is correct.
However, how did you define your function 'exitApp'?
Is that function executed? Do you get a javascript error as soon as that function is called? Does it fail somewhere within that function? And where do you call navigator.app.exitApp?
However, how did you define your function 'exitApp'?
Is that function executed? Do you get a javascript error as soon as that function is called? Does it fail somewhere within that function? And where do you call navigator.app.exitApp?
- 724 Posts
- 3 Reply Likes
I didn't defined anywhere function exitApp, nor navigator.app.exitApp
I just used your code snippet .
Petra please tell me,, where i will defile it.
I just used your code snippet .
Petra please tell me,, where i will defile it.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
I just used your code snippet .
It was 'semi-code', remember? Not real code. It was just a piece of 'explanation' to show you along what lines it is done.
Have you looked up how to exit from an app in Android (doesn't work in iOS, anyway)?
Look, you must try and find solutions for these small, simple things yourself! You must learn that.
What if your app is live, and after a while, the client wants some changes? He expects you to be knowledgeable enough to do it....and I might not be around to hold your hand and do it for you.
It was 'semi-code', remember? Not real code. It was just a piece of 'explanation' to show you along what lines it is done.
Have you looked up how to exit from an app in Android (doesn't work in iOS, anyway)?
Look, you must try and find solutions for these small, simple things yourself! You must learn that.
What if your app is live, and after a while, the client wants some changes? He expects you to be knowledgeable enough to do it....and I might not be around to hold your hand and do it for you.
- 724 Posts
- 3 Reply Likes
You are right always Petra, I must.
If I did yet, then I will do ahead too :) Thank you.
You are true Teacher. Perhaps therefore from beginning u didn't told me complete source code. :) By d way. It's u, who taught me all, even it's jquery, or javascript or php :) thankful to u
If I did yet, then I will do ahead too :) Thank you.
You are true Teacher. Perhaps therefore from beginning u didn't told me complete source code. :) By d way. It's u, who taught me all, even it's jquery, or javascript or php :) thankful to u
(Edited)
- 724 Posts
- 3 Reply Likes
petra, wher i am doing mistake?
<script>$(document).ready(function() {
document.addEventListener("offline", onOffline, false);
document.addEventListener("online", onOnline, false);
document.addEventListener("backbutton", mybackButton, false);
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
if(navigator && navigator.network && navigator.network.connection && navigator.network.connection.type == Connection.NONE) {
$( ":mobile-pagecontainer" ).pagecontainer( "load", "offline.html", {transition:'flip' } );
}
var x = $('#maperror');
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError,{enableHighAccuracy: true, timeout: 20000});
}
else {
$("#maperror").text("Geolocation is not supported by this browser.");
}
function showPosition(position) {
$("#lat").val(position.coords.latitude);
$("#lon").val(position.coords.longitude);
var latlon =position.coords.latitude+","+position.coords.longitude;
var img_url = "http://maps.googleapis.com/maps/api/staticmap?mytimestamp="+new Date().getTime()+"¢er="+latlon+"&zoom=18&size=220x220&sensor=false&markers="+latlon+"&size:mid%7Ccolor:0xff0000%7Clabel:%7Camroha,+uttar+pradesh&visual_refresh=true";
$("#mapholder").html("<img src='"+img_url+"'>");
}
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
$("#maperror").text("User denied the request for Geolocation.");
break;
case error.POSITION_UNAVAILABLE:
$("#maperror").text("Location information is unavailable.");
break;
case error.TIMEOUT:
$("#maperror").text("Google Map couldn't loaded, Please reload the page to get user location! Also Make sure you are outdoors.");
break;
case error.UNKNOWN_ERROR:
$("#maperror").text("An unknown error occurred.");
break;
}
}
}
function onOnline() {
// Only go back if user went to offline.html
if ($.mobile.activePage[0].baseURI.indexOf("offline.html") > -1) {
$.mobile.back();
}
}
function onOffline() {
$( ":mobile-pagecontainer" ).pagecontainer( "change", "offline.html", {transition:'flip' } );
}
function mybackButton(e) {
if ($( ":mobile-pagecontainer" ).pagecontainer( "getActivePage" )[0].id=="page") {
exitAppPopup();
}
else if ($( ":mobile-pagecontainer" ).pagecontainer( "getActivePage" )[0].id=="offline") {e.preventDefault();}
}
function exitAppPopup() {
navigator.notification.confirm(
'Do you really want to exit from AmroClean?'
, function(button) {
if (button == 2) {
navigator.app.exitApp();
}
else if(button ==1)
{
history.back();
}
}
, 'Exit'
, 'No,Yes'
);
return false;
}
});
</script>
<script>$(document).ready(function() {
document.addEventListener("offline", onOffline, false);
document.addEventListener("online", onOnline, false);
document.addEventListener("backbutton", mybackButton, false);
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
if(navigator && navigator.network && navigator.network.connection && navigator.network.connection.type == Connection.NONE) {
$( ":mobile-pagecontainer" ).pagecontainer( "load", "offline.html", {transition:'flip' } );
}
var x = $('#maperror');
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError,{enableHighAccuracy: true, timeout: 20000});
}
else {
$("#maperror").text("Geolocation is not supported by this browser.");
}
function showPosition(position) {
$("#lat").val(position.coords.latitude);
$("#lon").val(position.coords.longitude);
var latlon =position.coords.latitude+","+position.coords.longitude;
var img_url = "http://maps.googleapis.com/maps/api/staticmap?mytimestamp="+new Date().getTime()+"¢er="+latlon+"&zoom=18&size=220x220&sensor=false&markers="+latlon+"&size:mid%7Ccolor:0xff0000%7Clabel:%7Camroha,+uttar+pradesh&visual_refresh=true";
$("#mapholder").html("<img src='"+img_url+"'>");
}
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
$("#maperror").text("User denied the request for Geolocation.");
break;
case error.POSITION_UNAVAILABLE:
$("#maperror").text("Location information is unavailable.");
break;
case error.TIMEOUT:
$("#maperror").text("Google Map couldn't loaded, Please reload the page to get user location! Also Make sure you are outdoors.");
break;
case error.UNKNOWN_ERROR:
$("#maperror").text("An unknown error occurred.");
break;
}
}
}
function onOnline() {
// Only go back if user went to offline.html
if ($.mobile.activePage[0].baseURI.indexOf("offline.html") > -1) {
$.mobile.back();
}
}
function onOffline() {
$( ":mobile-pagecontainer" ).pagecontainer( "change", "offline.html", {transition:'flip' } );
}
function mybackButton(e) {
if ($( ":mobile-pagecontainer" ).pagecontainer( "getActivePage" )[0].id=="page") {
exitAppPopup();
}
else if ($( ":mobile-pagecontainer" ).pagecontainer( "getActivePage" )[0].id=="offline") {e.preventDefault();}
}
function exitAppPopup() {
navigator.notification.confirm(
'Do you really want to exit from AmroClean?'
, function(button) {
if (button == 2) {
navigator.app.exitApp();
}
else if(button ==1)
{
history.back();
}
}
, 'Exit'
, 'No,Yes'
);
return false;
}
});
</script>
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
petra, wher i am doing mistake?
You want me to find a mistake, if any, in this part of your script?
Could you please describe what is going wrong, first?
- do you get an error message? If so, which one?
- does anything happen during the test, which you don't want to happen? If so, what?
- does anything not happen during the test, which you actually want to happen? If so, what?
- doesn't the app launch? does it freeze?
- does your device explode?
You want me to find a mistake, if any, in this part of your script?
Could you please describe what is going wrong, first?
- do you get an error message? If so, which one?
- does anything happen during the test, which you don't want to happen? If so, what?
- does anything not happen during the test, which you actually want to happen? If so, what?
- doesn't the app launch? does it freeze?
- does your device explode?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- Which line of code fails to get executed?
- Is the request sent successfully from the client?
- Is the request received by the server?
- Is a query sent to the database?
- Does the database return the correct values?
- Does the server get to the point that a reply is being returned?
- Is the json object filled correctly?
- Does the client receive that json object?
- Is the json object still filled correctly?
- Is the client's callback function executed properly?
Look, these are the steps you have to check one-by-one. That's how you debug such a process.
Once you find the problem, which can be anywhere within these steps, you must fix it.
- Is the request sent successfully from the client?
- Is the request received by the server?
- Is a query sent to the database?
- Does the database return the correct values?
- Does the server get to the point that a reply is being returned?
- Is the json object filled correctly?
- Does the client receive that json object?
- Is the json object still filled correctly?
- Is the client's callback function executed properly?
Look, these are the steps you have to check one-by-one. That's how you debug such a process.
Once you find the problem, which can be anywhere within these steps, you must fix it.
- 724 Posts
- 3 Reply Likes
I will see okay all these steps, but i dont know why, it's populating in local database?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
You might suspect that some whitelisting is wrong, then. You would find that issue once you check all above things. Most likely, already step-2 fails.
Alternatively, since you are using another database now, you might have no data in the database, or an sql query might fail.
Alternatively, since you are using another database now, you might have no data in the database, or an sql query might fail.
(Edited)
- 724 Posts
- 3 Reply Likes
Whitelisting I have added already see:
And also server-client communication is already running.
<access origin="http://amroclean.esy.es"; subdomains="true" />
I didn't used another table for it. I just import it from local host to remote server. The same table is on server as localhost.
By d way yes I am testing now.
And also server-client communication is already running.
<access origin="http://amroclean.esy.es"; subdomains="true" />
I didn't used another table for it. I just import it from local host to remote server. The same table is on server as localhost.
By d way yes I am testing now.
- 724 Posts
- 3 Reply Likes
Yeahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh wooooooooooooooooooooooooooooooooooooooo Petraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
my app is complete now............ I did I did yes I did...............
of course with the help of u :D
Thanks
thnk u tooooooooooooooooooooooooo much
I wiill always remeber u in my prayer :)
my app is complete now............ I did I did yes I did...............
of course with the help of u :D
Thanks
thnk u tooooooooooooooooooooooooo much
I wiill always remeber u in my prayer :)
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
See?
Piece of cake.
Piece of cake.
- 724 Posts
- 3 Reply Likes
Petra, when a user will file a complaint, he will got a unique 8 digits randomly generated number, he will remember this number, to check his complaint number, for example if a user registered a complaint with 78877675 complaint number, he can click "Check Complaint Status" button. If his complaint is still in the progress, he will get message: Dear Saba, You complaint is still in the progress, your patience is appreciated. And when an NPP employee will get report that particular problem has been solved with this unique number, he will quick update database with problem solved status, and after some time when user will check again, he can get message, Your problem is solved. Regards: NPP. This is the all process.
Who is your Programmer, can you tell me his full name?
Who is your Programmer, can you tell me his full name?
- 724 Posts
- 3 Reply Likes
Petra, when a user will file a complaint, he will got a unique 8 digits randomly generated number, he will remember this number, to check his complaint number, for example if a user registered a complaint with 78877675 complaint number, he can click "Check Complaint Status" button. If his complaint is still in the progress, he will get message: Dear Saba, You complaint is still in the progress, your patience is appreciated. And when an NPP employee will get report that particular problem has been solved with this unique number, he will quick update database with problem solved status, and after some time when user will check again, he can get message, Your problem is solved. Regards: NPP. This is the all process.
Who is your Programmer, can you tell me his full name?
Who is your Programmer, can you tell me his full name?
- 724 Posts
- 3 Reply Likes
Petra, when a user will file a complaint, he will get a unique 8 digits randomly generated number, he will remember this number, to check his complaint number, for example if a user registered a complaint with 78877675 complaint number, he can click "Check Complaint Status" button. If his complaint is still in the progress, he will get message: Dear Saba, You complaint is still in the progress, your patience is appreciated. And when an NPP employee will get report that particular problem has been solved with this unique number, he will quick update database with problem solved status, and after some time when user will check again, he can get message, Your problem is solved. Regards: NPP. This is the all process.
Who is your Programmer, can you tell me his full name?
Who is your Programmer, can you tell me his full name?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
OK. Great. When will the app be in the Play Store?
(My programmer never offered me a business card or even spoke an introduction. I just call that person My Programmer)
(My programmer never offered me a business card or even spoke an introduction. I just call that person My Programmer)
- 724 Posts
- 3 Reply Likes
In Shaa Allah soon you can see in the google app store.
Ok Petra, :)
What happened to this site? I am trying to post here since two days. But everytime it's going failed.
Ok Petra, :)
What happened to this site? I am trying to post here since two days. But everytime it's going failed.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Don't know what happened. But it works now.
(Edited)
- 724 Posts
- 3 Reply Likes
Hi Petra, I can't forget your Help :) . I remember you always in my prayers. :)
Take Care
Take Care
- 724 Posts
- 3 Reply Likes
Hello Petra, Greetingssss....
Hope you are good there :)
Hope you are good there :)
- 724 Posts
- 3 Reply Likes
Hi, Petra i am in a big trouble.
- Why PGB is unable to Build android apps now?
- NPM updated their plugin's versions may be, then PGB why can not support them?
- Will it solve in future?
- Or Is there any way to rebuild android apps successfully?
- 724 Posts
- 3 Reply Likes
Hi Bot? How are you Petra, hope that you are well. :)
- 724 Posts
- 3 Reply Likes
Hi, Petra How are you?
I am still getting notifications from Phonegap Build, I hope that you are getting too. I have started to develop my third app now. Yes all credit goes to YOU. Thank You
I CAN NOT forget your favors.
Stay Bless
I am still getting notifications from Phonegap Build, I hope that you are getting too. I have started to develop my third app now. Yes all credit goes to YOU. Thank You
I CAN NOT forget your favors.
Stay Bless
- 724 Posts
- 3 Reply Likes
Hi, Petra Verba, Hope that you are fine, you must be fine there, I pray for you. I can't forget your help and favor. Thanks again.
I was reading old chat here, and now am laughing on my stupid questions. Really you have taught me alot.
Whenever you live, live happy.
I was reading old chat here, and now am laughing on my stupid questions. Really you have taught me alot.
Whenever you live, live happy.
- 724 Posts
- 3 Reply Likes
Salam Petra Verba or BOT :D
How are you? hope that u r fit and fine there.
Thanks alot for your help, it is still helping me :)
How are you? hope that u r fit and fine there.
Thanks alot for your help, it is still helping me :)
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers
-
Plugins
- 1283 Conversations
- 38 Followers

