How to press button in the internet programmatically - android

How do I invoke button clicks within page content of a TWebBrowser ? I have found this code for VCL and an older version of Delphi:
WebBrowser.OleObject.Document.GetElementByID('ID HERE').Click;
I am using XE5, developing for Android and iOS so I can not use the above code.
Any help or suggestions would be much appreciated. Thanks !

For Android: It is straight forward that you may need to write a JS function in web page and than you can call the JS function using JSInterfaces.
For iOS: You may call the instance method provided in UIWebView class to call the Javascript method. For reference please see : https://developer.apple.com/library/ios/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006950-CH3-SW21

Related

Flutter plugin that uses an EventChannel

I'm creating a flutter plugin that uses a 3rd party SDK
The SDK has an override method called onIdleTimeout(), when this method fires the SDK logs the users out, and pulls up a native login view.
I don't want this native login view to pop up, so when this onIdleTimeout() fires I want to send a message back to the Flutter dart code that is using my plugin to simply let it know that the onIdleTimeout() method has fired
I've looked at examples of using EventChannels but none of them show using event channels inside of an custom override method in native code
any help is much appreciated thank you, I'm starting with the Android/Kotlin side of the plugin so any kotlin examples would be great
Found out I can just use a BasicMessageChannel to send a message from native to dart

Worklight WL.Client.getUserName

I have a Worklight 6.2 app. I am modifying the android java code to subscribe to a notification sent via Bluemix. After the user logs in, I would like to register the device using the userid that gets created. Is there an API call that I can use within the android code that is the equivalent to WL.Client.getUserName, or should I be calling the java code from my javascript and passing the userName to the java code? Thanks for any suggestions.
JT
There is no Java equivalent to this. This is a Worklight API.
What you can do is use the new WL.App.sendActionToNative method in Worklight 6.2 for to send a value to your native code and from there do what you need with it.
WL.App.sendActionToNative(“doSomething”, { customData: 12345} );
Where customdData is the WL.Client.getUserName.
On the native side you then need to use WLActionReciever (see What's New).
You could also opt to implement a basic Cordova plug-in that will move data from the web to native view.
The tutorial in the Getting Started page is doing exactly that.

Attach to Like!andTweed function in cocos2d-x Android App

I created Android App that is made by cocos2d-x.
I'd like to implement cooperation function with social network service (facebook and twitter )
For example, Like! button which separate news feed.tweet function.
But This function turned out to be a can of worms which I couldn't finish.
I found EziSocial. but I can't find any hints.
would you give me a
description of how to use and method of attach to existing app
We have series of tutorials available on our website. http://ezibyte.com/tutorials/
Disclaimer: I am the creator of EziSocial Plugin

Adding JavaScript Interface to a Browser

Is it possible to add a JavaScript interface to the Android Browser the same way one can be added to the WebView Component as illustrated in this demo. My particular use case only needs JavaScript -> android so that I can send it back to the previous activity.
You can invoke methods and functions in your webview by using javascript url's, e.g.
webview.loadUrl("javascript:somemethod()");
You will, of course, need to enable javascript on your webview:
webview.getSettings().setJavaScriptEnabled(true);
This is from java to javascript. If you want to invoke java code / android API's from javascript, use addJavascriptInterface()
webview.addJavascriptInterface(new MyJSJavaBridge(), "api");
All of this is shown in the example url you posted as well.
You can do it using jsinterface.
First you need to make the browser jsinterface enabled and then you may call to Android method from the HTML of your browser.
You may , get a fair example and idea here ...
http://android-puremvc-ormlite.blogspot.com/2011/07/using-java-script-in-android-webview.html

On Android : making a phonecall using a browser application

On Android devices, does anyone has checked that if a user clicks on a link
<a href='wtai://wp/mc;5551231367' title='Call'>555.123.1367</a>
this would propose the user to make a call to this phone number ?
If not, do you know how is it possible to do it ?
The link needs to be
Call
so for the number you used:
Call 555.123.1367

Categories

Resources