简体   繁体   English

如何在Android中运行Java应用

[英]How to run Java app in Android

Is it possible to run java app (jar) in my android application?是否可以在我的 android 应用程序中运行 java 应用程序(jar)? Because I need to create PDF, the problem is if I generate PDF in android, only can show with small image, if it contains large image in many pages, it will be error.因为我需要创建PDF,问题是如果我在android中生成PDF,只能显示小图,如果在很多页面中包含大图,就会报错。 So I think, I can generate PDF in java and then included to android app.所以我想,我可以在 java 中生成 PDF 然后包含到 android 应用程序中。

Concernig the mentiones app JBED: Well honestly, I could not find any credible source for this tools JBED, so I would really be very cautious (eg who is the developer?)关注提及的应用程序 JBED:老实说,我找不到这个工具 JBED 的任何可靠来源,所以我真的会非常谨慎(例如,谁是开发人员?)

In the manifestfile (in Androidmanifest.xml, where every app has to state what rights it needs to run, see How to view AndroidManifest.xml from APK file? ) there are many rights mentioned (what could be necessary, as the app wants to run as an emulator), so a java application might want to send an SMS, record audio, take pictures and place calls -- so the emulator would need those rights as well.在清单文件中(在 Androidmanifest.xml 中,每个应用程序都必须说明它需要运行哪些权限,请参阅如何从 APK 文件查看 AndroidManifest.xml? )中提到了许多权限(可能需要哪些权限,因为应用程序想要作为模拟器运行),因此 Java 应用程序可能想要发送短信、录制音频、拍照和拨打电话——因此模拟器也需要这些权限。

But then the app also registers the "android.intent.action.BOOT_COMPLETED" event (ie autostart after boot) and this would go against every description of the tool.但随后该应用程序还会注册“android.intent.action.BOOT_COMPLETED”事件(即启动后自动启动),这将与该工具的每个描述背道而驰。

Ah yeah and giveaway: The apk has a folder "certs" that has some (root-)certificates.啊,是的,赠品:apk 有一个文件夹“certs”,其中包含一些(根)证书。 But those are not the real certificates of the authorities, eg Versign.但那些不是权威机构的真实证书,例如 Versign。 If one installs the app and by that those certificates the trust you might have in https-connections is lost because those who made the fake certificates can create own, false certificates that your phone would trust.如果安装了该应用程序,并且通过这些证书,您在 https 连接中可能拥有的信任就会丢失,因为制作假证书的人可以创建自己的手机会信任的虚假证书。

I assume (or am pretty sure) this is a spy tool, but I could be wrong.我假设(或者很确定)这是一个间谍工具,但我可能是错的。 The (rare) testimonials that claim the tool ran perfectly will probably be the same person that posted the tool under a different name.声称该工具运行良好的(罕见)推荐信可能是以不同名称发布该工具的同一个人。

Andreas安德烈亚斯

You can import java Third-party libraries into Android app, follow the steps here .您可以将 java 第三方库导入到 Android 应用程序中,请按照此处的步骤操作。

I am not sure whether it will work,but just try.我不确定它是否会起作用,但请尝试一下。

If your program is a console program, the answer is yes.如果您的程序是控制台程序,那么答案是肯定的。 Install Jvdroid from Google play.从 Google Play 安装 Jvdroid。 Click terminal and then write this command: java -jar YourJarFileName.jar单击终端,然后编写此命令: java -jar YourJarFileName.jar

The simplest way would be to some install terminal emulator and then install java and then you can run java apps on standard java. You can even install full Linux distro with x server without rooting the phone, then connect to it from x client and you have Linux desktop on android. Once I've even installed eclipse for java development on it and everything worked.最简单的方法是安装一些终端仿真器,然后安装 java,然后您可以在标准 java 上运行 java 应用程序。您甚至可以安装带有 x 服务器的完整 Linux 发行版,而无需手机生根,然后从 x 客户端连接到它,您就拥有了Linux 桌面在 android 上。一旦我安装了 eclipse 用于 java 开发,一切正常。 I tested this setup last time in 2014, but I'm pretty sure you can do this nowadays as well.我上次在 2014 年测试了这个设置,但我很确定你现在也可以这样做。 The app with Linux I get from play store as well app for the x client.带有 Linux 的应用程序我从 Play 商店以及 x 客户端的应用程序获得。 The app I used back then was "Debian no ROOT" or smthg like this.我当时使用的应用程序是“Debian no ROOT”或类似这样的smthg。 You need to check what's currently available to make this setup in Google Play store according to your android version and your preferences.您需要根据您的 android 版本和您的偏好,检查当前可用于在 Google Play 商店中进行此设置的内容。 Last time I've checked there was a lot of different tools for this kind of task.上次我检查过有很多不同的工具可以完成这种任务。 Lastly I've even successfully installed TF and keras on my android phone using terminal emulator.最后,我什至使用终端仿真器在我的 android 手机上成功安装了 TF 和 keras。

You can use JBED .您可以使用JBED JBED is an .apk Android application which run java games and app on your android Device. JBED 是一个 .apk Android 应用程序,可在您的 android 设备上运行 java 游戏和应用程序。 JBED is a java android emulator, by using this application we can install .JAR/.JAD/Java/J2ME/MIDP app on android phones. JBED 是一个 java android 模拟器,通过使用这个应用程序,我们可以在 android 手机上安装 .JAR/.JAD/Java/J2ME/MIDP 应用程序。

You can do it quite easily as there are many ways to run java apps on android.你可以很容易地做到这一点,因为有很多方法可以在 android 上运行 java 应用程序。 Specific application called Java Emulators can do it quite easily.称为 Java Emulators 的特定应用程序可以很容易地做到这一点。

These are four most popular java emulators for android viz, JBED, PhoneME, Jblend and NetMite.这些是适用于 android viz、JBED、PhoneME、Jblend 和 NetMite 的四种最流行的 Java 模拟器。 These are arranged in order of their preference.这些是按照他们的喜好顺序排列的。 You can use phoneme for non rooted device, however if your device is rooted try any of the remaining three applications.您可以将音素用于非 root 设备,但是如果您的设备已 root,请尝试其余三个应用程序中的任何一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM