So I'm wondering if anyone has done any iOS apps in Java.
I am taking delivery of a Mac Mini in the next week or two, and I could
use Xcode to create iOS apps. But with the exception of a few small
projects I'm doing that require C, I don't want to ever use the language
again.
Ever. :)
--
Steve Sobol, Apple Valley, California, USA
sjs...@JustThe.net
> I read somewhere that Apple has relaxed its restrictions on what tools
> can be used to develop iPhone/iPad software. This happened a couple
> months ago.
>
> So I'm wondering if anyone has done any iOS apps in Java.
iOS doesn't include a JVM, and you can't install one unless you jail-
break the device. The relaxed restrictions may allow a JVM to be built
for iOS now, but AFAIK it hasn't happened yet.
> I am taking delivery of a Mac Mini in the next week or two, and I could
> use Xcode to create iOS apps. But with the exception of a few small
> projects I'm doing that require C, I don't want to ever use the language
> again.
Good thing iOS apps (like Mac OS X apps) aren't written in plain old C
then. :-) They're written in a modern object-oriented superset of C
called Objective-C.
sherm--
--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer
If by "modern" one means a language designed 20 years ago and having
enjoyed very little improvement since then, other than a mad rush over
the last few years to play catch up to languages like Java and C#.
But some of Objective-C's annoyances (like no language enforcement of
proper object initialization) just aren't ever going to be fixed.
Me, if I were forced to write an iPhone app, I'd much rather use
something like MonoTouch than mess around with a native iOS app. If I'd
seen Objective-C back in 1990, I'd have swooned like everyone else. But
today? Meh.
If you want to write Java on a phone, I'd suggest going Android. And no
Big Brother there to tell you what kind of program you're allowed to write.
Pete
> If by "modern" one means a language designed 20 years ago and having
> enjoyed very little improvement since then, other than a mad rush over
> the last few years to play catch up to languages like Java and C#.
The way I understand it, Objective-C *is* C with a couple major changes.
> Me, if I were forced to write an iPhone app, I'd much rather use
> something like MonoTouch than mess around with a native iOS app. If I'd
> seen Objective-C back in 1990, I'd have swooned like everyone else. But
> today? Meh.
>
> If you want to write Java on a phone, I'd suggest going Android. And no
> Big Brother there to tell you what kind of program you're allowed to write.
Well, yeah. :) But there is a market for iOS apps. (Although Android has
enough market share that there is now ALSO a market for Android apps).
> Sherm Pendley wrote:
>> [...]
>> Good thing iOS apps (like Mac OS X apps) aren't written in plain old C
>> then. :-) They're written in a modern object-oriented superset of C
>> called Objective-C.
>
> If by "modern" one means a language designed 20 years ago and having
> enjoyed very little improvement since then
No, that's not what I meant. You're entitled to your own opinion of
course, but please don't attribute it to me. And please give it a rest -
we know you don't like Objective-C, there's no need to whine about
it every time someone mentions its name.
*plonk*
We all know you are passionately in love in Objective-C. There's no
need to tout it every time someone mentions it even tangentially.
> *plonk*
Whatever. Real men just use the killfile, they don't have to whine
about it.
Pete
> Sherm Pendley wrote:
>>> If by "modern" one means a language designed 20 years ago and having
>>> enjoyed very little improvement since then
>>
>> No, that's not what I meant. You're entitled to your own opinion of
>> course, but please don't attribute it to me. And please give it a rest -
>> we know you don't like Objective-C, there's no need to whine about
>> it every time someone mentions its name.
>
> We all know you are passionately in love in Objective-C.
No one who actually knew me could make such a bullshit claim with a
straight face. What I love use using the right tool for the job, what-
ever that happens to be. Forcing square pegs into round holes is for
one-trick ponies like you.
> There's no
> need to tout it every time someone mentions it even tangentially.
Mentioning Objective-C when someone asks about writing for iOS is
hardly tangential. It's the native language for the OS. Or did you miss
the subject line of the thread in your zealous desire to flame someone
with whom you have an irrational personal hatred?
>> *plonk*
>
> Whatever. Real men just use the killfile, they don't have to whine
> about it.
Boo hoo. Did I hit a nerve, little boy?
> The way I understand it, Objective-C *is* C with a couple major changes.
Yes, exactly. The changes in language syntax are actually fairly minor -
class and method declaration and message passing, primarily. In code
structure and design, the changes are far more apparent. An ObjC app
uses OOP ideas and the MVC design pattern.
With a bit of flexibility, a developer who's accustomed to Java won't
have much trouble with ObjC. It had, after all, a *lot* of influence on
Java's designers in the early days.
<http://cs.gmu.edu/~sean/stuff/java-objc.html>
> Well, yeah. :) But there is a market for iOS apps.
And, if you want access to that market, you can't write in Java. That
situation will almost certainly change, given Apple's change in policy,
but that change hasn't happened yet.
On the other hand, if you're writing for personal use, jail breaking
your iDevice is an option. As I understand it, one can install a JVM
on a jailbroken iDevice.
> With a bit of flexibility, a developer who's accustomed to Java won't
> have much trouble with ObjC. It had, after all, a *lot* of influence on
> Java's designers in the early days.
>
> <http://cs.gmu.edu/~sean/stuff/java-objc.html>
I doubt I'd have trouble with Objective-C. I know both Java and C++.
Honestly, the reason I don't like C and its derivatives is because it
gives me way too much power to completely break things :)
> And, if you want access to that market, you can't write in Java. That
> situation will almost certainly change, given Apple's change in policy,
> but that change hasn't happened yet.
Ok.
Thanks :)
Peter Duniho wrote:
>> Whatever. Real men just use the killfile, they don't have to whine
>> about it.
Sherm Pendley wrote:
> Boo hoo. Did I hit a nerve, little boy?
Dude, you take away the power of the plonk when you answer post-plonk. Now
Peter knows he can get a rise out of you even after you claim you aren't
listening. Certainly there's no chance that plonking him again will hit a
nerve, because he won't believe it.
I doubt very much that insulting him will penetrate his opinion. He'll
probably just project it back, insult you back, no doubt to feed his manic
glee, and the discussion of Java on iOS will be gone completely. You want to
defeat him, stay resolutely on topic and let anything else from him be as the
whispering of the wind.
Is there any concrete evidence that Apple is considering supporting Java on
iOS, or is it just expectation?
Oh, and BTW, :-)
--
Lew
;-)
> Dude, you take away the power of the plonk when you answer post-plonk.
My plonks are time-delayed - I generally read the rest of the conver-
sation that triggered it, even if I have no interest in reading anything
the plonkee has to say in the future. :-)
> Is there any concrete evidence that Apple is considering supporting
> Java on iOS
None - they're notoriously close-mouthed about their future plans. But
they *have* relented on the policy that would have prevented third
parties from doing so, so IMHO it's a pretty safe bet that *someone*
will do it, even if Apple doesn't.
> Is there any concrete evidence that Apple is considering supporting
> Java on iOS, or is it just expectation?
>
> Oh, and BTW, :-)
I doubt Apple will ever put a JVM on iOS. The app store has a policy
against running programs that interpret code, if i remember correctly.
This prevents all languages that are interpreted: python, ruby, etc.
If a jvm ever did show up on iOS, it would be restricted just like the
rest of the applications are, and to that end it couldn't really be
called java.
> Lew <no...@lewscanon.com> wrote:
>
>> Is there any concrete evidence that Apple is considering supporting
>> Java on iOS, or is it just expectation?
>>
>> Oh, and BTW, :-)
>
> I doubt Apple will ever put a JVM on iOS. The app store has a policy
> against running programs that interpret code, if i remember correctly.
You remember correctly, but that policy was changed recently. Interp-
reters and bytecode environments are allowed now, but all of the app's
code has to be bundled in the app itself; it can't download & execute
code. (A web page being displayed in Mobile Safari isn't considered an
"app" in this context, and is allowed to download and execute JavaScript
code.)
The app store's size limit could prove to be a limiting factor though;
without a JVM provided by Apple, each app would need to include its
own, which would increase its footprint substantially.
> You remember correctly, but that policy was changed recently. Interp-
> reters and bytecode environments are allowed now, but all of the app's
> code has to be bundled in the app itself; it can't download & execute
> code. (A web page being displayed in Mobile Safari isn't considered an
> "app" in this context, and is allowed to download and execute
> JavaScript
> code.)
>
> The app store's size limit could prove to be a limiting factor though;
> without a JVM provided by Apple, each app would need to include its
> own, which would increase its footprint substantially.
>
> sherm--
Apple themselves are too invested in objective C and have discontinued
their Java APIs, so I don't think its likely that they will ever make a
VM for iOS. However, there is a JVM that runs on jail broken devices.
Maybe someone will port that. I could see a self contained J2ME emulator
or something springing up on the app store.
> Apple themselves are too invested in objective C and have discontinued
> their Java APIs, so I don't think its likely that they will ever make a
> VM for iOS. However, there is a JVM that runs on jail broken devices.
> Maybe someone will port that. I could see a self contained J2ME emulator
> or something springing up on the app store.
I don't think ME will do. SE would be necessary today.
Arne
> I don't think ME will do. SE would be necessary today.
>
> Arne
Yup. But it couldn't be implemented due to the restrictions of apple.
You could probably implement a lot of it if you were clever enough, but
certain key parts couldn't be done I don't think. Swing is a good
example...
> Yup. But it couldn't be implemented due to the restrictions of apple.
> You could probably implement a lot of it if you were clever enough, but
> certain key parts couldn't be done I don't think. Swing is a good
> example...
Swing has been implemented on Windows, X and Aqua.
I find it difficult to believe that it could not be
implemented on iOS.
I am perfectly willing to believe that a different GUI API
would work better.
Arne
Being plonked doesn't hit a nerve with me in any case. I'm just amused
at the childish need by some to actually _announce_ (truthfully or not)
that they've added me to a killfile.
Don't want to listen to me? Fine. It just means you haven't got any
real retort, so all you have left is to stop paying attention. That's
not exactly winning an argument. If anything, I take great pleasure in
seeing people killfile me. It doesn't happen often, and when it does, I
take it as a sign of resignation.
> I doubt very much that insulting him will penetrate his opinion.
And why should it anyway? Insults have nothing to do with the facts.
> He'll
> probably just project it back, insult you back, no doubt to feed his
> manic glee,
I rarely engage in insults. It's happened maybe once or twice in the
last five years, and it'll take a lot more than Sherm's sensitivity
about negative opinions regarding Objective-C to push me over the edge.
It's interesting to note you taking Sherm's side, when he's the one
throwing ad hominem around. I thought you knew better. But then, you
should have known better than to expect me to resort to insults in the
first place.
> and the discussion of Java on iOS will be gone completely.
> You want to defeat him, stay resolutely on topic and let anything else
> from him be as the whispering of the wind.
He's not going to "defeat" me on the topic of Objective-C (whatever
"defeat" means in this context…convince me I'm wrong?). It's not nearly
as reliable a language to code in as Java or C#, and nothing that's
happened in the last few years has changed that. Heck, even though they
added a semi-broken implementation of garbage-collection in 2.0 (which
only showed up about 20 years after 1.0), you still can't use GC on iOS
anyway. You're still stuck with the frustrating "retain/release"
paradigm there.
Fragile object construction is fundamental to the language, and I don't
think that'll ever change. Some things have gotten a lot better – it
now has closures, which isn't even in Java, and there are a bunch of new
"synthesis" features for auto-generating certain kinds of code – but
frankly, Objective-C still has plenty of ways to shoot yourself in the
foot, much more than anything I'd call a _truly_ modern language.
I'll give Objective-C props for one thing: it's certainly as powerful as
most any other "modern" language, and the Cocoa framework Apple provides
is very good. But as programmers have proven time and time again, even
the good ones really benefit a great deal from a language that focuses
on reliability first, and power second.
Pete
> Swing has been implemented on Windows, X and Aqua.
>
> I find it difficult to believe that it could not be
> implemented on iOS.
>
> I am perfectly willing to believe that a different GUI API
> would work better.
Yes but all of those are traditional computer interfaces. iOS is geared
towards touch screens and small form factors. Swing is geared towards
good old mouse and keyboard.
> Fragile object construction is fundamental to the language, and I don't
> think that'll ever change. Some things have gotten a lot better – it
> now has closures, which isn't even in Java, and there are a bunch of new
> "synthesis" features for auto-generating certain kinds of code
Sounds like they're groping their way slowly and blindly towards
reinventing Lisp -- particularly, functional programming and macros.
Everybody tries Lisp, rejects it because of the infamous prefix math and
parentheses, then spends the rest of their careers using languages that
are trying to recapture all of the goodness of Lisp without giving in to
the evils of prefix math and parentheses.
Some do better -- Ruby, Smalltalk -- and some do worse. (If you want
really bad, try Visual Basic. Now please pardon me while I go wash my
mouth out with soap.)
> frankly, Objective-C still has plenty of ways to shoot yourself in the
> foot, much more than anything I'd call a _truly_ modern language.
Any powerful language does. The foot bullets just look different.
With C and derivatives it's blue screens and segfaults.
Java gives you exception stacktraces, particularly NPEs,
ClassCastException (:)), variations of the themes of ParseException and
IndexOutOfBoundsException, and an assortment of headscratchers. (For
these purposes, SAXException, MalformedURLException, and
NumberFormatException are considered variations on the theme of
ParseException, and NoSuchElementException IndexOutOfBoundsException.)
Oh, and an assortment of anal compiler errors.
Lisp gives you stack overflows and infinite loops when you screw up, or
nils propagating through everything and your program output coming out as
"nil".
Smalltalk has the infamous red-bordered debugger window, almost always a
DoesNotUnderstand caused by a type error that'd silently propagated for a
while.
BASICs run out of memory or give you cryptic wrong results and infinite
loops, thanks to the tendency to write spaghetti code without higher
level constructed types in it. Plus plenty of array bounds errors.
Shell will just quietly erase your filesystem or spam the console with
garbage interspersed with file-not-found errors after going completely
off the rails.
The other scripting languages -- particularly Ruby, Python, and Perl --
generate an assortment of errors mostly reminiscent of either BASIC or
Java depending, although in Perl's case the most common symptom may be
the programmer checking himself into a mental institution after a
while. :)
A unique pattern with the scripting languages is string manglage -- auto-
generated emails sent to "for" or even to "domain@host", for instance, or
serving up a Web page saying "Current temperature: array index out of
bounds Current air pressure: file not found". Yes, it's quite easy for
the TEXT of the error messages to get mixed into the output! But the foot
bullet symptom particularly characteristic of these is your e-voting site
playing the Michigan U fight song every time someone casts a ballot. In
other words, you get hacked.
Haskell and the ML family yield up a wide variety of compile errors
involving type inference, some real hair-pullers, but on the other hand
if it does compile it actually probably works.
> I'll give Objective-C props for one thing: it's certainly as powerful as
> most any other "modern" language
Well, duh. I assume the developers of Objective-C at least managed to
churn out something that was Turing-complete.
> But as programmers have proven time and time again, even
> the good ones really benefit a great deal from a language that focuses
> on reliability first, and power second.
Why choose only one when you can use Clojure? :)
OH, I'm so sorry - I actually don't think there's anything wrong with what you
said. There was a smiley-face in my post, you know. It was not arbitrary.
I'm not taking Sherm's side on anything, really - I just didn't want to come
from an antagonistic perspective in my discussion with him. Truly, Pete, I
respect your knowledge and opinions, and agree with you more than you probably
credit. In real life I know you weren't insulting anyone nor have any manic
glee.
Please accept my apology for sounding like I was coming down on you.
That post was a reductio ad absurdum scenario in which I hoped to illustrate
the pointlessness of arguing with you even if you were such a person as I
seemed to describe. It should be obvious to anyone that there's no point in
arguing that way with a person who's being reasonable.
For the record it was a hypothetical scenario - any resemblance to actual
persons living or dead is purely coincidental.
--
Lew
> Apple themselves are too invested in objective C and have discontinued
> their Java APIs,
Even on OSX?
> In article <1748041589308795471.810250nospam-
> nowhe...@ssl.astraweb.com>, nos...@nowhere.net says...
>
>> Apple themselves are too invested in objective C and have discontinued
>> their Java APIs,
>
> Even on OSX?
If projectmoon is referring to Java support for Cocoa, then yes - that
was deprecated a couple of OS releases ago, and hasn't been updated
since. They still support "pure Java" apps though, and provide a J2SE
port that includes a native L&F for Swing apps.
> I'm not taking Sherm's side on anything, really - I just didn't want
> to come from an antagonistic perspective in my discussion with him.
FWIW, thank you for that.
> On Thu, 14 Oct 2010 18:12:00 -0700, Peter Duniho wrote:
>
>> Fragile object construction is fundamental to the language, and I don't
>> think that'll ever change. Some things have gotten a lot better ? it
>> now has closures, which isn't even in Java, and there are a bunch of new
>> "synthesis" features for auto-generating certain kinds of code
>
> Sounds like they're groping their way slowly and blindly towards
> reinventing Lisp -- particularly, functional programming and macros.
>
> Everybody tries Lisp, rejects it because of the infamous prefix math and
> parentheses, then spends the rest of their careers using languages that
> are trying to recapture all of the goodness of Lisp without giving in to
> the evils of prefix math and parentheses.
The funny thing is, LISP was not originally intended to have prefix
arithmetic and lots of irritating spurious parentheses. The brackety
syntax was something like an intermediate representation in a compiler,
and the intent was to define an 'M-syntax' that looked more like a normal
language (for 1958 values of 'normal' - it would probably have been like
FORTRAN or ALGOL), which a frontend would translate into the simpler and
more regular S-expressions to hand to the interpreter or code generator at
the backend.
However, the M-syntax was not even defined by the time the backend was
ready, so LISP was released with just the S-expression syntax. It was
intended that this would be a temporary situation, and the M-syntax would
follow soon, but it turned out people were happy programming in
S-expressions, and were more interested in getting other features
implemented. The M-syntax never happened - or rather, still hasn't
happened. Or rather, there have been implementations, but they've never
really taken off.
At some point, i suppose, ALGOLish syntaxes became so ingrained in the
popular consciousness that the fact that LISP still didn't have one became
a barrier to its adoption.
tom
--
THE DRUMMER FROM DEF LEPPARD'S ONLY GOT ONE ARM!
> If projectmoon is referring to Java support for Cocoa, then yes - that
> was deprecated a couple of OS releases ago, and hasn't been updated
> since. They still support "pure Java" apps though, and provide a J2SE
> port that includes a native L&F for Swing apps.
>
> sherm--
Yeah that is what I am referring to.
> > In article <1748041589308795471.810250nospam-
> > nowhe...@ssl.astraweb.com>, nos...@nowhere.net says...
> >
> >> Apple themselves are too invested in objective C and have discontinued
> >> their Java APIs,
> >
> > Even on OSX?
>
> If projectmoon is referring to Java support for Cocoa, then yes - that
> was deprecated a couple of OS releases ago, and hasn't been updated
> since. They still support "pure Java" apps though, and provide a J2SE
> port that includes a native L&F for Swing apps.
OK. That's fine. I have a friend shipping an older Intel Mac Mini to me
- the main reason I bought it from him was to do some OS X Java
development.
As far as I'm concerned, a native Look and Feel is an acceptable
alternative to Cocoa support, especially if the L&F was created and is
blessed by Apple.
After all, to make my Windows Java apps look native, I have to use an
L&F other than the default. Sounds like OS X works the same way.
> > If projectmoon is referring to Java support for Cocoa, then yes -
that
> > was deprecated a couple of OS releases ago, and hasn't been updated
> > since. They still support "pure Java" apps though, and provide a J2SE
> > port that includes a native L&F for Swing apps.
> >
> > sherm--
>
> Yeah that is what I am referring to.
Thanks. I was a little worried that *all* OS X Java support was being
discontinued.