-
Notifications
You must be signed in to change notification settings - Fork 103
Android
Android Studio SDE,
Activity classes
Activities are the key components of the Android environment. These are the ckasses that create the on-screen displays, and allows for the interaction with the elements throughout the course of the Apps life. Note that although there are many different forms of acvivities, they will be covered later, as they will generally be related to more advanced features of Android such as creating Lists, or Tabs.
To create an activity class, we need to extend the Activity class so that we have the ability to use it. As this is our beginnign class that will extebd to all others, we will call it MainActivity, Therefore public class MainActivity extends Activity{} From here there, there is a key demonstration of how the SDE you choose has the portential to be of great help. This is due to the fact that there are methods that need to be created and overwritten. In the event that you are using TextEditors, you may need to look them up and implement them manually, however using Android Studio, we have the option to press Shift+Enter and select the option to generate all of the different methods that are required.
This allows for great potential from SDEs as we also have the ability to make sure that all required methods are implemented, as many errors insode of programming come from something as simple as a single method that was forgotten to be overwritten, or the fact that a method is case-sensative so although your method is 'there' it is not the correct class name to overwrite.
From here we can see that there are a few methods that are created empty. The one that we will want to focus on first is the onCreate class, as this is what will allow us to begin creating the different elements of the home screen.