Yes, you can have regular classes and not all of them are associated with a user interface element. This is very similar to regular Java. Thus, in Eclipse you can create a new class, as in the image, and follow the wizard of one page.

You end up with a code similar to the one below (I added a few examples as an example):
package this.is.your.package; public class Person{ private int age; public void setAge(int _age) { age = _age; } }
Then you can create methods and other things as usual. Regarding instantiating or accessing your class, you may have to publish it for your actions. However, there are many different ways to do this, but in the above example I could do.
public class MyActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Person me = new Person(); me.setAge(22);
As you can see, all this is normal.
source share