- Converting Java code to Android
- Converting Java code to Android
- Java to Android Conversion
- Android — how to convert java swing to android?
- Converting Java classes to Android
- Converting Java (J2ME) Applications to Android .apk Format
- Android .apk Files – Can they Really be Decompiled?
- How to Convert .jar/.jad (J2ME/MIDP 2.0) Applications to Android .apk Format
- Share:
Converting Java code to Android
Solution 3: As long as I know, there is no program that can directly convert them to android layout, but as fact android and java is very similar. I tried a bit of research and I found out that android cannot run swing. can we run java swing and applet on android My problem is how will I convert the simple swing demo to android.
Converting Java code to Android
I Have a Java application and I need to convert it to an Android application is there any resources to show how ? in Android developer site I didnt found anything like that!
I need to use the Java methods and classes in android ,How it can be done?
If you use the standard android SDK (http://developer.android.com/sdk/index.html) all code is already done in JAVA and should already work in android. Just follow the instructions to set up eclipse and android sdk tools and then import your code to an android project.
The only thing that must be changed is the GUI (graphical user interface) since it’s different in android. Do the «hello world» tutorial and «Hello, Views» tutorial in the android sdk page that should put you in the right track of how you should do GUI’s in android 😉
Converting a java game on eclipse to android, Add details and clarify the problem by editing this post. Closed 8 years ago. Improve this question. I created this game using java in eclipse …
Java to Android Conversion
I have seen a few things on this website about converting java code to android. However, I do not want to re write my code unless absolutely necessary. I have always wanted to release a game to the google play store, and have been working hard to do so in the past couple of weeks. I decided to code the game in java, thinking that I could convert it to work on the Android operating system when finished. However, I am now at the point where I am ready to convert the game, and I am having lots of trouble. My game requires java’s «paintComponent» and Graphicsd2D. My question: is there any possible way to use java’s Graphics in android? I use lots of things with this class, such as resizing images
There is No direct way to convert Java (Swing/AWT) GUI into Android GUI . Since Java GUI is heavier for mobile applicaiton. However you just start converting your java GUI components into Android XML view one by one. That is the only way.
If working on Web Application, You can use this WebSwing. It will allows to run any swing application inside your web browser using only pure HTML5. It is Open Source.
How to transfer an existing Java program to Android, Any other tips or links regarding the matter would be appreciated. java android import transfer. Share. Improve this question. edited Jan 6, 2012 …
Android — how to convert java swing to android?
I am a total noob to android and really have very hard time understanding some concepts. I also have a little understanding of java swing. I am a bit knowledgeable about java web app using spring mvc. I am using eclipse indigo
After I successfully created android app named AndroidExer I created a package com.swing.demo and placed the already running swing source code JTextAreaDemo.java (The source is from a tutorial. This is working in pure java). It seems that that android doesn’t recognize swing packages (I don’t know if I understand it correctly, please help me) because I got alot of errors and most of them says cannot be resolved to a type. When I check for suggestions, eclipse does not include any suggestion about importing which makes me think that android doesn’t recognize swing.
I tried a bit of research and I found out that android cannot run swing. can we run Java Swing and applet on android
My problem is how will I convert the simple swing demo to android. I don’t have any clue where and how to start. I really need help. BTW, the code is for JTextAreaDemo.java is down below:
package com.swing.demo; import java.awt.Container; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; public class JTextAreaDemo extends JFrame implements ActionListener < /** * */ private static final long serialVersionUID = 5416184196156296457L; JTextField jtfInput; JTextArea jtAreaOutput; String newline = "\n"; public JTextAreaDemo() < createGui(); >public void createGui() < jtfInput = new JTextField(20); jtfInput.addActionListener(this); jtAreaOutput = new JTextArea(5, 20); jtAreaOutput.setCaretPosition(jtAreaOutput.getDocument() .getLength()); jtAreaOutput.setEditable(false); JScrollPane scrollPane = new JScrollPane(jtAreaOutput, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); GridBagLayout gridBag = new GridBagLayout(); Container contentPane = getContentPane(); contentPane.setLayout(gridBag); GridBagConstraints gridCons1 = new GridBagConstraints(); gridCons1.gridwidth = GridBagConstraints.REMAINDER; gridCons1.fill = GridBagConstraints.HORIZONTAL; contentPane.add(jtfInput, gridCons1); GridBagConstraints gridCons2 = new GridBagConstraints(); gridCons2.weightx = 1.0; gridCons2.weighty = 1.0; contentPane.add(scrollPane, gridCons2); >public void actionPerformed(ActionEvent evt) < String text = jtfInput.getText(); jtAreaOutput.append(text + newline); jtfInput.selectAll(); >public static void main(String[] args) < JTextAreaDemo jtfTfDemo = new JTextAreaDemo(); jtfTfDemo.pack(); jtfTfDemo.addWindowListener(new WindowAdapter() < public void windowClosing(WindowEvent e) < System.exit(0); >>); jtfTfDemo.setVisible(true); > >
I really need your help. Thanks.
I don’t think you can mix those two. If you want android native app, you need to use Android API than Swing. Here is android documentation.
Start simple. You build the interface first. Then start adding some ‘plumbing’ to it.
Break the process down into small steps and you’ll figure it out. You’ll have an easier time getting help when you’re stuck on something.
I’m afraid the best you can hope for is reuse business logic that your swig app would use. Beyond that you have to create the thing from scratch.
As long as I know, there is no program that can directly convert them to android layout, but as fact android and java is very similar. If you are using eclipse, then building the UI won’t be so hard. you can also use these layout tutorial, events tutorial, and control tutorial from android developers to start learning.
Converting Java code to Android, 3. If you use the standard android SDK (http://developer.android.com/sdk/index.html) all code is already done in JAVA …
Converting Java classes to Android
Can I convert my Java classes easily for Android, or should I write them from scratch?
I’m writing a few Java classes in MVC style, to create a desktop version. At some point I’d like to transfer them to Android. I sure would appreciate some tips on this (I’m using Netbeans).
I’m not sure if this will help but Netbeans has a plug-in available to make Android apps. Check out: http://plugins.netbeans.org/plugin/19545/nbandroid
Android Studio convert java module to android module, Sorted by: 5. A Java module uses apply plugin: ‘java’ in its build.gradle, whereas an Android module uses apply plugin: …
Converting Java (J2ME) Applications to Android .apk Format
If you just got a new android phone, running java applicatons in .jar format can be a real challenge but there are lots of ways out. I previously wrote a post on how to run java applicatons on Android smartphones using an emulator but what I’m posting here is totlally different. Yes, you can convert .jar files to Android’s .apk format. Sounds impossible? Well, it can be done easily with the service of a couple of websites but I need to make a few things clear about Android applications.
Android .apk Files – Can they Really be Decompiled?
You’re probably not an Android developer but just an ordinary guy like me, so I’m going to keep this simple and straight. At first, the extension Google uses for Android applications (.apk) may look complicated but it actually isn’t. Basically, an apk file is nothing but a zip archive disguised in a different extension. You think I’m joking? Just rename the .apk extension to .zip and extract the content to see exactly what I’m trying to say. Inside this zipped archive is a file named classes.dex which is the most important file in there containing all the java files. This file is encrypted but it can still be disassembled. The java classes are compiled differently so there’s need to go through some special steps to decompile them. You’re going to need these two files:
- Dex2Jar from http://code.google.com/p/dex2jar/
- A regular Java decompiler, such as JD from http://java.decompiler.free.fr
-In dex2jar directory, paste your classes.dex file.
-Open CMD, go to dex2jar durectory using cd, and type dex2jar YourApp .apk
-You will automatically get a .jar. Use jd gui to decompile it.
How to Convert .jar/.jad (J2ME/MIDP 2.0) Applications to Android .apk Format
Everything I’ve been ranting about is not the real thing you’re looking, huh? Anyways, I found two sites where you can easily convert .jar applications to .apk format and run it smoothly on your Android smartphone.
This offers this service free of charge and I can tell you that their service is quite cool. You can check them out and, of course, it’s very easy to use. Just upload your java application and the jad format to get the android version! You can use JADMaker to get the .jad version of your java application.
These guys too offer the same service but hey, it’s not for free. If you’re a developer, you may want to check out their service and some extras they’ve got for you.
That’s all I’ve got on converting .jar applications to Android .apk format. There may be other websites offering the same service though.