Delphi Tokyo

Delphi Tokyo

Where can I find changes brings to Android platform ?
I cannot compile my project anymore :

PAndroid_app type is unknown
GetAndroidApp^ is unknown

I've search through the help but din't see anything on this...

FWIW I used this unit to capture Android keystrokes

https://pastebin.com/jpRpTCzx



TIA

Comments

  1. In Tokyo help you will see about "Unification of Delphi and Java threads on Android"
    And I suppose that as a result Androidapi.AppGlue unit was rewritten and TAndroid_app has gone.
    TAndroid_app was not in the documentation. You can only search in the sources to understand what's going on.

    ReplyDelete
  2. If you are searching for GetAndroidApp^.onInputEvent
    I think you should change with:
    TAndroidApplicationGlue.Current.OnInputEvent

    ReplyDelete
  3. Thank you Cristian Peța , I've already found the TAndroidApplicationGlue but missed it's "Current" property.

    I've adapted my code, it is compiling but my app is now crashing with 'Can not activate current context' exception... could be related to TFrameStand (digging this right now)

    ReplyDelete
  4. I've updated that code. It's now Delphi Tokyo compatible and it is well working on my barcode scanner

    pastebin.com - [Delphi] Delphi Tokyo - Android special key handler - Pastebin.com

    ReplyDelete
  5. Hi Stéphane Wierzbicki , i'm using your solution for barcode scanner, but with some honeywell devices , very often i log an ANR , with this error :
    Input dispatching timed out (Waiting to send key event because the focused window has not finished processing all of the input events that were previously delivered to it. Outbound queue length: 0. Wait queue length: 1.) ;
    have you same issue?
    thanks

    ReplyDelete
  6. Diego Rigoni for what I recall I've never seen this before. Is your code running from a worker thread or from the main ui ?

    ReplyDelete
  7. main thread. but nothing strange.... a "dataset append" and "editCode.setfocus" , just to receive incoming code in the right control.
    now error is changed in :
    Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 47. Wait queue head age: 5506.1ms.)
    i'll try soon with 10.2.2

    ReplyDelete
  8. Diego Rigoni I'm still using Delphi Berlin. I had too much trouble with Tokyo. You should check 10.2.2

    ReplyDelete

Post a Comment