Agoeng Liu
Agoeng Liu

Reputation: 702

How to run Java app in Android

Is it possible to run java app (jar) in my android application? 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. So I think, I can generate PDF in java and then included to android app.

Upvotes: 8

Views: 92343

Answers (6)

Krzysztof Cichocki
Krzysztof Cichocki

Reputation: 6412

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. I tested this setup last time in 2014, but I'm pretty sure you can do this nowadays as well. The app with Linux I get from play store as well app for the x client. The app I used back then was "Debian no ROOT" or smthg like this. You need to check what's currently available to make this setup in Google Play store according to your android version and your preferences. 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.

Upvotes: 0

ArshakParsa
ArshakParsa

Reputation: 61

If your program is a console program, the answer is yes. Install Jvdroid from Google play. Click terminal and then write this command: java -jar YourJarFileName.jar

Upvotes: 2

Himanshu
Himanshu

Reputation: 1

You can do it quite easily as there are many ways to run java apps on android. Specific application called Java Emulators can do it quite easily.

These are four most popular java emulators for android viz, JBED, PhoneME, Jblend and NetMite. 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.

Upvotes: -1

Andreas J
Andreas J

Reputation: 546

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 (e.g. who is the developer?)

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.

But then the app also registers the "android.intent.action.BOOT_COMPLETED" event (i.e. autostart after boot) and this would go against every description of the tool.

Ah yeah and giveaway: The apk has a folder "certs" that has some (root-)certificates. But those are not the real certificates of the authorities, e.g. 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.

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

Upvotes: 6

Mike Tang
Mike Tang

Reputation: 11

You can import java Third-party libraries into Android app, follow the steps here.

I am not sure whether it will work,but just try.

Upvotes: 1

Anish Antony
Anish Antony

Reputation: 895

You can use JBED. JBED is an .apk Android application which run java games and app on your android Device. JBED is a java android emulator, by using this application we can install .JAR/.JAD/Java/J2ME/MIDP app on android phones.

Upvotes: 0

Related Questions