views:

838

answers:

3

I'm trying to start doing Android development on OS X (trying is the key here). I've read all the fun stuff at http://developer.android.com/sdk/index.html. I get the basics, install the JDK, Eclipse, the Android SDK, the Eclipse plugin and ADT. That's a lot to do but I get the point of each step, so, OK, fine. Then there are a million (OK, a few less than that) little things like adding the location of the SDK to your path. Which ostensibly means editing the .profile file that you can't see in OS X unless you use terminal (or some other method of dealing with hidden files). Ostensible because, for me, that file isn't in the normal place for some reason. Since I don't know where it is, for now I can't run anything from the Android SDK without manually going to the tools directory (and maybe this is the answer to the question that I'm getting to...).

Regardless, once all that is done the SDK location needs to be chosen from within Eclipse after the Android plugin installer went out and did a whole lot of stuff. Stuff that doesn't include installing or locating the SDK. But, OK, done. However, doing so was also supposed to add at least one Target, but it hasn't. Normally that just means quick search on Google, but apparently none of the documentation on the Internet knows about this case...other than to point me to the Android plugin source code that presents the error (in case you're curious: http://www.netmite.com/android/mydroid/cupcake/development/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/SdkTargetSelector.java).

There just seem to be so many manual steps for what I would think are standard operations; i.e. install SDK and use it. Then, if something goes wrong there's just a bunch "in" knowledge *nix developers just need to know. I'm all for knowing the system you're developing on but I'm not a sysadmin. I just want to write code. Why can't there just be an installer that puts things where they need to go so I can get on with some actual development?

But, I suppose my real question is: if you've followed all the directions on Google's Android developer site for installing all the various bits and there are no Targets, why aren't they there and how is that corrected?

Thanks.

+1  A: 

Well, I don't know about your other issues, but if you didn't have a .profile file you could always create one in your home directory. I don't know if OS X has one by default that you should use though. For me it wasn't too difficult to set up the Android SDK, but I already use eclipse so maybe that's why.

Are you using the 2.0 SDK? Under the Window menu in eclipse, open up the Android SDK and AVD Manager and under available packages see if there's anything you can install. It sounds like you're missing one of those.

Ibrahim
+4  A: 

If you do not have a .profile in your home directory, you can simply create it in your home directory - it is just a text file. One of the issues with owning and using a UNIX system is that you are going to have to understand how it works if you are going to develop code for it or use it as a development environment. This is no different than Windows or any other OS.

Take a few moments and read a little about the environment and you will thank yourself in the future. As for "an installer that puts things where ...", that is something that I would take up with your local Google representative. I've worked with plenty of Java-based packages that do this just fine on my MacBook.

D.Shawley
+1  A: 

First, the .profile file: if it doesn't exist just create it (as others have said) and add whatever you need to it. This should be in you home directory (e.g., /home/YourName/.profile).

As far as having no targets: after you install the SDK you need to have it install whichever platforms you want. From the docs:

The Android SDK starter package includes only a single component: the latest version of the SDK Tools. Included in that component is a tool called Android SDK and AVD Manager that you can use to download other components from the SDK repository site. The tool provides a graphical UI that lets you browse the repository, select new or updated components for download, and then install them in your SDK.

I actually recommend you read that whole page. This whole process is fairly simple/painless if you take the time to read and understand the instructions (and the documentation is fantastic).

fiXedd
While I appreciate your answer, I had actually read the whole page. What I had tried was to create a Virtual Device, which also requires a Target and so didn't work. What I missed is that there are additional components that need to be downloaded. But that's actually part of my original point, why wouldn't the latest package contain everything I need to write for the latest revision and latest platform? That would be a logical assumption on Google's part...it is, after all, called a Starter Package.
Ryan
They used to package all the "targets" in the SDK, but at ~ 100MB each the SDK was getting big. Now they just let you choose the specific ones you care about. Since we'll soon have devices running 1.5, 1.6, and 2.0 in the wild it doesn't seem unreasonable to do it this way to me. How is Google supposed to know which you want to develop for?
fiXedd
I'm not suggesting they need to include all of them. As I said in my previous comment, if it's a starter package then it would make sense to send out at least the newest target. Then, if someone has a specific need beyond that the additional components can be added (using the same system they have in place now). Granted (obviously) this isn't essential, but for those that are new to an environment making the process of getting started a little easier certainly isn't a bad thing.
Ryan
Well, you could also argue that they shouldn't include the newest target since it currently isn't available on any phones yet and that would also be pretty confusing. If the theory is that you should package what most people want then they'd need to package 1.5 since most people will want wide compatibility and that's the only way to achieve it.
fiXedd