Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: I used Java2Pas for Java Class, But There are too many .PAS Files.



Permlink Replies: 5 - Last Post: Dec 29, 2016 1:01 PM Last Post By: Eli M
İbrahim Ak

Posts: 23
Registered: 5/23/16
I used Java2Pas for Java Class, But There are too many .PAS Files.
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2016 3:01 AM
Hi; Previously I asked question about Java2OP.exe (Link: https://forums.embarcadero.com/thread.jspa?threadID=245266&tstart=0). But I get error. So, I found an alternative is Java2Pas. I ran this command: Java2Pas.exe TimePickerDialog.java

TimePickerDialog.java: https://paste.ubuntu.com/23705191/

But I see too many .pas files: https://s30.postimg.org/dmhnq2tgh/unnamed.png
Which I use .pas files for Delphi XE 10.1 Android? Thanks.

Edited by: İbrahim Ak on Dec 29, 2016 3:08 AM
Eli M

Posts: 1,346
Registered: 11/9/13
Re: I used Java2Pas for Java Class, But There are too many .PAS Files.
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2016 9:36 AM   in response to: İbrahim Ak in response to: İbrahim Ak
You only need (plus any ones that those include):

import android.app.TimePickerDialog;
import android.content.Context;
import android.widget.TimePicker;
import android.widget.Toast;
İbrahim Ak

Posts: 23
Registered: 5/23/16
Re: I used Java2Pas for Java Class, But There are too many .PAS Files.
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2016 11:34 AM   in response to: Eli M in response to: Eli M
Eli M wrote:
You only need (plus any ones that those include):

import android.app.TimePickerDialog;
import android.content.Context;
import android.widget.TimePicker;
import android.widget.Toast;

Thanks, but I added necessary .pas files and I get this error: "android.widget.TimePicker not found." I copied Java2Pas.exe to "C:\Users\UserName\AppData\Local\Android\Sdk\sources\android-24\android\widget" path. Then I ran this command : Java2Pas.exe TimePicker.java, but I get this error:

===============
TimePicker.java
===============
Magic: 2F2A0A20
!Error: Exception: File invalid

Image: https://s28.postimg.org/5prcmvjp9/xxx.png

How to I compile this Java Class?
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: I used Java2Pas for Java Class, But There are too many .PAS Files. [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2016 11:47 AM   in response to: İbrahim Ak in response to: İbrahim Ak
İbrahim Ak wrote:

Thanks, but I added necessary .pas files and I get this error: "android.widget.TimePicker not found."

Why not just use the TimePicker that has been imported already (JTimePicker)? It's in Androidapi.JNI.Widget

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

Posts: 23
Registered: 5/23/16
Re: I used Java2Pas for Java Class, But There are too many .PAS Files. [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2016 12:40 PM   in response to: Dave Nottage in response to: Dave Nottage
Dave Nottage wrote:
İbrahim Ak wrote:

Thanks, but I added necessary .pas files and I get this error: "android.widget.TimePicker not found."

Why not just use the TimePicker that has been imported already (JTimePicker)? It's in Androidapi.JNI.Widget

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

Thanks for information. I found this api list: http://docwiki.embarcadero.com/RADStudio/Seattle/en/Using_the_Built-in_RAD_Studio_Java_Libraries_for_Android
There is a documentation for this libraries? How can I use this libraries?

Why I use TimePickerDialog? Because TimePickerDialog different appears on Android 4.4 and Android 5.0+. Look at the Images:
on Android 5+ : https://3.bp.blogspot.com/-4R-4NGV0KUA/VSfeBpec4gI/AAAAAAAAWzM/e53x6DGmZZw/s640/AndroidTimePickerDialog3.png
on Android 4.4: http://www.android-examples.com/wp-content/uploads/2016/02/TimePickerDialog-2.png

Can I see Android 5+ view with Android.Jni.Widget on my Android 6 device?

Also I want to learn how to call Java codes from Delphi for Android.
Eli M

Posts: 1,346
Registered: 11/9/13
Re: I used Java2Pas for Java Class, But There are too many .PAS Files. [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2016 1:01 PM   in response to: İbrahim Ak in response to: İbrahim Ak
This library wraps the Activity and Progress native dialogs on Android. Just copy the code and customize for the dialogs you are attempting to use.

https://github.com/ms301/FGX-FireMonkey
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02