如何在Eclipse中为Android调试Javafx应用程序 [英] how to debug a javafx application for android in eclipse

查看:91
本文介绍了如何在Eclipse中为Android调试Javafx应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个大型JavaFX应用程序,该应用程序在桌面上可以正常运行. 在Android中,其大小约为20 MB.

I create a big JavaFX application that works fine in desktop. In Android, its size is about 20 Mbytes.

现在,为了将其部署到Android,我已经安装了Gluon(JavaFxPorts). 使用一个小程序(使用JavaFX转换概念,时间线等),我通过调用androidInstall gradle任务生成了一个.apk.效果很好,除非我无法在手机中自动安装.apk文件.我确实将台式机上的内容复制/粘贴到了手机上.

Now, for deploying it for Android, I have installed Gluon (JavaFxPorts). With a small program (using the JavaFX transitions notions, timeline, ...), I have generated an .apk by calling the androidInstall gradle task. That works fine, except I cannot automatically install the .apk file in my phone. I do copy/paste from my desktop to my phone.

但是,当我想对大型应用程序执行相同的过程时,最后,我的手机屏幕已经是黑色的.

BUT, when I want to do the same process with my big application, at the end, my phone screen is already black.

因此,即使这个大型应用程序在我的桌面上可以正常工作,也有必要在我的桌面上为Android对其进行调试.但是,我不知道该怎么办? 与apkDebug gradle任务怎么办..? gluon + gradle没有提供一种Android模拟器,该模拟器无法通过其特定功能(屏幕尺寸,横向)在智能手机上完成桌面调试.你同意吗?

Therefeore, even if this big application works fine on my desktop, it is necessary to debug it for Android on my desktop, too. But, I don't know how to? What to do with apkDebug gradle task, ..? gluon+gradle does not provide a kind of Android emulator that allows to finalize the debug on desktop for a smartphone with its specific features (size of screen, landscape orientation). Do you agree?

允许执行此操作的其他工具是什么?

What is the additional tool that allows to do that?

此外,当应用程序部署在智能手机中时,它是否存在允许在智能手机上完成调试的工具?

Moreover,when the application is deployed in the smartphone, does it exist a tool that allows to finalize the debug on smartphone?

感谢您的回复

注意:我已经在Eclipse中安装了Android SDK管理器及其AVDM,但是由于使用了JavaFX,因此无法使用它,不是吗?

Note: I have installed Android SDK manager and its AVDM in Eclipse, but with the JavaFX use, it is impossible to use it, isn't it?

推荐答案

到目前为止,在Android模拟器上调试JavaFX项目仍无法正常进行.

Debugging JavaFX projects on Android so far doesn't work on Android emulators.

命令行

通常的方法是将消息记录到控制台(即System.out.println()Log.v() ...),然后使用adb logcat.

The usual approach is just log messages to the console (i.e. System.out.println() or Log.v()...), and then using adb logcat.

在命令行上,转到您的Android sdk文件夹,进入platform-tools文件夹并运行adb logcat -v threadtime.这将为您提供设备中的所有日志消息,因此您需要在其中找到FXActivity pid并对其进行过滤.

On command line, go to your Android sdk folder, enter into the platform-tools folder and run adb logcat -v threadtime. That will give you all the log messages from your device, so you'll need to find your FXActivity pid there and filter through it.

另一种可能性是在tools文件夹下使用Android的monitor,这是一个GUI工具,可以过滤控制台消息.

Another possibility is using Android's monitor under the tools folder, a GUI tool that will allow filtering the console messages.

Eclipse

有一个用于Eclipse的ADT插件,可以在

There is an ADT plugin for Eclipse, that can be installed following this question. This will allow you displaying logCat and device windows among others. Basically this will offer the same options as the monitor tool.

但是,此 似乎不适用 logcat.

However, this doesn't seem to work with recent versions of logcat.

Android Studio

您可以使用Android Studio导入gradle项目并启用Android框架,因此您可以打开Android Monitor,轻松过滤logcat消息,或切换到带有实时内存,cpu图表的Monitor选项卡.

You can import your gradle project with Android Studio and enable the Android framework, so you can open the Android Monitor, and easily filter the logcat messages, or switch to the monitor tab with live charts of memory, cpu, ...

黑屏

黑屏通常表示您有一些异常,因此您需要使用上述任何一种日志记录方法来对其进行跟踪,解决并重试.

Typically a black screen means you have some exception going on, so you need to use any of the above mentioned logging methods to track it down, solve it and try again.

这篇关于如何在Eclipse中为Android调试Javafx应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