Sunday, 13 April 2014

Integration of Database in Android using Phonegap.

Hello Friends,


Today we are going to see How we can manage the database in Android using Phonegap.

For more videos please follow this channels
Please get the latest details about programming
visit our website
http://webconnect.0fees.net/

1) Create the New Phonegap Project. See Here

2) Add this code to your index.html page under Project=>asset=>www=>index.html


3) Now you will get the following UI.


4) When ever you want to use the storage API then you must check this that cordova loaded successfully loaded in DOM or not.
document.addEventListener("deviceready","onDeviceReady",false);
function onDeviceReady() {
      alert("Cordova is loaded successfully.")

}



5) Write this Code for Creating the Database "Student"




6) Write this code for Inserting record to the Database.


7) at last you will get this output.



For more videos please follow this channels
Please get the latest details about programming
visit our website
http://webconnect.0fees.net/


Thank You
Abhishek Bendre

Event Life Cycle of Phonegap API.

Hello Friends,

Today, we are going to see how we can use the different of Phonegap API.

here is the list of event which we can use in our application.

For more videos please follow this channels
Please get the latest details about programming
visit our website
http://webconnect.0fees.net/

1) ondeviceready:
                      This event fires when the cordova is successfully loaded into the DOM. just like the load event of the document.
2) pause:
                      This event fires when an application puts into the background mode.
3) resume:
                     This event fires when an application is in foreground mode. (back into active state)
4) online:
                    This event fires when an application goes online or device is connected to the internet.
5) offline:
                   This event fires when an application goes offline or device is not connected to the internet.
6) backbutton:
                   This event fires when the user press the backbutton.
7) batterycritical:
                   This event fires when the battery reaches the critical level threshold. and this value is device-specific.
8) batterylow:
                    This event fires when the battery reaches the low level threshold.
9) batterystatus:
                   This event fires when the battery status changed at list one percentage (1%)
10) menubutton:
                   This event fires when the user press the menu button.
11) searchbutton:
                  This event fires when the user press the search button.
            
12) startcallbutton:
                 This event fires when the user press the start call button.
13) endcallbutton:
                 This event fires when the user end the call.
14) volumedownbutton:
                 This event fires when the user incress the volume. (Supported by Blackberry)
15) volumeupbutton:
                 This event fires when the user decress the volume.(Supported by Blackberry)


Now, we are using the some of event in this demo

1) Create your Phonegap project. Seehere

2) Open your index.html page and write this code into you page.



3) After, run this application.



For more videos please follow this channels
Please get the latest details about programming
visit our website
http://webconnect.0fees.net/


Thank You
Abhishek Bendre

How to Use Notification in Android using Phonegap API.

Hello Friends,


Today,  we are going to see how we can manage the dialogs or Notification in android using phonegap API.

For more videos please follow this channels
Please get the latest details about programming
visit our website
http://webconnect.0fees.net/

Create New Project called NotificationProject using Nodejs Command prompt.

1) Open Nodejs command Prompt and fire the below command.
cordova create NotificationProject web.connect NotificationProject
cd > NotificationProject
cordova platforms add android

cordova build




2) Add the dialog plugin to our project. Dont forgot to build after adding plugin to project
in the same directory

cordova plugin add "org.apache.cordova.dialog"



3) Import project to Eclipse. See this blog
4) Add button to your index.html page.

5) call a function ShowAlert on button click.


6) Add the following code to this function.

navigator.notification.alert("This is alert",null,"Information","OK");



7) For Confirm Dialog:
navigator.notification.confirm("Do you want to close this window?",result,"Confirmation","Yes,No");
function result(btnIndex) {
      if(btnIndex == 1) {
            navigator.notification.alert("You have clicked on Yes Button.",null,"Information","OK");
      }

}



8) For prompt dialog. This will prompt an alert and accepts the input from alert.
navigator.notification.prompt("Enter your Name?",result,"Get Name",['OK','Cancel'],"Default Name");
function result(returnValue) {
       navigator.notification.alert(returnValue,null,"Information","OK");

}


For more videos please follow this channels
Please get the latest details about programming
visit our website
http://webconnect.0fees.net/

Thank You
Abhishek Bendre