Why Do We Have ...

  • Thread starter Lawrence D'Oliveiro
  • Start date
L

Lew

Nigel said:
We don't.

We have:
http://download.oracle.com/javase/6/docs/api/java/net/URI.html

If you want to know why Android isn't Java you may be better asking Android.

Hey, "Larry", why does Apache Commons Collections have
'org.apache.commons.collections.map.HashedMap' versus 'java.util.HashMap'?

Answer:

BECAUSE IT'S A DIFFERENT LIBRARY!

Related question, "Larry"-boy:

Why does Hibernate have 'org.hibernate.criterion.Property' vs.
'org.hibernate.tuple.Property' vs. 'org.hibernate.mapping.Property' vs.
'java.awt.image.renderable.RenderableImageOp'?
 
D

Daniele Futtorovic

Why does Hibernate have 'org.hibernate.criterion.Property' vs.
'org.hibernate.tuple.Property' vs. 'org.hibernate.mapping.Property' vs.
'java.awt.image.renderable.RenderableImageOp'?

Yeah, I've always wondered about that last one...

:eek:)
 
M

markspace

"In the interest of performance, this class performs little
to no validation."


It's almost as if they're expecting a programmer to be literate enough
to RTFM or something.

Yeah, I know, I'm piling on at this point, but really Lawerence is
getting annoying with posts that say very little and evince very little
thought.

To the OP: that's intended as constructive criticism. Could you try to
put more thought, and a little more thoughtful verbiage, in your future
posts?
 
L

Lawrence D'Oliveiro

Leif Roar said:
"In the interest of performance, this class performs little
to no validation."

Defeated somewhat by having to use both, didn’t you think?
 
L

Lew

Arne said:
If you read the documentation, then you would
see that the classes are very different regarding
what functionality they provide.

Oh, that that premise *ever* were valid! (I'm speaking industry-wide, not of
any one particular individual, of course. Naturally. What else?)
 
L

Lawrence D'Oliveiro

No, because you don't need to use both.

How would you rewrite my example, then?

Here it is again:

final android.net.Uri Target = Data.getData();
...
new java.io.FileInputStream
(
new java.io.File(new java.net.URI(Target.toString()))
)
 
R

Roedy Green

If you want to know why Android isn't Java you may be better asking Android.

Android is a resource starved-environment compared with Java desktop.
Apps are small. You are constantly trying to shave bytes and CPU
cycles at the expense of program readability. You have roughly 200 ms
to respond or the user will perceive you as laggy. You have 5 seconds
to respond before the OS says your app has died. Your user is more
impatient and you have fewer resources to satisfy him. You are doing
everything you can to avoid draining the battery. This means letting
the screen go off, cpu turn off etc. whenever possible.

Since apps are smaller, there is more competition. If yours is not
best of breed, you will be quickly be replaced. Since apps are free or
cheap, users have no investment is sticking with what they first try.
 
L

Lawrence D'Oliveiro

Android is a resource starved-environment compared with Java desktop.

In fact the typical current Android smartphone has enough RAM and CPU power
to run a full-featured desktop OS. That’s not the limiting factor at all.
Apps are small. You are constantly trying to shave bytes and CPU
cycles at the expense of program readability.

I haven’t felt the need to go that far—yet.
You have roughly 200 ms to respond or the user will perceive you as laggy.

That happens on the desktop as well.
You have 5 seconds to respond before the OS says your app has died.

That kind of discipline is useful on the desktop as well.
Your user is more impatient and you have fewer resources to satisfy him.
You are doing everything you can to avoid draining the battery.

The battery can be a limiting factor, but the real issue is the user
interface: you simply haven’t got room for a full-size screen, a full-size
keyboard, or a full-size mouse. So you have to interact through narrower-
bandwidth channels.
Since apps are smaller, there is more competition. If yours is not
best of breed, you will be quickly be replaced. Since apps are free or
cheap, users have no investment is sticking with what they first try.

Which puts the high-overhead corporate code-cutter approach at a severe
disadvantage. :)
 
D

Dirk Bruere at NeoPax

Android is a resource starved-environment compared with Java desktop.
Apps are small. You are constantly trying to shave bytes and CPU
cycles at the expense of program readability. You have roughly 200 ms
to respond or the user will perceive you as laggy. You have 5 seconds
to respond before the OS says your app has died. Your user is more
impatient and you have fewer resources to satisfy him. You are doing
everything you can to avoid draining the battery. This means letting
the screen go off, cpu turn off etc. whenever possible.

That's got to change, at least with Honeycomb.
I am working on a £200 ($300) Android 2.2 Tablet with a Tegra 2 chipset
and half a gig or RAM. That kind of processing power was found on
desktops not very long ago.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top