Java code migration to Android

I have a working code, which can generate and draw some figures with lines. It has written in native Java. I would like to migrate this code to Android and give some fancy graphical desgin, beacuse it would be a game. How can I do this migration with my Java code? (I have asked this earlier, but simple “copying” is not a great solution.)

What do you mean by native Java? Is it native code, or is it java code?

This is one reason why people use libraries… If you want to do coding for multiple platforms at once (android, computer, ios etc.)
use LibGDX for example (it even supports WebGL). Otherwise, you have to do some “simple copying” yourself.

This kind of question comes up whenever somebody wants to create a program originally written in one language in a different language. The answer is, for the most part, there isn’t a good way to “translate” code from Language A to Language B. You have to take apart what you’re doing and then do that thing in the target language. The same thing is true for different platforms.

Step 1: Figure out what you did in your original code. Write this down, in English. This is your algorithm(s).
Step 2: Figure out how to implement that algorithm in Android.
Step 3: Implement that algorithm using Android code.

LibGDX makes your life easier for step 2 and 3, but you can’t do either of those until finishing step 1.