Monday, June 22, 2026

How to set text to a TextView.

How to set text to a Text View.

Today you are going to set a text to a text view.

Step 1:
  • Open Android Studio.
  • Create new project.


Step 2:
  •  Double click on "app" from the left panel.
  •  Then Double click on "res" 
  • Then Double click on "layout"
  • and open "activity_main.xml" file.

Step 3:
  • Find the text view in the file .
  • Give some id to it.


Step 4:
  • Go back on side panel.
  • Double click on "java" 
  • Double click on package.
  • open "MainActivity"

Step 5 : 
        Let do some code.
  • Below this line " setContentView(R.layout.activity_main)"
  • Start typing.
           TextView textView = (TextView) findViewById(R.id.text);

           textView.setText("My New Text");



Step 6 :
  • Click on Save button from Toolbar.
  • Click on Run.
  • Select Android Virtual Device(AVD).
  • Click Ok.
Step 7 :

















        
         

Create Android Virtual Device (AVD)

How to Create Android Virtual Device(AVD).

Step 1: 
  •         Open Android Studio.




Step 2: 
  •         Click On AVD manger from Toolbar.




Step 3: 
  •          Click on Create Virtual Device.




Step 4:
  •          Select Hardware Device.
  •          Click on Next.


Step 5: 
  •         Select System Image.
  •         Click on Next.



Step 6: 
  •         Name your device.
  •         Click on Finish.






Create New Project in Android Studio.

Creating new project in android studio.

Let's start programming, Before you start you have to make sure that you have install Android studio properly as i explained in previous post, if every thing is good then ready to start.

Open Android Studio and create new project.

Step 1:
  • Open Android studio.
  • Click on Start a new Android Studio project.

Step 2:
  • Name your application.
  • Choose a directory where you want to save your project.
  • Click on Next.

Step 3:
  • Choose target android devices.
  • Click on Next.
(Note. for now leave it all the option as they are and click Next)


Step 4:
  • Select Empty Activity.
  • Click on Next.

Step 5:
  • Customize the Activity Screen shows up.
  • Leave it as it is. 
  • Click on Finish.

Step 6:
  • Wait until Gradle Build Finished.
(Gradle Build Progress displays at bottom of the android studio window.)


Step 7: 
  • Run your application by clicking Run Button from Toolbar.

Step 8:
  • Select your AVD and click Ok.
(Note if you don't have any AVD Devices created yet then click here and see How to Create AVD )


Now Android Virtual Device Shows up with running your first android application.




Congratulations, You have developed your first Android Application. Now just keep following rest of posts and become a android developer. If you have any queries, leave your message in comments section or you can email me. In next post you will add some controls in your application and write code for them.