Saturday 15 March 2014

java - Can I push information back to phonegap without request? -


I am trying to develop an app on which there is a broadcast receiver when I get a phone call, So I want to be able to pass the number back to my Phonegap app. I am a web developer and I know that the nature of the web is pulling (lack of I / O), but it's still in a Java app, so one way is that I return those values ​​to my PhoneGap app Can I add it to the list?

  if (messages.length> gt; -1) {int period = toast.LENGTH_SHORT; Toast toast = toast Maketext (Reference, "Message Received:" + Message [0]. Gate Orientation Academy (period)); Toast.show ();    

To use data to push data to WebView Requires the sendJavaScript function of CordoveWebView (PhoneGap implemented WebView ), or the loadUrl function's WebView Use .

To use Cordova WebVive :

  mCordovaWebView.sendJavaScript ("pushDataFunc ('data')");  WebView  method to use   

:

  mWebView.loadUrl ("javascript: pushDataFunc ('data')") ;   

And if you are expanding DroidGap you can call the function on the activity:

  yourDroidGapActivity This.sendJavaScript ("pushDataFunc ('data')");    

No comments:

Post a Comment