Java in iOS for Xcode

So I have made a code in Java that I would like to turn in to an application. I have a little background withmaking applescript apps for mac, but is it even possible to make an iOS app using java? I know that mobile apple devices don't support java to begin with but can it be used for development? Please let me know if you have any recource guides or input.


-Thanks

MacBook Pro, OS X Mountain Lion (10.8.2), 2.3 GHz i5, 4GB RAM, OCZ 120GB SSD

Posted on Apr 15, 2013 7:00 PM

Reply
5 replies

Apr 16, 2013 9:57 PM in response to MacMan240

Hi Dear,


As you already know, Apple does not support Java to create applications for iOS. In fact, the native language in both Mac OS X and iOS is Objective-C, although it is possible to use C, C++ and Objective-C++.


Cocoa is a suit of object-oriented libraries, tools and environment to create applications for Mac OS X. There is a lite version of Cocoa, named Cocoa Touch which is used in iOS. The foundations of both Cocoa and Cocoa Touch are the same. So if you learn to program for Mac, you can simply apply that knowledge to create iOS applications too.


Anyway, the first step in the road to become an iOS or Mac developer, is to be familiar with the operating system and it's technology layer. The best place to start is developer.apple.com. You can find all the tools and necessary knowledge there.


But remember that to become a good Objective-C programmer, requires you to be a good C programmer. Although Objective-C adds OOP features to C and applying OO design and techniques in Objective-C, may seems not to require advanced C programming, but this is not true. I highly recommend to learn C, although you can start to learn some starting materials in Mac/iOS programming.


Needles to say that C is the strongest, most common programming language, which is the basis for many modern programming languages used today, such as C#, Java, Objective-C, C++ and more.


My over 20 years experience in programming, says that the best way to learn a programming language, is reading books. For you to get started, I recommend a book which is designed with a new coming student in mind. These books are written as a text book and have serveral simple exercises to solve. There are many books like this on the market. The first book I have read on C programming, was Teach Yourself C, from Herbert Schildt. I am sure there are many good, and may be better titles out there, but you should know that Schildt is the author of the best selling programming titles in the world.


I am also an author and trainer, currently working on a web site to be an academic place for those interested in the C family of programming languages, specially C++, Objective-C and the C itself. I have also started to write a book to teach Objective-C a few days ago. It's actually at the start, but I am trying hard to finish it as soon as possible.


Just remember that programming for Apple devices and writing good quality code, is not possible without being a good C prgrammer in the first place. I am trying to bring my 2 decades experince to the web for those people like you.


Anyway, I am here and will be happy to answer your questions if I am able to do so. I hope this helps.


Good luck


Mani Ghasemnia Hamedani

Apr 17, 2013 4:44 AM in response to Mani Hamedani

As Mani mentioned, Herbert Shildt's book is an excellent learning source.


Since you are a Java programmer, it wouldn't be difficult for you to pick up the language. Java is in the C family (c, c++, java) have the same syntactical structure. The big difference is that memory management is handled by the JVM whereas C and C++ you will have to ensure the releases of the memory yourself. Objectve-C has an option to autorelease memory (you can set as part of the proejct creation).


I am using Sam's Teach Yourself iOS 6 Application Development in 24 Hours. It is easy reading, introduces the language and walks you through examples and the use of the Xcode IDE.


I also borrowed Learning Cocoa with Objective-C from the library. Another book is A Beginner's Guide - iOS SDK Programming. This book also has a chapter on C refresher chapter.


If you are a seasoned programmer, the above books and the developer.apple.com would get you started.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Java in iOS for Xcode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.