★ TouchArcade needs your help. Click here to support us on Patreon.

How Important Is Java in iPhone apps?

09-03-2010, 10:08 PM
#1
Joined: Mar 2009
Location: London, UK
Posts: 2,280
How Important Is Java in iPhone apps?

I am currently studying Java, and was wondering how important it's role is in iPhone programming. I am also trying to develop a pretty neat UI and have no Objective-C knowledge, and have heard that some devs use other languages to program UI's and stuff. Is this even possible to do, and if so, is it easier or more difficult than doing it in Objective-C.

You are not pretty enough to be that stupid.
09-04-2010, 12:18 AM
#2
Joined: Oct 2008
Location: Toronto Canada
Posts: 863
Learning Java might be an OK way get the hang of general programming patterns but you can't use it directly for iOS programming.

If your UI ideas are based around Apple's UIKit widgets you're better off diving right into Objective-C, Cocoa, and interface builder. You can create a UI from scratch using OpenGLES or some other lower-level view classes but even then you'll need at least a little Objective-C and Cocoa knowledge to setup the layers and handle events.

Only other option is to use a 3rd party library/engine, but even some of those require Objective-C.

SHREDD GO FAST! FREE!
Nozoku Rush Kick Math's Ass!
Critter Panic Break yer brain! FREE!
Silverfish & Silverfish MAX Hardcore arcade insanity!
Nozoku A casual game of math & logic.
More: cbox.me Twitter YouTube

09-04-2010, 01:20 AM
#3
Joined: Mar 2009
Location: London, UK
Posts: 2,280
Quote:
Originally Posted by Frank Condello View Post
Learning Java might be an OK way get the hang of general programming patterns but you can't use it directly for iOS programming.

If your UI ideas are based around Apple's UIKit widgets you're better off diving right into Objective-C, Cocoa, and interface builder. You can create a UI from scratch using OpenGLES or some other lower-level view classes but even then you'll need at least a little Objective-C and Cocoa knowledge to setup the layers and handle events.

Only other option is to use a 3rd party library/engine, but even some of those require Objective-C.
I figured I would start learning Java first as its similar to Objective-C and learning java will make it easier once I start to learn Obj-C. As for OpenGLES, I have absolutely no idea how to use it, program with it, or even launch the application. Thanks for the help, I appreciate it.

Is there any specific reason(s) why you cannot directly use Java in iOS development?


And lastly, I have been trying to find a good alternative to Textpad, a text editor for windows, but for the mac. I figured that Xcode could serve as a substitute seeing as how it is a compiler and all. Is it wrong to think that Xcode will work for compiling Java code, even though its meant for Obj-C programming? I have the Eclipse program (for mac), but do not know how to use it, as I have only used TextPad.

You are not pretty enough to be that stupid.
09-04-2010, 01:21 AM
#4
Joined: Mar 2009
Location: Canada
Posts: 1,076
Java is stale. Learn C/C++, which of course transfers over into ObjC as well as Javascript, so you are covered from web to handheld to desktop.

You can still write Java applications for the iPhone, but there is no built-in VM, so you have to jailbreak and get one through Cydia.

Apple doesn't like Java because it's bloated and slow and ugly, the opposite of Apple's design goals.

😈

Last edited by sticktron; 09-04-2010 at 01:25 AM.
09-04-2010, 02:31 AM
#5
Joined: Oct 2008
Location: Toronto Canada
Posts: 863
Quote:
Originally Posted by iphoneprogrammer View Post
I figured I would start learning Java first as its similar to Objective-C and learning java will make it easier once I start to learn Obj-C.
Not so much actually. If you want to start with a "core" language start with plain old C. Objective-C is a superset of C, so any C you know can be applied directly (unlike Java).

If you're building for iOS or Mac OS X then Xcode is the path of least resistance as far as code editors go. AFAIK Xcode still supports Java development to some extent if you insist on going that route, but I've never used it for Java personally and it's certainly no longer a priority for Apple.

As far as other text editors go, I always keep TextWrangler handy - it's free and lightweight and has great multi-file search & replace. I use Coda for all my web development and can highly recommend it for HTML/JS/PHP stuff. Some folks swear by TexMate but I could never get into it. I wouldn't call any of these a replacement for Xcode, but if yer so inclined you can use any text editor and compile from the terminal without ever touching Xcode.

SHREDD GO FAST! FREE!
Nozoku Rush Kick Math's Ass!
Critter Panic Break yer brain! FREE!
Silverfish & Silverfish MAX Hardcore arcade insanity!
Nozoku A casual game of math & logic.
More: cbox.me Twitter YouTube
09-04-2010, 10:05 AM
#6
Joined: Mar 2009
Location: London, UK
Posts: 2,280
Quote:
Originally Posted by Frank Condello View Post
Not so much actually. If you want to start with a "core" language start with plain old C. Objective-C is a superset of C, so any C you know can be applied directly (unlike Java).

If you're building for iOS or Mac OS X then Xcode is the path of least resistance as far as code editors go. AFAIK Xcode still supports Java development to some extent if you insist on going that route, but I've never used it for Java personally and it's certainly no longer a priority for Apple.

As far as other text editors go, I always keep TextWrangler handy - it's free and lightweight and has great multi-file search & replace. I use Coda for all my web development and can highly recommend it for HTML/JS/PHP stuff. Some folks swear by TexMate but I could never get into it. I wouldn't call any of these a replacement for Xcode, but if yer so inclined you can use any text editor and compile from the terminal without ever touching Xcode.
I've read a lot about TextMate and Textwrangler, however I am looking for a free alternative to TextPad and TextMate costs $. So ill give textwrangler a try. I truly appreciate all the info your giving me, it helps so much!! Thank you.

