Game apps for smartphones and tablets

Research project PHBern  
HomeStart online editorAndroid TurtlegraphicsPrintJava-Online

Online editor

The online editor allows to compile Java programs on our webserver. Therewith, the installation of the JDK, a Java development environment and the necessary class libraries is done away with. If you work with our online editor for the first time, please check if JRE (Java Runtime Environment) is installed and check your browser settings. In order to run the program, you either have to connect smartphone or install an emulator.


 


Start the online editor with "start online editor" in the lower part of the left column.

The online editor provides a number of program templates. In order to program games, the template Android is used.

In the editor window, a base frame of a Java program appears.

 

 

By clicking on "compile"the program is compiled and converted into the dalvic code for smartphones.

 


 

In the lower part of our editor window, the following message appears:

"Compilation succeeded".

 

In order to start the program, connect the smartphone via USB cable or start the emulator by clicking on emulator and click on " run MyAndroid ".

If the execution fails, read the instructions to download on smartphone and install emulator and check your browser settings.

 

 




 

Add a background picture to the program:
Enter "riff" in the fourth program line .

Compile the program again and run it. There should be an image in the background now.

The system functions like a real editor. If the program code is incorrect, the error messages will appear in the lower window area.

It is as well possible to insert an already existing program via clipboard. (copy = Ctrl+c, insert = Ctrl+v", cut = Ctrl+x). Thereby, Java keywords are marked in bold and blue, comments (//... or /*...*/) green. Strings ("...") appear in blue.

With help top right in the online editor, the class documentation of the class JDroidLib may be displayed. There, you can find all methods with the detailed specifications.

 


 

With the two links in the lower part of the editor window, you may save files on the local computer.

MyAndroid.java is the source code of your program.

By clicking on MyAndroid.java, a new window with the program code is opened. The file can be saved by clicking save page under (Ctrl + S)

With Internet Explorer 9, a dialogue box appears in the lower part of the browser window, in which you can select open or save. Select save and save as in order to save the java and jar file respectively on your computer.




 

 

MyAndroid.apk is the readily packed app. It can be downloaded on your computer and later be installed on your or another smartphone (command: adb install MyAndroid.apk).

 

Attention:: The apk file is downloaded with Java webstart, and if the adjacent dialogue box appears in the Firefox browser, you have to select open with Java(TM) WebStart.

If you select the choice Dateien diese Typs immer diese Aktion ausführen wählen, this dialogue box does not appear anymore.