Although Android applications are written in Java, the environment around the application is very different from the framework wrapped around an applet. You cannot have one .jar file that you can include as an applet and drop it onto your Android device, because thatβs not how it works.
However, you can probably create all the game logic and objects and share them with the applet code and Android application. You can probably even leave with them in the same repository and project (although it will probably be an Android project, which you then wedge into your application build scripts).
To handle the various controls for your game, you probably have to abstract the input and your game / level object has a callback like userHasPoked (int x, int y), and then there is an applet call this method with a mouse click. and the Android application calls it when touched (which is oddly still called onClick).
I think it will be a long way, but much easier than rewriting it all. This probably sounds like a lot of work, but as soon as you finish wedging your code in the applet and Android app, you probably will never have to touch this code again and may just keep adding to the game,
I would not underestimate the task, but it sounds like a very funny programming exercise. Good luck
source share