Java Beginner - Coding on Macbook Pro (Blackberry App building) - eclipse

I'm just beginning to teach myself Java coding, in hopes of building a few blackberry apps.
I assume I should:
learn the basics.
buy a blackberry app building book - learn the ropes
acuqire necessary software - here's where my questions begin...
Do I use Eclipse as the IDE? What about the Java API? Remember, I'm a complete newb, so my jargon may be somewhat...well...wrong. But, I think these two peices are initial steps, no?
And most importantly, should I even be trying to code on my Macbook Pro? Or should I stick to my IBM compatibable, and learn from there?
Thanks for your help!

I'll answer each of your questions separately.
Yes, you have the basics of how you should learn. More than anything, it is important to understand the concepts of the Java language before you go too far in development because understanding those concepts can be the difference between a successful application and a failure (which will, ultimately, discourage you and perhaps cause you to give up).
With respect to what IDE you can use to code, you can use Eclipse (my personal favorite), NetBeans, or, just a notepad. Oracle's Java Development Kit (JDK) is what provides the Java compiler that you actually need to build your code and get it to run. However, a solid IDE can ease the process as well as provide a large number of features to make your development much easier.
It does not matter where you develop. A major advantage of Java is that it is platform independent. You can code Java on a Mac and it will work on a PC and it will work on Linux, etc, etc. All you need is the proper JDK to build Java for that specific platform. So, don't worry about that and work on the machine that is best suited for your needs.
You may want to browse around StackOverflow for a bit and read up on some of the other beginner questions on Java. Other than that, I would highly going out and getting a good Java development book and reading the tutorials that are available online.
Hope that helps get you started. Good luck and welcome to StackOverflow!

Blackberry Development on Mac OS X
The new eclipse blackberry plugin for OS X does not have a simulator so if you want ot debug you will need to hook up an actual blackberry(or run the simulator from a windows vm).
Blackberry uses Java ME and some rim classes(net.rim namespace).
Documentation is here http://www.blackberry.com/developers/docs/6.0.0api/index.html
Note that just because a class with the same name as a regular(java SE) class is there does not mean it has all of the same functionality.
Also why do you want to develop for the blackberry specifically?

