Introduction In this article we will study how to design the user interface and implement some easy code, but it is mandatory you have some experience in creating Android Studio projects. Now we will discuss the following topics.
Step 1: Now open the Android studio and click on new project, then press next button, choose the API leve, and select Empty template with now activity; now left click on res folder and create a directory and give the name layout and then press Ok button Step 2: Now left click on first directory and give the name Main Activity; now you see that layout session the content.xml file appears to have deleted this file because it is not necessary for us. Step 3: Now when Home Activity is created press double click on class file and delete the following code because it is not essential for us. Step 4: Now after deleting the code you create more activities, you have two options for creating an activity. The first one is the previous method and the second is that you click on class file and press Ctrl C and then Ctrl V and then change the activity name and you simplt make the layout section also. The following picture is given below forthe hierarchy of activities and layouts. Step 5: Now mention allthe activities' names in AndroidManaifest.xml file and also add internet reference permission for using the app in future. I will make clear to you how I added INTERNET reference in this file Step 6: Now in Home activity we add two buttons in layout and set the name. We have two options; first, we create a button with code and second, we drag and drop, but this is not a good practice. Now I am showing code as well as button. Step 7: Now we make a scenario that when user presses the BROWSER button any following URL is open so in this first we will work on BrowserActivity.java file and add this code in Java file and we will implement the layout file by taking the Web View. Now open BrowserAcivity.java file and paste these two lines in it and then run the application Step 8: Now move to the HomeActivity.java class and add this code in it and we use intent classes to open other activities like Bowser activity Step 9: Now click on the Browser button and you can see that Google is open; now you can search anything here but remember that you add INTERNET permission in AndroidManifest.xml file.
Read more articles on Android:
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: