As Kristopher said, Java source is in "*.java" files and XML is in "*.xml" 
files. 

Also, Java follows Java syntax:

  package com.foo.bar;

  public class FooBar 
  {
    public static void main(String [] args)
    {
      // ... etc.
    }
  }

XML follows XML syntax:

  <rootTag>
    <someOtherTag someAttribute="value">
      <yetAnotherTag>content</yetAnotherTag>
      <moreTag id="more" value="barfoo" />
    </someOtherTag>
  </rootTag>

Now, when someone new to Java and XML runs into a question, it is good 
to search through the documentation for Java and for XML:

<http://docs.oracle.com/javase/>
<http://www.w3schools.com/xml/default.asp>

Read and study the tutorials, etc.

-- 
Lew

Waheed Rafiq wrote:
>
> you defo got one thing right " I am confused" -:)  I actually thought I 
> was writing code in java ?  so this now begs the question where do I write 
> the code if not in MyFirstApp.main  
>
> I am new to Java and XML 
>
> thanks for your prompt reply 
> Kristopher Micinsk wrote:
>
>> You seem to be quite confused... You can't write an if statement
>> inside XML, it's not interactive (computation), it's just static XML.
>>
>> What you need to do is put that in your java code,
>>
>> Waheed Rafiq wrote:
>> > Hi guys , I am new to android development
>> >
>> > for sometime I have try to resolve  the if statement issue within my 
>> code
>> > but can't seem to understand why it does not work
>> >
>> > here is my code that I was learning from online tutorial
>> >
>> > <RelativeLayout xmlns:android="
>> http://schemas.android.com/apk/res/android";
>> >     xmlns:tools="http://schemas.android.com/tools";
>> >     android:layout_width="match_parent"
>> >     android:layout_height="match_parent" >
>> >
>> >     <TextView
>> >         android:id="@+id/textView1"
>>
>  
. . . [ snip ] . . . 
 

> >         android:text="Edit me"  // on this line I name the button Edit Me
>> >
>> >         if(android.text="Hussian Waheed") android.text="Change Me"; // 
>> on
>> > this line I am trying to say if the button is "Edit Me" then change 
>> this to
>> > "Change Me"
>> >
>> >
>> > all I get is a error stating my if statment requires a equal , I just 
>> don't
>> > understand it. really would like someone to give me a better example of 
>> how
>> > to change a button name to different button name.
>> >
>>
>  

> >        />
>> >
>> > </RelativeLayout>
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to