How can I Run a .jar file in Java so that I can see the results? I this I will need to use Android Studio but I have no idea on how to do it. Please help.
To use class and method in .jar library file in android you have to use it as a module.To do this follow below steps
copy .jar file
navigate to android studio "project" folder
paste copied .jar to libs folder
right click on pasted file and click add as library
Android uses ART not JRE. So it can't run .jar files.
It is possible to run jar files in Android. But the problem is, it's possible using command execution and Root is needed to do that. A perfect example is this Apktool (Android) with Source Code
Related
I have a libGDX project that I want to be able to run from a .exe file on my desktop.
So far I can only run it over DesktopLauncher inside my Android Studio.
Whats the simplest way to build a .exe file out of my project?
I can build .jar file but it won't run on double-click. Does that mean I need to make a wrapper for display or something?
I'm new to libgdx and android studio, and I just need to deploy my first simple app as a standalone file on desktop.
Two choices:
1- Packr, which packages your jar files along with the java jre and creates an executable on Windows, Linux or MAC (https://github.com/libgdx/packr)
2- Excelsior JET, which recompiles the entire java code to native executable. This option cost money, though (http://www.excelsiorjet.com/)
I've succeeded in recovering the Java files and XML files from an APK file using this tutorial but I cannot find the Gradle scripts( build.gradle, settings gradle, local.properties, etc.)
I've created a new project and I had imported the Java and XML files but the project doesn't work, I guess because of the Gradle.
Does anyone know how to do this?
The gradle file is not compiled into the APK, it is only for the actual android studio project for fetching dependencies and app configuration. There is no way to get a gradle file from an APK
Try creating your own folders in the studio and try copying the code into the studio....that should work...and about gradle files? android studio will build it with gradle...as much as i know studio uses gradle build system to build app
you can’t . when you compile apk it will merge all the file into single file . An APK file contains all of that program's code (such as .dex files), resources, assets, certificates, and manifest file.
So When You decompile it . you can not file gradle file .
From what I've read in terms of Apktool vs JADX: Pros and Cons, JADX apparently decompiles APK files to Java Code and also has the option to allow you to save said Decompiled APK as a Gradle project, it has CLI version as well as a GUI version.
however I noticed that one of the Cons of JADX comes from when the APK that JADX is being used on, contains some non-ASCII characters, causing the Decompiling process to fail.
Maybe this could work for you, not sure if it will give you exactly what you want in terms of original Gradle files but it might be a step in the right direction.
You can find more information about JADX, from the creators Jadx GitHub repository, Note that it doesn't work on every APK you use it on.
Hope this helps.
I have this demo project: http://www73.zippyshare.com/v/74674979/file.html which I got for using http://www.aclas.tw/Products/AO1X/ .
My problem for using this is in the documentation. Which does not exist.
I understand how the Java part of the code works but I don't know how to implement this in my project.
I downloaded and installed ndk hoping I would be able to run the project but it crashed at the most important part:
System.loadLibrary("AclasArmPos");
I don't know what to do and there is no description on how to use it. Except the code itself which I cannot run.
Place the .so files under jni/libs. If you have .so files for multiple architectures, create folders like x86, armv7a within the jni folder and place the .so files in the corresponding folder. If you are using Android studio, the steps to follow are slightly different. Can you provide more details?
To be clear, i know there is a thread like this on stackoverflow and he uses eclipse while I use Intellij. Creating an executable jar in eclipse and intellij are different. So before downvote kindly consider my scenario. I created a simple java game using libgdx and want to export it in an executable jar. But before doing so, I experimented in creating a jar of the one in the tutorial video of official LIBGDX.This is the jar file Dload it here.. If you execute it opens then close again. But when i ran the project in intellij it runs without error.
This is the image i was expecting if i execute the jar file i created..
What is wrong when i tried to create a jar file?? Anyone?? Thanks
Just open your exported jar file like a zip archive and export your assets folder and libraries beside your jar file then test it again. Hope this helps.
I am working on a Java project in Eclipse. In this I am using a third party JAR which I have put in on the classpath. Now I want to understand the code in the JAR file and want to see the actual code and navigate through the third party code just like my own code.
My question is this: Instead of me manually decompiling all of the class files in the JAR and putting them in the appropriate folder as per package declaration, is there some way in which Eclipse will decompile them for me, and put them in the appropriate folder? What should be the approach taken in such a scenario?
The decompiler I use is JAD. It has an eclipse plugin, Jadclipse.
You can download JAD from http://www.varaneckas.com/jad
You can get Jadclipse from http://sourceforge.net/projects/jadclipse/. Click on the download jar and then simply copy the jar into your Eclipse/plugins directory, and restart Eclipse. Set up the path to JAD from Preferences->Java->JADClipse. Then trying to view a class should give the decompiled code.
I have been using Java Decompiler for some time and have found it very useful, i don't know about eclipse but it seems to have a eclipse plugin: JD-Eclipse