You are not pretty enough to be that stupid.
09-04-2010, 10:48 PM
#7
Joined: Dec 2008
Location: The Land of The Rising Sun
Posts: 146
If you are interested in iPhone developing, I guess I would ask why Java is the language you are learning. If the iPhone programming is your only goal, you absolutely just get started with Objective C.

My guess, though, is that you might be taking a programming class. Java is pretty common for programming classes, I think, and in that case I would say, you should absolutely, positively stay in the class and learn Java. Learning programming in any language is going to be more helpful than not knowing any programming language, and for many people having a class is going to be better than trying to teach yourself (although it can be done).

Just to give my background, other than dabbling in BASIC when I was younger, I started with a class in C++ in high school, moved to working in Java (doing a lot of Enterprise applications and things) for work, and did some web applications (also Java or PHP) after college. So, prior to moving to the iPhone, Java was my strongest language.

And, in my opinion, the move from Java to Objective C wasn't that bad. There were a couple of syntax differences, of course. And memory management is different. (Java has garbage collection but the iPhone SDK doesn't). But I think if you know one, then you can move to the other without too much of a problem. One of the nice things about Java is that, like Objective C, both use the Objective Oriented Paradigm. So you will be used to structuring your code in classes.

I do agree that Java is a little bit stale these days. In terms of the computer industry at large, I don't think it is quite as "hot" as it used to be. But remember that the Android SDK is (sort of) Java. And if you are just getting started with programming, then most of the concepts you are learning will carry over to Objective C quite easily.

Developer of Petri. Available now on the iTunes Store.

These days I work with Tonchidot on Sekai Camera.
09-04-2010, 10:53 PM
#8
Joined: Mar 2009
Location: London, UK
Posts: 2,280
Quote:
Originally Posted by gillygize View Post
If you are interested in iPhone developing, I guess I would ask why Java is the language you are learning. If the iPhone programming is your only goal, you absolutely just get started with Objective C.

My guess, though, is that you might be taking a programming class. Java is pretty common for programming classes, I think, and in that case I would say, you should absolutely, positively stay in the class and learn Java. Learning programming in any language is going to be more helpful than not knowing any programming language, and for many people having a class is going to be better than trying to teach yourself (although it can be done).

Just to give my background, other than dabbling in BASIC when I was younger, I started with a class in C++ in high school, moved to working in Java (doing a lot of Enterprise applications and things) for work, and did some web applications (also Java or PHP) after college. So, prior to moving to the iPhone, Java was my strongest language.

And, in my opinion, the move from Java to Objective C wasn't that bad. There were a couple of syntax differences, of course. And memory management is different. (Java has garbage collection but the iPhone SDK doesn't). But I think if you know one, then you can move to the other without too much of a problem. One of the nice things about Java is that, like Objective C, both use the Objective Oriented Paradigm. So you will be used to structuring your code in classes.

I do agree that Java is a little bit stale these days. In terms of the computer industry at large, I don't think it is quite as "hot" as it used to be. But remember that the Android SDK is (sort of) Java. And if you are just getting started with programming, then most of the concepts you are learning will carry over to Objective C quite easily.
Well where I am taking classes, the prerequisites require me to start at Java, I have asked around to see what classes offer Obj-C but none do. So rather than not taking any programming classes at all, I decided to go with java. I figured that the syntax's would be a bit different, and that Java was somewhat similar Obj-C, so I thought this to be a good place to start.

You are not pretty enough to be that stupid.
09-04-2010, 11:27 PM
#9
Joined: Dec 2008
Location: The Land of The Rising Sun
Posts: 146
Yeah. That is very common, and what I guessed was your situation when you said you were learning Java. It is very common for Java to be taught in beginning computer classes. Objective C is not usually taught at all in programming courses, since it is basically tied to Apple. (There are, of course, the Stanford lectures and a growing number of exceptions). Other than the Mac and iOS devices, nothing much else uses Objective C.

But again, I would not worry too much about starting with Java. It will not be the case that trying to learn Objective C will be like starting from scratch. You are going to see tons of things that are familiar, and the transition shouldn't be that difficult.

Developer of Petri. Available now on the iTunes Store.

These days I work with Tonchidot on Sekai Camera.
09-04-2010, 11:47 PM
#10
Joined: Dec 2008
Location: The Land of The Rising Sun
Posts: 146
Oh, and as far as editors go, TextWrangler is an awesome free editor for the Mac. Another free one worth looking at is Fraise (which used to be called Smultron) which has a large fan base.

If you are really, really serious about development and want to invest some time into learning a more powerful editor, the Mac has also has free port of two of the most commonly used text UNIX editors: Vi and Emacs. The Mac comes with Vim, you can open it in the terminal by typing "vim". Or you can download MacVim, which is my editor of choice. I
think there is are also a free Emacs versions called something like Aquamacs.

Both of these editors will be confusing at first and you will need to read and use them a lot before you start to get the hang of it, but over time it will start to payoff. (Sort of like programming itself). After awhile you will be able to jump around a document to exactly where you want to go in an practically an instant, without your fingers ever touching the mouse.

In iPhone programming, I personally use MacVim (a version of vi). But I sometimes get forced back into XCode for various things.

Developer of Petri. Available now on the iTunes Store.

These days I work with Tonchidot on Sekai Camera.