8

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.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Agoeng Liu
  • 674
  • 3
  • 10
  • 30
  • `is it possible to run java app (jar) in my android application`, no Android does not support Java. Sorry. – Johan Oct 10 '13 at 03:27
  • possible duplicate of [how to Generate Pdf File with Image in android?](http://stackoverflow.com/questions/6674059/how-to-generate-pdf-file-with-image-in-android) – Johan Oct 10 '13 at 03:30
  • Java programs run everywhere where the JVM is installed. However android uses different VM - Dalvik. My guess would be you can do it only through emulator. – Evdzhan Mustafa Mar 06 '14 at 22:24

6 Answers6

6

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

Community
  • 1
  • 1
Andreas J
  • 526
  • 4
  • 18
1

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.

Mike Tang
  • 11
  • 4
1

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

fcdt
  • 2,371
  • 5
  • 14
  • 26
0

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.

Anish Antony
  • 875
  • 3
  • 17
  • 35
  • can be included with my android application ? how to combine into eclipse ? – Agoeng Liu Oct 10 '13 at 03:59
  • Your java application can include into JBED (which means your application will install inside JBED application). In eclipse development you need to develop it as separate java application and build jar and put the jar into your android device. Actually JBED act like a Virtual machine – Anish Antony Oct 10 '13 at 04:29
0

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.

Krzysztof Cichocki
  • 6,294
  • 1
  • 16
  • 32
-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.

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
  • Can you give a brief description of how to install at least one? The link isn't guaranteed to always work, which'll make your answer useless in the future – Chris Dec 26 '14 at 17:38
  • The link has broken, which makes this a pretty much useless answer. – Stephen C Feb 25 '18 at 10:55