Hacker News new | ask | show | jobs
Android development in Visual Studio. Am I crazy? (vsadt.com)
16 points by jere_jones 5697 days ago
10 comments

At least on the Eclipse front, one thing that may not be obvious is that it comes by default with some very low and inadequate memory settings. This can lead to abysmal performance with the Android SDK.

The fix is easy: up your memory settings in eclipse.ini

http://wiki.eclipse.org/Eclipse.ini

Specifically, I'd look at these minimum/maximum heap size settings:

  -Xms40m
  -Xmx256m
Mine has:

  -Xms128m
  -Xmx1024m
There's a tip that should be more public! I will try that.
I don't know anything about Visual Studio, but I do know it's quite possible to do Android development in any text editor, although it's certainly easier in an editor that understands Java. You don't need any special IDE support, or even an IDE at all. All the project creation, building, etc. can be done quite easily from the command line.

I built my first Android app using Emacs (and the command line), because I already was somewhat familiar with Emacs and was completely unfamiliar with Eclipse. Then I switched to Eclipse, mostly to get familiar with and see what all the fuss is. Like you, I'm not a fan. I'm currently trying out Intellij, which so far seems pretty nice. I'd really recommend trying it.

IMHO, I think the hardest part of your project will be trying to get Visual Studio to support Java.

You're absolutely right. Getting VS to edit Java files and build the apks wasn't too difficult. What will make it awesome is getting intellisense working. I will have to write a language service for that.
I don't think MSFT will want to encourage mobile app devs to write apps for any platform but WP7, and I also think that there is a market for this product. I personally would buy it. So you will not likely face competition from the biggest party who could summarily put you out of business, but there will probably be other small teams that think of this.

You just need to work better, not necessarily faster, than them.

My brother's approach is tangential to this. He uses Visual Studio to write his code and to lay out his forms (using his VS language of choice) and then crunches the result through a program that outputs the Java code. Again a work in progress but it has already been put to practical use.
Eclipse+ADT have saved my day in combination with Eclipse Memory Analyzer Tool. I'm sure there are other Java power tools that would be missed if you gave up on Eclipse, too.

Having said that, and bearing in mind the utility of stuff like the File Browser and debugger, I never liked working in Eclipse. I use eclim and send it commands from vim, and that's all the IDE I usually need. I also avoid using ADT for commands that can be better used through adb and shell script - e.g. logcat is much more useful when I can tee it to a local file and analyze it in a real text editor than it is in ADT's view.

Crazy? maybe just a bit, but the idea is great. VS is one of the best IDEs out there. I would certainly give it a go. Two questions: will it have intelisense and a debugger?

Good luck!

Oh yes! Those are the two biggest reasons that I love VS.
My principal goal for submitting this is to get your opinion on the project. It will be a lot of work. Much more work than just adjusting to Eclipse. So, am I crazy? Is there a market for this? Would you use it?

I know about and have used MonoDroid (I'm a part of their beta and it is awesome), but I'd like something that doesn't require an extra runtime on the phone.

Thanks for your input!

Just a little bit of my backstory so that you read this through the correct lens: I was a .Net dev and used Visual Studio for years, then my company sold me as a Java dev and I was forced to use Eclipse for just over a year.

I liked Visual Studio, I was really comfortable in it, I understood it's quirks and it had a reasonably nice workflow. I didn't like Eclipse, it was weird and different and I couldn't work as productively in it. But I was _forced_ to use it for a year, I learned that Eclipse prizes the "type-to-navigate" feature, and I learned to love this.

So this next part comes from someone who has felt the Eclipse pain and genuinely enjoys both IDEs (and for the record spends all of his time now in TextMate and Terminal).

I think your idea has a bad cost / benefit ratio. Android moves quickly, the developer community and mindshare is set up in Eclipse and the tools produced within by Google and other Third Parties. I think there is probably an audience for a Visual Studio plug-in, but make no mistake, Eclispe and VS offer a similar amount of functionality, the tools that you find cumbersome on Eclipse were written by people that work in Android all day everyday. You are setting yourself up to try to make a toolset that offers feature parity with the official toolchain. You will also need to offer up tutorials and documentation so that people will use it.

I'm not saying that you shouldn't do this, I'm just saying that you should be realistic with the upfront cost of doing this and the ongoing cost, especially considering the amazing rate of progress Google is throwing at Android. I think in the long run it would probably be a lot easier to work in Eclipse, but that's from someone that's already gotten through the pain of transitioning to Eclipse.

It seems to me like the problems you're having, like intellisense not working correctly and the debugger being broken, are problems with the SDK tools and not with Eclipse itself. Writing your own tools I fear you will run in to many of the same problems. While I feel that you're right in saying developing Windows C++ apps under VS is a superior experience as compared to developing Linux C++ apps under Eclipse, Visual Studio cross-target development kits I've used in the past tended to be sub-par compared to either. Many degenerate in to rather dumb text editors with project management. From a technical standpoint, integrating with intellisense and the graphical debugger is much more difficult under Visual Studio. Either way, good luck and keep us posted!
I would use it, but probably not pay a TON, as my interest in Android development is as a hobbiest not a professional.

I'd definitely pay $99, probably pay $199, but definitely wouldn't pay $499.

By the way, you might get a better sample posting this same question at http://programmers.stackexchange.com -- it's a more Microsoft-centric crowd than Hacker News.

Thank you for putting an actual price in your comment! Expensive is relative and knowing someone else's point of view is very helpful.
Yes! When Android first came out I submitted an app to Google's app competition. I hated the experience in Eclipse so much that I never went back. Visual Studio support would be fantastic.
Have you looked at using IntelliJ instead of Eclipse? I've not used it, but it might be more of what you're looking for.
I have looked at it, but I haven't given it the amount of time that I have given Eclipse. I just ran into too many bugs that revolved around its interaction with the emulator.
Hmm.. Intellij's been working fine with the Android emulator for me. What kind of problems are you running into?

That was actually one of the main things that caused me to look for alternatives to Eclipse, is that I kept running into weird bugs where Eclipse would refuse to re-build my project. :-(

I know this sidesteps the entire point of getting Java and such up and running, but can't you just use VS to write standard C++ and then use the NDK? (sorry, your site is blocked at work, I'm just guessing here)
The NDK is really only good for writing back end stuff. You can't do any UI with it.
There's a plugin for NetBeans that works wonders, here http://wiki.netbeans.org/IntroAndroidDevNetBeans all the instructions to install it.

If you, like me, come from VS, NetBeans is an excellent substitute for it.