This lesson shows you how to create a new Android project with Android Studio, and it describes some of the files in the project.
To create an Android App in Latest Android Studio, follow the below steps or watch out below Video:
In this Post You will Learn the Following:
- How to Use TextVew
- How to Use ImageView
- How to Use Button
- Install the latest version of Android Studio From Here.
- In the Welcome to Android Studio window, click Start a new Android Studio project. Figure 1.
The source Code of this App is given at the end of this post.
In the Choose your project window, select Empty Activity, and click Next.
In the Configure your project window, complete the following:
Enter “My First App” in the Name field.
Enter “com.nulledsourcecode.firstapp” in the Package name field.
If you’d like to place the project in a different folder, change its Save location.
Select either Java or Kotlin from the Language drop-down menu.
Select the checkbox next to Use androidx.* artifacts.
Leave the other options as they are.
After some processing time, the Android Studio’s main window will appears.
Now our project is started to build. Remember that Android Studio Every time will Require a Internet Connection for its Build And Sync Projects.
Just wait till Its Process is Finished. The first screen you see is Manifest.xml file needs for Android App Startup and store all activity startups and permissions and much more.
You see “com.nulledsourcecode.firstapp” this is the app package name required to publish the app on the play store. this is also called the unique app id of our Project .
The next screen is MainActivity.java file Java files contain programmatic codes to run The app.
Now next screen is the layout of our main java file where you can edit or add anything to your app visually means to make the UI of your app.
Now you see “Hello World!” on the layout file when we run this app it will show us this word. To run the app you need a Mobile or you can also run it in Emulator. For mobile, you have to connect it by data cable and also make sure that you have turned on USB Debugging in Developer Option.
If Don’t know about it you can read more about this at our website: www.nulledsourcecode.com.
Now we will add an image to our main screen lets see how…. You have to choose the ImageView tag than use the width and height of the image.
I will tell you that in the layout we have to choose first of all a layout for its UI here we use Constraint layout.
In constraint layout you can drag the items on the screen let’s see, just click with the mouse and drag to center you see we have done it in the center with its app Name.
Now we will add a button, Now our button is created Now we will drag it center also. In constraint layout, you have to also set its endpoint like as you see in these videos. Sorry for the bad English, actually my English is not bad I’m just nervous because Many users come to me saying to make videos on Android Studio. so it is my first Video and also I don’t have so much knowledge of Video making. Please be patient Now our First Android App Tutorial is Completed We will Learn the Next part of App in Our Next videos.
How to Run Android Studio Project on a real device or Mobile
Set up your device as follows:
- Connect your device to your development machine or computer or Mac with a USB Data cable. If you developed on Windows, you might need to install the appropriate USB driver for your device. In Windows 10 Not need Driver. Just follow the below steps.
- Perform the following steps to enable USB debugging in the Developer options menu on your Mobile:
Open the Settings of your mobile.
If your device uses Android v8.0 or higher, select System. Otherwise, proceed to the next step.
Scroll to the bottom and select About phone.
Scroll to the bottom and tap Build number 7 – 10 times.
Return to the previous screen, scroll to the bottom, and tap Developer options.
In the Developer options window, scroll down to find and enable USB debugging and enable it.
Now you will see your mobile name on the Android Studio side of the Run button. Now run your app and look at your mobile.
- Finally, App is Running on your mobile if you got any error to feel free to comment with us we will fix it for you.