> XML is not a programming language ... XML is a data description syntax ...

Agreed.

> XML does not make your system any more flexible than writing it in standard 
> java (unless you don't know how to program).

Agreed.

> XML in android is processed down to Java at compile time.
> XML is BLOATED!

Agreed.  The world seems to think that XML is the greatest thing in
the world since sliced bread, but it is extremely bloated and horribly
inefficient.

However, Java itself is bloated.  Heck, so is assembly language.  Java
is compiled down to JVM code at compile time.  That doesn't mean that
Java is useless.

Java, XML, etc. are not designed to be compact and machine-readable,
they are designed to be human readable.  They are high-level TOOLS to
create code that will eventually be compiled down to non-bloated
code.  So it's not really a big deal.

> XML is error prone
> XML is not validated ... nor has any code completion support

Actually XML is validated and has code completion support, I do it all
the time in Eclipse.

> XML can not be visualized without building and running the app.

Yes it can.  When you design your screen layouts in XML, Eclipse will
show you immediately what your screen will look like.  If you design
your UI dynamically in Java then you can't visualize it without
building and running the app.  So, this is actually a case where XML
has an advantage.  For layouts that are not very dynamic in nature,
you should give it a try.  Seriously.

> XML has to be gen'ed into the R.class

Stuff like this tends to bother me, too, and this bothered me at
first.  However, the Eclipse plugins will automatically generate the R
class for you, and it's easy to get the hang of it.  It's also good to
standardize and organize things like resources, localizable strings,
layouts, etc., because it makes understanding other developers' code a
lot faster, since a lot of people are doing things in the same style.

> there is no validation since the R.class is not constantly regen'ed.

Eclipse will constantly regen the R.class.  As soon as you change an
XML file and save it, Eclipse immediately regens the R class and shows
you which parts of code broke because of your change.  In fact, you
might even be able to do refactoring/renaming in XML and have Eclipse
automatically update your code for you.

Like I said before, it bugged me too at first, but once you use it for
a little while it makes a ton of sense and you start to see the
benefits.

-- PJ

P.S.  No, "YOU'RE WRONG!"  Well, about a couple of things.



On Nov 8, 9:07 am, Kingcrowley <[email protected]> wrote:
> This returns to the argument that always comes up in programming.is A
> better than B or B better than A. In this case XML has some advantages
> but of course sometimes you need to do things through code. I would
> review your approach and think maybe i should take off my blinkers and
> look at XML (as making an XML menu layout takes seconds in Android
> once you have done one you have done them all), maybe you won't use
> XML 80-90% of the time but for simple menus and things like that
> writing code to do it is much more time consuming and error prone,
> especially as the Eclipse enviroment and Android plugins really aid
> the development.
> "As a side note about the magic of XML allowing you to
> redesign an app without coding.  If you change your ui
> there is a 99% chance you are changing some logic behind
> the scenes as well.  But now you have XML to change and
> make sure the R.class gets gened and that you used the
> write keyword from the R.class in your code.   You see you
> have increased the likelihood of an error 3x. "
> you say this - but with the Android Development tools this isn't an
> issue that i have seen.
> "The XML in android is not read in at runtime like a CSS might
> be in HTML but is used to build java classfiles.  And as far as I
> have seen the XML does not link data in from a model to fields.
> So really all the XML can do is provide some format and ordering
> support.  Seems like a lot of effort and points of failure for such
> little return. "
>
> this is a classic argument - but as an older programmer with C/C++
> background and Java background for embedded devices, i could state
> that Java is slow/with bad memory management and we should be using C/C
> ++ to develop, but sometimes it is just quicker to use Java! which is
> the basic argument for using XML
>
> Regards,
>
> David
>
> On Nov 8, 6:43 am, sfitzjava <[email protected]> wrote:
>
>
>
> > Hmmm. Learn android, that was kind of the idea.
> > And all of the intros to android brag there are 2 way
> > to do it, all I ask is to find the information on the non-XML
> > way.
> > Looks like niko20 knows how to ask mr google better than
> > I can, and knows how to answer the key question.
> > I had hoped not to have the XML zealots trying to push
> > the koolaid on me.
>
> > On Nov 7, 7:00 pm, Kingcrowley <[email protected]> wrote:
>
> > > maybe you are just looking at this wrong....instead of trying to mash
> > > your knowledge into Android development, maybe you should learn
> > > Android...
>
> > > On Nov 7, 10:01 pm, sfitzjava <[email protected]> wrote:
>
> > > > Wow thanks David that was so helpful.
>
> > > > If there were tutorials that weren't made up of 99% XML I could.
> > > > Here let's take LinearLayout.
>
> > > > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> > > > android"
> > > >               android:layout_width="fill_parent"
> > > >               android:layout_height="fill_parent"
> > > >               android:orientation="vertical" >
>
> > > > So I can find a LinearLayout class.  Great, now where is the setWidth
> > > > ()... None
> > > > Ok is is setLayoutWidth()  Fail again.   Hmm... Wait there is nothing
> > > > in the LinearLayout
> > > > class that sets anything related to the width.  Oh wait it must be in
> > > > the constructor, sure
> > > > there is an Attribute object.  I must have to set it there... what is
> > > > this...
> > > > The Attribute class is.. A collection of attributes, as found
> > > > associated with a tag in an XML document.
> > > > Noooooo... XML document again.....  Well isn't that just fun.   I love
> > > > how XML is so similar to the API.
> > > > Not to mention the xmlns and having to prefix everything with
> > > > android:.
> > > > Wow could this be more seamless and fluid to understand... Sorry I
> > > > meant confusing.
>
> > > > So you see I don't have time to weed through all the chaff to figure
> > > > out
> > > > which of the mickey mouse  XML file goes in what special
> > > > directory, and where to find all the XML attributes and sub-tags
> > > > associated with a parent-tag.  If Android was really Java then
> > > > there would be no problem, or if there was a book/tutorial that
> > > > would go through the various APIs and options to set up things
> > > > it would be a home run.  But there isn't, or that I've found.
>
> > > > Now you want to help or just be a smartazz?!
>
> > > > I'm writing in JavaME, Java, RIM-BB, Obj-C, RevTalk all in the same
> > > > day,
> > > > and don't feel I need to waste time on some squirrelly XML mess when
> > > > I already know all that I should need to with java.
>
> > > > Regards,
> > > > -Shawn
>
> > > > On Nov 7, 3:31 pm, Kingcrowley <[email protected]> wrote:
>
> > > > > well someone with your knowledge of Java should be able to use the
> > > > > Android API with the tutorials available to learn android in no time!
>
> > > > > Regards,
>
> > > > > David
>
> > > > > On Nov 7, 9:20 pm, sfitzjava <[email protected]> wrote:
>
> > > > > > Wow.... thought I said I "Please no .. benefits of XML (BECAUSE YOU
> > > > > > ARE WRONG. [PERIOD])".
> > > > > > So thanks for wasting my time reading your diatribe and you are 
> > > > > > wrong
> > > > > > still.  Sadly you would jump over a cliff if some
> > > > > > script kiddie told you it was the new thing to do.
>
> > > > > > So to quickly cut through all of your BS.
> > > > > > XML in android is processed down to Java at compile time.
> > > > > > XML does not make your system any more flexible than writing it in
> > > > > > standard java (unless you don't know how to program)
> > > > > > XML is error prone
> > > > > > XML is not a programming language
> > > > > > XML is BLOATED!
> > > > > > XML is a data description syntax for communication between
> > > > > > heterogeneous system.
> > > > > > XML is a data description syntax which supports data versioning.
> > > > > > XML can not be debugged
> > > > > > XML has to be gen'ed into the R.class
> > > > > > XML tag has to match what is typed in the java code, and there is no
> > > > > > validation since the R.class is not constantly regen'ed.
> > > > > > XML is not validated, nor has any javadocs, nor has any code
> > > > > > completion support.
> > > > > > XML can not be visualized without building and running the app.
>
> > > > > > Now if Google wants to make a decent tool such as Apple has with 
> > > > > > XCode
> > > > > > InterfaceBuilder  (not calling xcode perfect but it does a very nice
> > > > > > job) then I don't care what they save their files in, and I will
> > > > > > happily jump back and forth if it saves me time, boilerplate coding,
> > > > > > code bloat that gets in the way of debugging, and helps with the
> > > > > > maintainability of the codebase.  To date XML in android does none 
> > > > > > of
> > > > > > these.
>
> > > > > > Also don't talk to me like I have no idea about technology, 
> > > > > > ESPECIALLY
> > > > > > MOBILE!!!
> > > > > > It is clear that you use technology and do not understand it.  Your
> > > > > > use of the statement "XML is used everywhere"
> > > > > > as some type of validation demonstrates that.  Millions of people
> > > > > > believed for hundreds of years that the world was flat,
> > > > > > that the earth was the center of everything, more recently that
> > > > > > Quantum physics was a pipe-dream.
> > > > > >  If XML is the greatest then why was JSON developed?
>
> > > > > > So unless you can answer my question you need not reply.
> > > > > > Again to be clear the question is, "Any tutorials for android that 
> > > > > > do
> > > > > > not require XML".
>
> > > > > > -Shawn
>
> > > > > > On Nov 3, 12:33 am, confetti <[email protected]> wrote:
>
> > > > > > > Shawn,
>
> > > > > > > I'm not going to tell you that you should use xml because I'll be 
> > > > > > > the
> > > > > > > first to admit, it's a hard thing to learn. However, saying there 
> > > > > > > are
> > > > > > > absolutely no benefits to xml is wrong. There are benefits and 
> > > > > > > costs
> > > > > > > to every computer related technology. Xml can offer a flexible, 
> > > > > > > easy
> > > > > > > to change GUI. In android, it lets you define several different
> > > > > > > layouts for a single activity without ever having to change a 
> > > > > > > piece of
> > > > > > > code.
>
> > > > > > > On the other hand, I also understand the benefits of hardcoding a 
> > > > > > > UI.
> > > > > > > It requires less jumping between files, and less resource 
> > > > > > > management
> > > > > > > (although android makes that very easy indeed).
>
> > > > > > > I would like to point out that rejecting a widely used technology 
> > > > > > > like
> > > > > > > xml completely is going to make it very difficult for you to 
> > > > > > > compete
> > > > > > > in today's tech industry. Xml is a part of everything. If you 
> > > > > > > didn't
> > > > > > > know, Google Groups, gmail, iGoogle, bing, msn.com, and thousands 
> > > > > > > of
> > > > > > > other websites use a technology called AJAX, in which xml is an
> > > > > > > integral part. Without it, we couldn't have the cool behaviors 
> > > > > > > like
> > > > > > > partial-page refreshes. On the software side, xml is used in 
> > > > > > > thousands
> > > > > > > of applications across the world as a standard for transferring 
> > > > > > > data
> > > > > > > between places. Even Microsoft Office and OpenOffice.org save all 
> > > > > > > of
> > > > > > > their documents and files in xml now.
>
> > > > > > > To answer your question, the only way to "truly" learn to program
> > > > > > > android applications is to do it. Just like with any language and
> > > > > > > platform, you can't become good at it without practice. I find the
> > > > > > > easiest way for me to learn is to come up with a tool that I want 
> > > > > > > or
> > > > > > > need for my own convenience (music file organizer, flash card 
> > > > > > > program,
> > > > > > > a find&replace function for files on the hard drive instead of 
> > > > > > > text IN
> > > > > > > a file, etc...) and then start writing that application. It takes
> > > > > > > longer to complete the application this way than it would for 
> > > > > > > someone
> > > > > > > more experienced in the language and platform, but I find that I 
> > > > > > > learn
> > > > > > > a lot more about the platform a lot faster than just reading a 
> > > > > > > book or...
>
> read more »

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to