2.0 KiB
Learning android studio
The order of making a android app
1. Layout
When you've created a project you need to make the layout of the app. This is done in the res/layout/activity_main.xml
file. This file is a xml file that describes the layout of the app. If the folder doesnt exist you can create it by right clicking on the res
folder and selecting New -> Android Resource File
. There you can add qualifiers to the file. Qualifiers are used to specify what kind of properties its has.
2. Variables for the layout
When you're dragging and droppign things in you can add a recource name to the object. This is used to reference the object in the code. You can add a recource name by clicking on the object and then going to the Attributes
tab. There you can add a recource name. That recource name is then used to reference the object in the code.
3. Code
After you made the layout you can start writing code in the MainActivity.java
file. This file is located in the java/com.example.myfirstapp
folder. This file is the main file of the app and is the file that is run when the app is started.
4. Permissions
If you want to use a certain permission in your app you need to add the permission to the AndroidManifest.xml
file. This file is located in the app
folder. You can add a permission like this:
<uses-permission android:name="android.permission.INTERNET"/>
This is a list of all the permissions you can use.