5

As Embarcadero said :

"WebBrowser Does Not Accept Keyboard Input on Android

On Android devices, the on-screen keyboard is not available in a TWebBrowser control. This means that a user cannot complete a web form, for example. The TWebBrowser control should be used for displaying information or documents. User interaction should be performed with FireMonkey controls."

Link

This is very annoying if we have to use Clouds identification pages like Dropbox or Google Drive.

Using Delphi XE5 with REST components, I'm able to open the login pages, but the keyboard is not functional on Android.

So how can I use FireMonkey controls to perform interactions as Embarcadero said : User interaction should be performed with FireMonkey controls. ?

EDIT :

Delphi XE 6 seems to be the only nice solution :

Updates to TWebBrowser : The web browser available on Windows (SHDocVw.TWebBrowser) has been updated to the latest version of Internet Explorer.

Borongaj
  • 451
  • 4
  • 16
  • 1
    They probably mean that you can create your own (FireMonkey) form to collect user input, and create and send an appropriate HTTP POST request in code. Then you can display the response in the browser. – Ondrej Kelle Jan 03 '14 at 07:59
  • 1
    @TOndrej That is maybe the intention from emba, but not the intention from the cloud identification point of view – Sir Rufo Jan 03 '14 at 08:12
  • 1
    @SirRufo Sorry, I don't understand your comment. – Ondrej Kelle Jan 03 '14 at 08:26
  • 4
    Another win for native development tooling – David Heffernan Jan 03 '14 at 08:28
  • 2
    @TOndrej The intention for cloud identification is to identify yourself to any service without letting this service know your login data. – Sir Rufo Jan 03 '14 at 08:36
  • I looked for a solution to send user input from TEdit, but I don't know how to send HTTP POST with Firemonkey. Ok for another win, but I still need a TWebrowser... – Borongaj Jan 03 '14 at 08:50
  • 1
    @SirRufo Sorry, I don't understand how your comment is related. The problem here is that TWebBrowser doesn't accept user input so the workaround is to create an alternative UI to accept user input. – Ondrej Kelle Jan 03 '14 at 09:01
  • @TOndrej so users should type their Facebook or Google credentials into an untrusted app? – mjn Jan 03 '14 at 11:34
  • @mjn this approach to security is rather crude. – Free Consulting Jan 03 '14 at 11:49
  • 1
    @mjn Do they type their Facebook or Google credentials into the browser? In case they do, what makes the browser more trusted than your app? Otherwise, how is your app different from the browser if it performs exactly the same authentication procedure? – Ondrej Kelle Jan 03 '14 at 12:05
  • 1
    @tondrey for example the browser may be part of OS. Or just be trusted by user. It is perfectly normal if someone would trust you but not me. The question is rather how user can tell that the app does not fake browser-like popular form – Arioch 'The Jan 03 '14 at 13:52
  • 1
    @Borongaj regarding XE6 ... `has been updated to the latest version of Internet Explorer`: nice, but how exactly does this help on the *Android platform*? :) – mjn Apr 25 '14 at 09:55
  • @mjn : Virtual keyboard is now shown within your Android app. Using XE5, only iOS was able to show it. – Borongaj Apr 25 '14 at 17:42
  • You'll get the problem with hardware keys in exchange to the problem with onscreen keyboard inside a `TWebBrowser`. – naXa stands with Ukraine May 01 '14 at 23:12

2 Answers2

-1

The trick is give the focus to the WebBrowser component:

procedure TFormBrowserAdd.ButtonNavigateClick(Sender: TObject);
begin
  WebBrowser.CanFocus := True;
  WebBrowser.Navigate(EditUrl.Text);
  WebBrowser.SetFocus;
end;

But, after that the back key will not work correctly so you have to manage in other way. For example i have used a button on my form.

  • Thanks for reply Tolentino. But TWebBrowser already has focus on an input (e-mail or password) when the cloud identification page is loaded. How can I send text from a button to the TWebBrowser input ? – Borongaj Jan 06 '14 at 08:57
-2

you have to set foucs on web browser on end of loading page

procedure TfrmMain.BrowserDidFinishLoad(ASender: TObject);
begin
Browser.CanFocus := True;
Browser.SetFocus;
end;

Shadi Ajam
  • 136
  • 5