Now you 'll learn how to build your first Android app. You’ll learn how to create an Android project with Android Studio and run a debuggable version of the app. You'll also learn some fundamentals of Android app design, including how to build a simple user interface and handle user input.
Follow the steps in the below link to create your own app. Don't worry about the coding part now. Just follow the instructions and build your own app and then come back. Good luck!
https://developer.android.com/training/basics/firstapp/creating-project.html
Wow, Congrats! You built your first own Hello world app. Most of the developers in the world irrespective of the ciding language started their development carrier by learning the hello world program only and you joined this list too😉. You become a Android developer now👍.
In your Hello world app you see the below 3 files.
app > java > com.example.myfirstapp > MainActivity.java: This is the main activity (the entry point for your app). When you build and run the app, the system launches an instance of this Activityand loads its layout.
app > res > layout > activity_main.xml: This XML file defines the layout for the activity's UI. It contains a TextView element with the text "Hello world!".
app > manifests > AndroidManifest.xml: The manifest file describes the fundamental characteristics of the app and defines each of its components.
Now we will see all the important elements in XML which are helpful in designing our desired screen.
Declare UI elements in XML: Android provides a straightforward XML vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts.
Using Android's XML vocabulary, you can quickly design UI layouts and the screen elements they contain, in the same way you create web pages in HTML — with a series of nested elements.
Each layout file must contain exactly one root element, which must be a View or ViewGroup object. Once you've defined the root element, you can add additional layout objects or widgets as child elements to gradually build a View hierarchy that defines your layout.
XML helps to create the layout of the screen. All the XML layout will be saved under app > res > layout.
The default main layout name would be activity_main.xml and our java program will load this layout using setContenView method in your Activity.onCreate implementation.
For example,
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);
}
In the above three messages we come across several keywords which we should be aware of. The keywords are
Follow the steps in the below link to create your own app. Don't worry about the coding part now. Just follow the instructions and build your own app and then come back. Good luck!
https://developer.android.com/training/basics/firstapp/creating-project.html
Wow, Congrats! You built your first own Hello world app. Most of the developers in the world irrespective of the ciding language started their development carrier by learning the hello world program only and you joined this list too😉. You become a Android developer now👍.
In your Hello world app you see the below 3 files.
app > java > com.example.myfirstapp > MainActivity.java: This is the main activity (the entry point for your app). When you build and run the app, the system launches an instance of this Activityand loads its layout.
app > res > layout > activity_main.xml: This XML file defines the layout for the activity's UI. It contains a TextView element with the text "Hello world!".
app > manifests > AndroidManifest.xml: The manifest file describes the fundamental characteristics of the app and defines each of its components.
Now we will see all the important elements in XML which are helpful in designing our desired screen.
Declare UI elements in XML: Android provides a straightforward XML vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts.
Using Android's XML vocabulary, you can quickly design UI layouts and the screen elements they contain, in the same way you create web pages in HTML — with a series of nested elements.
Each layout file must contain exactly one root element, which must be a View or ViewGroup object. Once you've defined the root element, you can add additional layout objects or widgets as child elements to gradually build a View hierarchy that defines your layout.
XML helps to create the layout of the screen. All the XML layout will be saved under app > res > layout.
The default main layout name would be activity_main.xml and our java program will load this layout using setContenView method in your Activity.onCreate implementation.
For example,
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);
}
In the above three messages we come across several keywords which we should be aware of. The keywords are
- Layout
- View
- ViewGroup
- onCreate
- setContentView
- R.layout.main-layout
Now we will try to understand what they are and its functionality by clicking each of them.
No comments:
Post a Comment