Code Layout Example In Android Programming

This example shows how you can create your own layout through code instead of xml.


1.) Create a new project by File-> New -> Android Project name it CodeLayoutExample.

2.) Run for output.


1.) Create a project named CodeLayoutExample and set the information as stated in the image.

Build Target: Android 4.0
Application Name: CodeLayoutExample
Package Name: com. example. CodeLayoutExample
Activity Name: CodeLayoutExample
Min SDK Version: 11

2.) Open file and write following code there:




3.) Compile and build the project.


Leave a Comment:

1 comment
present says January 15, 2013

the code itself it is correct but it does not perform any task.

Add Your Reply