Why Do We Have ...

Discussion in 'Java' started by Lawrence D'Oliveiro, Mar 21, 2011.

  1. .... <http://developer.android.com/reference/android/net/Uri.html>

    versus

    <http://developer.android.com/reference/java/net/URI.html>

    ?

    --
    someone who just had to write

    final android.net.Uri Target = Data.getData();
    ...
    new java.io.FileInputStream
    (
    new java.io.File(new java.net.URI(Target.toString()))
    )
    Lawrence D'Oliveiro, Mar 21, 2011
    #1
    1. Advertising

  2. Lawrence D'Oliveiro

    Nigel Wade Guest

    On 21/03/11 07:23, Lawrence D'Oliveiro wrote:
    > ... <http://developer.android.com/reference/android/net/Uri.html>
    >
    > versus
    >
    > <http://developer.android.com/reference/java/net/URI.html>
    >


    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.

    --
    Nigel Wade
    Nigel Wade, Mar 21, 2011
    #2
    1. Advertising

  3. Lawrence D'Oliveiro

    Lew Guest

    Nigel Wade wrote:
    > Lawrence D'Oliveiro wrote:
    >> ...<http://developer.android.com/reference/android/net/Uri.html>
    >>
    >> versus
    >>
    >> <http://developer.android.com/reference/java/net/URI.html>
    >>

    >
    > 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'?

    --
    Lew
    Honi soit qui mal y pense.
    http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
    Lew, Mar 21, 2011
    #3
  4. On 21/03/2011 12:57, Lew allegedly wrote:
    > 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:)
    Daniele Futtorovic, Mar 21, 2011
    #4
  5. Lawrence D'Oliveiro

    markspace Guest

    On 3/21/2011 1:46 AM, Leif Roar Moldskred wrote:
    > Lawrence D'Oliveiro<_zealand> wrote:
    >> ...<http://developer.android.com/reference/android/net/Uri.html>
    >>
    >> versus
    >>
    >> <http://developer.android.com/reference/java/net/URI.html>
    >>
    >> ?
    >>

    >
    > "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?
    markspace, Mar 21, 2011
    #5
  6. Lawrence D'Oliveiro

    Arne Vajhøj Guest

    On 21-03-2011 03:23, Lawrence D'Oliveiro wrote:
    > ...<http://developer.android.com/reference/android/net/Uri.html>
    >
    > versus
    >
    > <http://developer.android.com/reference/java/net/URI.html>
    >
    > ?


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

    Arne
    Arne Vajhøj, Mar 21, 2011
    #6
  7. In message <>, Leif Roar
    Moldskred wrote:

    > Lawrence D'Oliveiro <_zealand> wrote:
    >> ... <http://developer.android.com/reference/android/net/Uri.html>
    >>
    >> versus
    >>
    >> <http://developer.android.com/reference/java/net/URI.html>
    >>
    >> ?

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


    Defeated somewhat by having to use both, didn’t you think?
    Lawrence D'Oliveiro, Mar 22, 2011
    #7
  8. Lawrence D'Oliveiro

    Lew Guest

    Arne Vajhøj wrote:
    > Lawrence D'Oliveiro wrote:
    >> ...<http://developer.android.com/reference/android/net/Uri.html>
    >>
    >> versus
    >>
    >> <http://developer.android.com/reference/java/net/URI.html>
    >>
    >> ?

    >
    > 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?)

    --
    Lew
    Honi soit qui mal y pense.
    http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
    Lew, Mar 22, 2011
    #8
  9. On 21-03-2011 23:45, Lawrence D'Oliveiro wrote:
    > In message<>, Leif Roar
    > Moldskred wrote:
    >
    >> Lawrence D'Oliveiro<_zealand> wrote:
    >>> ...<http://developer.android.com/reference/android/net/Uri.html>
    >>>
    >>> versus
    >>>
    >>> <http://developer.android.com/reference/java/net/URI.html>
    >>>
    >>> ?

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

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


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

    Arne
    Arne Vajhøj, Mar 22, 2011
    #9
  10. In message <4d89343e$0$23752$>, Arne Vajhøj wrote:

    > On 21-03-2011 23:45, Lawrence D'Oliveiro wrote:
    >
    >> In message<>, Leif Roar
    >> Moldskred wrote:
    >>
    >>> Lawrence D'Oliveiro<_zealand> wrote:
    >>>> ...<http://developer.android.com/reference/android/net/Uri.html>
    >>>>
    >>>> versus
    >>>>
    >>>> <http://developer.android.com/reference/java/net/URI.html>
    >>>>
    >>>> ?
    >>>
    >>> "In the interest of performance, this class performs little
    >>> to no validation."

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

    >
    > 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()))
    )
    Lawrence D'Oliveiro, Mar 23, 2011
    #10
  11. Lawrence D'Oliveiro

    Roedy Green Guest

    On Mon, 21 Mar 2011 11:00:19 +0000, Nigel Wade <>
    wrote, quoted or indirectly quoted someone who said :

    >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.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    Doing what the user expects with respect to navigation is absurdly important for user satisfaction.
    ~ anonymous Google Android developer
    Roedy Green, Mar 31, 2011
    #11
  12. In message <>, Roedy Green wrote:

    > 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. :)
    Lawrence D'Oliveiro, Apr 2, 2011
    #12
  13. On 31/03/2011 13:18, Roedy Green wrote:
    > On Mon, 21 Mar 2011 11:00:19 +0000, Nigel Wade<>
    > wrote, quoted or indirectly quoted someone who said :
    >
    >> 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.


    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.

    --
    Dirk

    http://www.neopax.com/technomage/ - My new book - Magick and Technology
    Dirk Bruere at NeoPax, Apr 3, 2011
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?cmdyYW5kaWRpZXI=?=

    Can I have base class derived from System.Web.UI.Page have design

    =?Utf-8?B?cmdyYW5kaWRpZXI=?=, Jul 22, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    461
    Patrice
    Jul 22, 2005
  2. =?Utf-8?B?ZGF2aWQ=?=
    Replies:
    6
    Views:
    5,462
    Kevin Spencer
    Aug 18, 2005
  3. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    839
    Mark Rae
    Dec 21, 2006
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,688
    Smokey Grindel
    Dec 2, 2006
  5. Nanostuff
    Replies:
    9
    Views:
    128
    Gary Wright
    Mar 1, 2007
Loading...

Share This Page