Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Android equivalent of JFrame? [closed]

I just wrote a Java program for a game and I was wondering how I could get the same game to run on Android using Android Studio.

I noticed that Android does not support JFrame, though. What is the Android equivalent to JFrame?

like image 729
Paymon Wang-Lotfi Avatar asked Feb 21 '15 03:02

Paymon Wang-Lotfi


1 Answers

In Android what you would usually do is subclass Activity if you want to make a "screen" and View if you would like to make a UI widget.

But before you subclass any of them you should know that while they have some similarities to JFrame, they are VERY different and there are a lot of Android specific stuff you need to know about before you start using them. I would start by taking a look at managing activity lifecycle.

For an example of a way to make simple 2D game in Android, take a look at this.

like image 112
Lennart Rolland Avatar answered Oct 07 '22 01:10

Lennart Rolland