NicheTech Computer Solutions is the best web development company in Ahmedabad which is helping MCA , BCA , MSC IT students in Ahmedabad, Gujarat , India.
MCA Project Training Ahmedabad , Android Training Ahmedabad , Android Classes Ahmedabad
Android Live Project Training : http://facebook.com/nichetechinstituteindia,
Android classes Ahmedabad : http://twitter.com/nichetechins
Android Training Ahmedabad : http://www.slideshare.net/nichetechinstitute,
http://liveprojecttraining.in/
2. Android is same as other programming language like
.NET, PHP and JAVA but the only one difference is it run
on the mobile device so let’s start the simple button click
event process.
Open the file named main.xml inside the folder named
res to layout.
Then after using either Graphic Layout or main.xml page
create one button and one textbox. Check out the next
slide.
Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd
4. Create on class named activity2
Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd
5. Create one copy of main.xml file by right click on the
res/layout folder, and click on the paste button and give
the file name activity2.xml.
Now let’s understand why we have created new .xml file
Consider the activity2.xml file as page 2 and main.xml file
as page1.
My page1 contain one button and one textbox where I will
fill the value and that value I suppose to display into
Page2
Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd
6. So my main page that means main .java file
main.xml contain designing code and lets it’s server side
code will contain TestoneActivity.java
Same way activity2.xml file contain the designing code
and it’s server side code contain Activity2.java file
So till now we have write the code for designing now it is
time to write let’s say server side code inside .java file.
Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd
7. First of all we will write the code for page1. but before
writing the code we need to define our page named
activity2.
Here for understanding purpose
consider this file as confi file which contain all page(
activity information). I have created new page so give the
activity name as
Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd
Our page
Information
With
prefix “ . “