You can use Eclipse as an IDE, it would certainly do the job. I'm partial to Netbeans myself, and it would do the job too. XCode is Apple's own IDE, and from what I hear you can do Java development with it (it's been a while since I last used it). Finally, I hear from other sources that IntelliJ might be worth considering.
Particularly important to note is that all of these work fine on a Mac, so there's absolutely no need to move to a different platform (Windows, etc) unless you want to. I know from experience that both Eclipse and Netbeans both work on a PC, so you could consider those if you do decide to change to PC. XCode isn't released for PC on the other hand. I don't know about IntelliJ.
As for the Java API, all of these IDEs should install a copy of the Java Development Kit (JDK) when they are installed. This includes all of the API files, compilers, tools and documentation you should need to get started.

Related

Do you need Xcode to program iPhone apps?

I'm interested in making apps for the iphone. I was wondering if it were possible to make apps, WITHOUT Xcode. the only reason is because I'm dirt poor, and can't afford an Apple.
If it's games you're interested in developing, then another option might be to take a look at Unity (http://unity3d.com/). This would let you develop on the PC for free in a friendly environment for a beginner. If you then develop something that you decide you want to publish on iPhone, then at that point you could invest in a Mac and just rebuild the Unity app for iPhone on that.
Also, Unity lets you write scripts in both C# and Java so you wouldn't have to learn Obj-C.
The short answer is no. The long answer is "not exactly," but you can get started in some ways while you're working on getting access to a Mac you can do the work you'd like to do on.
"XCode" is more or less really two things:
(1) an IDE
(2) a toolchain with a C/ObjC/C++ compiler (really a version of gcc) and a big library of apps
You don't have to use #1 in order to build iPhone Apps, though it's genuinely helpful. You can get by with #2.
But without #2, you're going to have a hard time building an App you can sell in the App store.
So, it depends on what your goal is.
If it really is to build an app and get it out there, the easiest path is probably going to be to find some way to get access to a machine running OS (probably 10.5 and up) you can do development on. That might be talking a friend who has one into letting you spend some scheduled time on it, or it might be working and saving up for a used intel-based Mac mini (probably something you could get for $300), or it might be turning a PC you've got into a Hackintosh (or maybe setting up a Hackintosh VM on the PC if you're sharing it with others who might not want it transformed thusly :).
If your goal is to start learning how to do things while you work out how you're going to do the above, though, the good news is that it's not hard to get a hold of tools that will help you learn the technologies/languages involved in iPhone apps. Like I said earlier, Apple's compiler is really just a version of gcc. You can probably install gcc on your machine and write objective C programs with it. You could also look into GNUStep which could help you get familiar with a lot of the concepts and practices underlying how the Cocoa libraries work for the iPhone and OS X. And you could learn OpenGL ES, which would be great help if you ever end up working on an iPhone game.
Actually You can develop apps without a Mac. You can use a number of languages and tools that enable writing apps for iOS like:
- Python
- PhoneGap
- Appcelerator
- Mono
- Unity3D
- Unreal Engine
These all can export to iOS.
The only step that requires a Mac is publishing to the app store. But You can use any Mac for that, so You can publish from a friend's/neighbour's or actually anyone's Mac. That is the last step when You're sure everything is running perfectly. Perhaps Your application will earn You Your own Mac.
Also there are a number of publishing service providers in the internet (which don't cost nearly as much as a Mac). I don't remember any particular one at the moment, but I'm sure if You search You will find many. Good luck!
Unfortunately, although there are 'alternatives' (phonegap, mono touch, etc.) I believe you ultimately need Xcode and its tools to package/sign/publish your applications.
If you are really motivated though, you can look about ways of installing Mac OS X on a PC, though that is beyond the scope of this website.
In short, you need a mac. There a number of screwed up ways to do this without a mac, but for all intents and purposes you need a mac. A mac mini you can buy used for $300 on ebay will do the trick. You don't need a powerful machine.
Though Xcode itself is free it does require an Intel based Mac running Snow Leopard. You have 2 options:
Buy a refurbished Mac Pro or Mac mini from Apple website. They are not that expensive. You can use non-Apple peripherals with them to bring down the cost. And you will not be disappointed with quality.
Use Hackintosh to run the OS X on other Intel platform. Its hacky, difficult (carshes) and illegal.
Update:
For Objective C you can refer a pretty good documentation of Objective C language at iPhone developer portal. There are many other documents like memory management and human interface guidelines which should help you get started.
Once you have developed the familiarity with Objective C, you can then browse through various programming guides on iPhone development centre. If you want to follow a systematic approach, you may refer to "Beginning iPhone Development" book which I found pretty good.
Yes it's possible to develop applications for the mac/ipad/iphone without Xcode and without a mac/ipad/iphone.I own a imac,an ipad,and and a mac book pro.I tried to develop in xcode.
After some quick search on the internet I found this http://www.gnustep.org/. This is a framework you can use to develop in the objective C language,using GCC (the GNU compiler).There are other tools you can use,like GNU STEP Application project:this seems to be a sort of IDE (I didn't test it yet).
Yes and no. You can use alternative SDK's but they can be a pain to use and don't offer the publish/signing capabilities that Xcode does.

Dev efforts for different mobile platforms

I'm in the middle of development of a client-server "socializing" that is supposed to run on several mobile devices. The project is pretty complex, involving networking, exchanging media, using geolocation services, and nice user UI.
In terms of development efforts, technical risks and extensibility what is the best platform to start with? Taking into the account that the goal is go "live" as fast as possible with the mobile version. And second goal is to cover most users (but first is more important).
iPhone (iPod iPad)
Android
BlackBerry
Java ME,
Symbian
I realize that there are limitations on every platform, and there are different aspects to take into the account (for example iPhone has better developer's community then Android, J2ME runs in a terrible sandbox but covers most devices).
Please share your pros and cons. I have the experience only with J2ME, unfortunately I can't evaluate other platforms.
If you're looking at native applications on the platforms you list, then the development effort required in order from least to most is:
iPhone
Android
Blackberry
Java ME
Symbian
Development effort is largely governed by language/libraries, tooling and fragmentation. Hence iPhone wins (good language & libraries, excellent tooling, little/no fragmentation). Symbian comes last (C++ with limited libraries, poor tools, large fragmentation). Android beats Blackberry on libraries and fragmentation, and Blackberry beats Java ME on fragmentation.
The counterpoint to this is market size, especially among your target user base - Java ME reaches far more devices than any other platform, whereas the Android installed base is still the smallest of the 5.
There's no one right answer, but if reach is important then Java is a good place to start, if time-to-market and user experience are the keys then iPhone makes sense.
It's also worth looking at how easy/difficult it would be to port across to other platforms. There are various cross-platform libraries around such as Airplay or J2ME Polish that might reduce the costs - provided you can implement your application on the cross-platform part.
I'd like to speak up for Maemo/Meego(Nokia's/Intel's mobile Linux). While it is in a state of transition and currently Maemo 5 has only one good phone(and a couple of cheap Chinese ones), but I feel that it will soon be big(I like many people believe that Meego will be Nokia's high end strategy and Nokia is the biggest phone maker in the world). Plus the N900 is the coolest phone around.
Also their it basically an open Linux device (pretty similar to standard desktop Linux). The ide QT Creator is great and cross-platform(comes with embedded visual designer and nice documentation broser) but you don't have to use it, there is some support for using your own text editor or ide.
There is no sort of signing key nonsense(I did a student project for the blackberry and have been quite annoyed by keys). Other things I didn't like about the blackberry: windows only eclipse plugins, our team had a lot of trouble figuring out how to add third party libraries to blackberry COD archives . Also some of the Classes are somewhat sparse in a lot of ways especially String/Char, probably since its ME based, I also didn't like the file read/write apis, it felt somewhat awkward, possibly since blackberry apps only recently got the ability to store files(before you could only store/retrieve objects to disk via the persistence layer)..
The preferred Languages are (Gobject C currently but less so for Meego) , Qt flavoured C++ and python. There libraries are nice and the qt ones are especially well documented. Since its a tiny linux box you can have on device debugging (there is also an emulator).
Note I haven't developed anything for Maemo/Meego but I've read a lot about and just fell in love.
I think that the best solution might be to start with a smartphone optimized web site. A native app can provide a richer interface, but a well designed web app can come close and will run on any device.
Have a look at the WPTouch for an example of a very good phone optimized web site.
In line with Roman A. Taycher, I'd like to raise my voice for windows Mobile/Windows Phone. It's has a large installed base, it has the tried and true Visual Studio toolset to develop with, it has the best emulator of them all (it actually emulates the ARM instruction set - you hear that, Apple?), and you can leverage your Win32 experience.
MS-haters - please don't bother responding. I've heard them all.
A cross-platform runtime such as Qt or HTML5 are good bets and are portable.
Qt supports many platforms including Symbian, Meego, Linux, Windows etc. It is highly regarded as one of the best programming frameworks around currently.
Qt creator is also a very highly regarded IDE.
HTML can be accessed on nearly everything of course and can there are plethora of tools out there.
While applications natively developed for a given platform typically win in terms of platform UI consistency and performance, you could try going for one of the available multi-platform frameworks, such as Rhodes (just to name one). Personally, I do not have any specific experience with Rhodes and only learned about it a couple of days ago (having a closer look is still on my todo list), so please judge the user experience that the framework offers on different devices on your own.
It sounds like you need Mobile Community Framework (MCF). It is cross-platform framework to develop network-centric, location- and proximity-aware applications on all modern smartphone platforms (iPhone, Android, Blackberry, Symbian, WinMo - almost all you mentioned, except J2ME). It provide native binaries for all these platforms. With MCF development time can be reduced, as you don't need to code all this network stuff by yourself, but you can just use simple API to send any amounts of data across enrypted connections, via Wi-Fi ad-hoc mode or via special proxy-server.
More info at http://www.uvamobiltec.com.

Do i have to buy mac for iphone application development?

Is there any MacOS virtual machine that can run on PC?
Is there any source to get it?
What is the best way to develop apps for iphone?
Yes all the developer tools are OSX only.
There are lots of iPhone development books out there go check out amazon and find one with some good reviews and that will get you started.
You might not, in the strictest terms, have to get a Mac to develop for iPhone; but it will be extremely helpful. Apple is relatively talented at squashing efforts directed towards Hackintoshes and virtual machines running OS X.
The shortest answer that will give you the least hassle is: Yes you need a Mac.
But, as far as I know there are a few possibilites, that try to reimplement some Cocoa Frameworks (however they might be Mac OS X only and not iPhone): GNUStep is an example.
But I don't think you get something aquivalent to Xcode (the IDE for iPhone development) this way.
And I think there are some OSX86 Virtual Machines (however these seem to be against Apple's EULA and thus seem to be clearly illegal so I won't point you anywhere to get them).
So to conclude - if you want to develop for iPhone: getting a Mac is the easiest way, even though not cheap.
Hope this helps.
The short answer is - yes.
One possibility for learning some of what you need to know before getting a Mac is GNUstep.
However, GNUstep is mainly useful for learning Objective C, especially since it provides many of the classes that the Cocoa toolkit for iPhone does. This can be run on Windows.
It doesn't, however, support some of the key 2.0 language features that are used 'all the time' in any sample code.
What it will allow you to do is design a UI using their UI designer GORM, and use a near-identical message-based system for implementing a UI, and you could theoretically write Objective C classes in GNUstep and then use them on iPhone.
However, to compile an app for iPhone you basically need to have a Mac, because then you can get the key for signing an app, etc. Since you need to get a Mac at some point, there's really little point in going the much harder route of using GNUstep first and learning a more limited implementation, unless you really need to get started before funds are available.
Despite the new SDK terms that can other programming languages, if you're really wanting to start without a Mac, I'd probably be tempted to look at something like Unity, or perhaps even Appcelerator Titanium, and figuring out all the non-platform-specific logic first on whatever platform (Unity has a free version that can be run on Windows, for example).
I'm not that big a fan of xcode, but is is far and a way the best IDE for Objective C development simply because there's almost nothing else out there.
There are, as always, other options. If you do a web app type project, you can implement the website and test a lot of it in a browser. Furthermore, since Android and iPhone browsers are both WebKit based, you can use the free Android SDK to see what pages look like on a comparable mobile device. And since you can use C and C++ classes as well as Objective C (N.B. not for the GUI, since that needs the Objective C extensions for messaging between objects), another option for making a start without a Mac would be to use Eclipse, QT Creator or some other C/C++ IDE to implement non-GUI classes, so long as you make sure you don't use platform-specific libraries.
But the end of the long answer is still that whatever you do, to compile a proper iPhone app you'll be using xcode and associated tools to finally build it and sign it, and so you need a Mac in the end. If you want to create something targetting the iPhone and won't have access to a Mac, then perhaps you're best off looking at creating an iPhone-adapted website using iui or a similar toolkit to give the site a suitable look and feel.

Apple/iPhone Development IDE Preferences?

I'm going to do something I never thought I'd do... learn how to program for Apple hardware . After working in C, C++, C#, .NET, and even in the golden days of DOS (a little DOS4G/W memory extender in Borland Turbo-C, anyone?) and even as a kid, playing around with Atari 8-Bit Turbo-BASIC, I feel a little traitorous on multiple levels :) Anyway, I'm going to grad school, studying music full-time - it'll be the first time in years I won't have a full-time programming gig - and I thought it would be fun to pick-up some Objective-C in my free-time - and maybe a little extra pocket change (one can always hope :)
So, to the point of the post. I'm very used to Visual Studio, the designer, the XAML editor, the code-behind, blah blah blah. A friend pulled up X-Code on his little MacBook to show off how cool it's supposed to be. Sure, it has the same sorts of things as VS overall, but it seemed a little more scattered then I'd like. I'm sure once I got used to it, it would be fine, but I was just wondering if there are other good, free (or almost free)/or open-source editors out there for the Intel-based Apples that could also handle iPhone development. Or any tips on getting into xCode? I've just decided to do this, so I feel like I'm starting from scratch. I'm not slamming X-Code... I haven't really used it yet. I was just wondering what coders' preferences are.
Thanks for any advice!
There really is no alternative IDE on OS X for writing native applications. Some dislike the Xcode built-in editor, however. One very popular alternative is TextMate (non-free, but well worth the ~$50). Xcode can be configured to use your editor of choice for editing text files. Free alternatives include Emacs and Vim ports for OS X.
You can, of course, use the gcc toolchain without Xcode (e.g. using one of the Unix-style build systems such as Make). You can also use xcodebuild at the terminal command line to build an Xcode project without using the Xcode GUI at all (you'd be hard-pressed to configure and manage the project without the GUI, however). Combining these two, one could cobble together an IDE from e.g Eclipse to build an OS X app. iPhone would be harder since Xcode handles certificate signing etc. for you, but still possible. You would loose all of the nice Objective-C completion and documentation integration you get from Xcode, of course.
So, in summary, Xcode is pretty much the only game in town. It will undoubtedly take a while to get used to coming from VS. In particular, code generation is almost unheard of in the Cocoa world. When you feel yourself searching for those kind of tools, train yourself to try a different approach. Objective-C's late-binding combined with the power of NIB/XIB (bundles produced in Interface Builder that describe the UI of an app; XIB is a newer, version-control-friendly XML-based format that is automatically compiled into a NIB, the old-style format from NextStep days) makes code generation unnecessary.
For non-Cocoa/iPhone development, the ecosystem is naturally larger. Nokia has their own IDE for the Qt toolkit which can be used to write OS X (but not iPhone) apps. Eclipse can be used to write Java apps using any of the Java toolkits (including SWT and the Qt-Java framework, QtJambi).
For pure Windows-developer familiarity, there's also Mono which runs on OS X. MonoDevelop may run on OS X, but I'm not sure.
I think XCode is the most popular choice amongst Cocoa developers. I think the best thing you could do is go straight into writing apps and exploring.
http://cocoadevcentral.com/ - Has some great tutorials, they're also usually very screenshot friendly.
For pure ease XCode will be the way to go since it integrates with the iPhone simulator and Interface Builder. Also, when you want to deploy your app to an actual device XCode does the certificate installation and management. I don't have experience with any other IDE's for OSX though so I can't 100% answer your question. But, these are things you'll want to be aware of during your investigation.
Let us know what you find!

How do you setup Eclipse to work on iPhone development (instead of Xcode)?

Although I've been getting more and more familiar with Xcode while developing for the iPhone, there are times I just wished I had a better IDE, something like Eclipse.
So I was wondering does anyone know how to migrate iPhone projects to Eclipse, and if it's worth it?
XCode largely uses standard Unix tools for a lot of its work. iPhone applications are compiled using GCC 4.0, it uses gdb for debugging, so it should be possible to set up Eclipse to at least compile applications.
If you look in the Build section of the Project Info pane (select the project, hit the Info button in XCode, choose the Build tab from the top) you can see many of the options.
I'm not sure what is required to copy a file to the simulator and attach a debugger to do a test run, it might not be worthwhile to jump through all the hoops and Apple may require an XCode generated build to accept an app into the App Store.
It may be the case that for regular code editing you can work reasonably well in Eclipse, then switch to XCode for interactive debugging.
Most of the existing Eclipse plugins seem to be oriented towards developer iPhone-aware web applications, so I'm not sure if you'll get any help there.
As far as I know you cant use Eclipse or any other IDE to develop for iPhone.
Apple only supports XCode and this wont change in the future. So I think you have to get used to XCode.
Late in the game, but you might want to kick the tires with JetBrains's AppCode, eventually a full feature drop-in replacement for xCode ... and very similar to IntelliJ (GUI, work flows, etc...). Still Early Adopter as of now, it performs some tasks rather well. I still use xCode for configuring the build options and targeting the device, but that will eventually be taken care of.
regards
There's cross compiling that give you ability to develop IPhone apps on eclipse
http://www.youtube.com/watch?v=TG-NIt2O5J8
There are no plugins that support Apple IOS application development in Eclipse but on windows, you can develop using Adobe CS5. This is one of the powerful tool from Adobe in which you can develop .ipa applications on windows but you need some stuff to be ready before you start developing IOS applications using Adobe CS5