How to Turn Your Java Code Into Android Code

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.

The Android emulator software lets you open external Java code files in an Android project. The Eclipse software emulates an Android device, so you can create, test and package Android apps. You can use the emulator to transfer Java code to an Android application. The Android platform uses Java source code to create tablet and cellular phone games and Internet applications.


Step 1

Click the Windows "Start" button and type "eclipse.exe" in the search text box. Press "Enter" to find the file on the hard drive. After the file displays in the results window, double-click the file to start the program.

Video of the Day

Step 2

Click the "File" menu item in the software. Click "New," then click "Project." A dialog window opens. Double-click the "Android Project" option. Click "Next" to open the Android configuration window.


Step 3

Type a name for the Android project in the first text box. In the "Build Target" section, check the Android version for which you want to develop. For instance, tables use version 3.0. Type a name for the package in "Package Name." Click "Finish" to create the project and load the development interface.



Step 4

Click the "File" menu item. Click "Open." In the dialog window, click the Java file you want to convert. Click "Open." The dialog window includes the Java file in the Android application.

Step 5

Click the "Run" button in the Eclipse toolbar. The Java code runs and the results display in the Android emulator.




Report an Issue

screenshot of the current page

Screenshot loading...