Game apps for smartphones and tablets

Research project PHBern  
HomeStart online editorAndroid TurtlegraphicsPrintJava-Online

Differences between JGameGrid and JDroid programs

JGameGrid (Java SE) JDroidLib (Android)
Package may be missing Package necessary with at least one point
Iported is:  ch.aplu.jgamegrid.* Imported:*
Colors are object of the class java.awt.Color, standard color value can be written in upper- and lowercase letters, an RGB color is created with new Color(int r, int g, int b) Colors are integer, standard color values have to be written in uppercase letters, a RGB color is created with Color.rgb(int r, int g, int b)
The mouse is described as GGMouse Touch is described as GGTouch
There is a right and a left mouse button, constant lPress, rPress, and so on. There is only one touch type, constant, press, release, click, drag
Mausevent Callback is calledmouseEvent(GGMouse mouse), therefore references to mouse, z.B. mouse.getX(), and so on. Touchevent Callback is called touchEvent(GGTouch touch), therefore references to touch, z.B. touch.getX(), and so on.
Registering a GGMouseListener with addMouseListener() Registering a GGTouchListener with addTouchListener
Different parameters of the constructors of GameGrid Different parameters of the constructors of GameGrid
Application class is mostly diverted from GameGrid .In the constructor, all methods of GameGrid can be used The app class is always diverted from GameGrid. In the constructor, the display system is not completely initialized yet. In the constructor mostly only request by super(). All other actions in main()
It belongs to a good program design to initialize instance variables with the declaration Because the graph system is not yet completely initialized at the time of the declaration of the instance variables, GameGrid related instance variables have to be assigned in main().
Display of the graph window with The graph window is the whole display. There is no show()
GameGrid.setTitle() writes a text in the headline. GameGrid.setTitle() does not have any effect, replace by GameGrid.setStatusText() ersetzen

GUI elements with swing classes, graph with AWT classes

Swing and AWT don't exist and aren't replaced by classes from the Android API
Simple user entries with an JOptionPane Simple user entries with GGInputDialog or GameGrid.requestXXX()
Sprites with random file names Sprites, which are loaded from the applications package are in the index <projectroot>/res/drawable. During the request, no file extension should be indicated. The file name can only include lowercase letter, numbers and the underline
Messages are often displayed as headline with setTitle() or in a separate StatusBar Messages displayed with setStatusText() (in Titelzeile), showToast() or another TextActor. There is no StatusBar
There are no application icons App icon by default in <projectroot>/res/drawable.hdpi, ../mdpi and ../ldpi . Perhaps replace by own one
Applications don't need to be signed (except for WebStart) Apps always have to be signed. When using ProjectManager, they are signed with the debug key of the development computer. This event. has to be replaced with an own key which was created with keystore. Differently signed apps can't be replaced, because the app has to be uninstalled first.