Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to work Java codes from Delphi?



Permlink Replies: 4 - Last Post: Dec 27, 2016 4:06 PM Last Post By: Eli M
İbrahim Ak

Posts: 23
Registered: 5/23/16
How to work Java codes from Delphi?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 26, 2016 7:27 AM
Hi; I have got a Java code like this:------> https://paste.ubuntu.com/23688160/
I want to use this java method in Delphi. How can I do? Thanks.
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: How to work Java codes from Delphi?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 26, 2016 8:32 AM   in response to: İbrahim Ak in response to: İbrahim Ak
Am 26.12.2016 um 16:27 schrieb İbrahim Ak:
Hi; I have got a Java code like this:------> https://paste.ubuntu.com/23688160/
I want to use this java method in Delphi. How can I do? Thanks.

You can start by asking such a question in the
.delphi.platformspecific.android group, as people needing to call Java
APIs are more common over there ;-)

Greetings

Markus
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: How to work Java codes from Delphi?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 26, 2016 12:25 PM   in response to: İbrahim Ak in response to: İbrahim Ak
İbrahim Ak wrote:

I want to use this java method in Delphi. How can I do? Thanks.

Is there something that the MessageDialog function cannot do for you? It uses code very much like your example, from
the FMX Android library (in fmx.jar).

In any case, you won't be able to translate your example entirely into Delphi code; parts of it will need to be Java.

--
Dave Nottage [MVP, TeamB]
Hints, tips and tricks at: http://www.delphiworlds.com/blog
Onur KOCA

Posts: 31
Registered: 2/12/12
Re: How to work Java codes from Delphi?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 26, 2016 12:52 PM   in response to: İbrahim Ak in response to: İbrahim Ak
Mesaj kutusu gösterme; (bu kodu buton1 in altına koy, begin ile end; arasına.

MessageDlg('Fotoğraf Seçme İşleminiz Bittimi?', System.UITypes.TMsgDlgType.mtConfirmation,
[
System.UITypes.TMsgDlgBtn.mbNo,
System.UITypes.TMsgDlgBtn.mbYes
], 0,
procedure(const AResult: System.UITypes.TModalResult)
begin
case AResult of
mrYES:Begin End; // yes e tıklandı
mrNo:Begin End; // no ya tıklandı
end;
end);

şimdi yes e tıklanırsa, yes in begin end i arasına şunu yazmak lasım;
tabi bu kodun çalışması için Androidapi.JNI.Toast.pas dosyasını uses e eklenmen lasım.

Toast('evet e tıklandı', ShortToast);

yani şöyle olacak yukarıya bakarsak

mrYES:Begin Toast('evet e tıklandı', ShortToast); End; // toast mesajı kısa görünür shorttoast
mrNo:Begin Toast('hayır a tıklandı', LongToast); End; // toast mesajı uzun süre ekranda kalır longtoast

Edited by: Onur KOCA on Dec 26, 2016 1:00 PM
Eli M

Posts: 1,346
Registered: 11/9/13
Re: How to work Java codes from Delphi?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 27, 2016 4:06 PM   in response to: İbrahim Ak in response to: İbrahim Ak
https://github.com/ms301/FGX-FireMonkey/

TfgToast (UPDATED) - instant messaging display class
TfgFlipView - images slider. It supports multiple ways of switching the photos using effects and shifts. The first time you MUST read the instructions "TfgFlipView - Download Instructions style"
TfgPositionAnimation - animation TPosistion type properties
TfgPosition3DAnimation - animation TPosition3D type properties
TfgBitmapLinkAnimation - animation TBitmapLink type properties
TfgProgressDialog (UPDATED) - The component to display the dialog box at the time of performing a long background operation when the execution of a background operation can be estimated.
TfgActivityDialog (UPDATED) - the component to display the dialog box at the time of performing a long background operation, when the time of the operation is not possible to adequately assess.
TfgActionSheet (UPDATED) - analogue of the context menu for mobile platforms.
TfgColorsPanel - The palette of colors with a choice of colors.
TfgGradientEdit (UPDATED) - the gradient component.
TfgLinkedLabel (UPDATED) - Tag supports open Web links in the default browser.
TfgApplicationEvents (UPDATED) - a component with the ability to easily define handlers for the main event applications: Tracking application status change, a simple update and implementation of the Actions action, Changing the orientation of the device, and so on.
TfgVirtualKeyboard (UPDATED) - the component easier to work with a virtual keyboard. It allows you to set a custom button on the virtual keyboard for iOS, as well as to catch the event on the display and the keyboard is hidden.
(UPDATED) register all style objects on the tab "FGX: Style objects"
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02