Android Ported To C# 351
New submitter Eirenarch writes "Xamarin has just announced that they got the Java part of Android ported to C# via machine translation. The resulting OS, called XobotOS, is available on Github. They claim some serious performance gains over Dalvik. For them, this is an experiment that they are not planning to focus on, but they will be using some of the technologies in Mono for Android."
Software Apocolypse... (Score:5, Funny)
....this still won't save you from the Oracle software apocalypse [slashdot.org].
Re:Software Apocolypse... (Score:5, Funny)
Re: (Score:3)
But how will economists make accurate predictions without the source?
Can I run Android or iOS on my PC? (Score:2)
I'd like to try them sometime.
Re:Can I run Android or iOS on my PC? (Score:5, Informative)
Android was ported to x86 a few versions ago.
Re: (Score:2, Informative)
Yes, you can:
http://www.android-x86.org/
http://forum.xda-developers.com/showthread.php?t=1373161
Heck, even Eclipse has an emulator that could do the trick for you.
Re:Can I run Android or iOS on my PC? (Score:5, Informative)
Download the Android SDK [android.com] which contains an Android emulator.
If you have any virtualization software installed, grab an Android x86 ISO image [android-x86.org] and run it in a VM.
The second method gets you higher performance (virtualization vs binary translation), but has major compatibility issues. Any app that contains ARM native code won't work in Android x86 unfortunately.
Re: (Score:2, Interesting)
At the moment, yes. That might change, though.
There's now at least one phone available (in India, anyway) which runs an x86 (Intel Medfield) version of Android:
http://arstechnica.com/gadgets/news/2012/04/the-first-intel-smartphone-comfortably-mid-range-eminently-credible.ars
It can run most apps that contain ARM native code, by using a JIT. I don't know if the source code for that is available anywhere, but it'd be useful for running Android on x86. It's also not that hard to port an Android on ARM app over
Java to C# is easy (Score:2)
Well, relatively easy, since at a bytecode level Java is a subset of CLR.
Now just try going from C# to Java.
Re: (Score:2)
I think you need to explain your "Windows underneath Linux" remark. There is no Windows underneath Linux, and never was. And our wheel is less reinvented then Microsoft's...
Trolling tips (Score:2)
Look, if you're going to troll that's fine. But at least make your trolling remarks internally consistent; first you complain that Mono requires Windows to run, then you claim it's unnecessary to create a fully FOSS CLR runtime.
Well, Windows is obviously not FOSS, so your two claims are mutually exclusive.
Or to put it another way: lern2trol.
Managed code to become irrelevant? (Score:2)
Re: (Score:2)
If they did that, then Google should pick a very nice language and build a compiler for their platform.
Re: (Score:2)
And in this market, you really think Google could actually afford to do that? To have the next android update remove Davlik and break every non native app? To fragment their app market into "old devices" and "new devices"? Not to mention reducing their developer pool to people who can actually write native Linux binaries.
If it was as easy as "sadly setting aside" they'd have done it by now and saved themselves the cost of a lawsuit.
Unimpressed (Score:3)
It seems like they are "translating" the Java code to C#, then compiling it with Mono. I had expected support for running Android bytecode, or something like that...
Performance improvements indeed (Score:2, Interesting)
The chart from TFA:
http://tirania.org/s/71de890b.png [tirania.org]
Whoa. Those benchmarks show Java/JVM about 7 times slower than C#/DLR. (I thought "DLR" in TFA was a typo, but it's correct. DLR stands for Dynamic Language Runtime [wikipedia.org].)
I'm not entirely surprised. I remember reading the history of IronPython [voidspace.org.uk], where Jim Hugunin (the original author of Jython, which is Python running on the JVM) did some experiments with the CLR, intending to prove how sucky and lousy the CLR was; instead, he found that the CLR was faster t
Re:Performance improvements indeed (Score:5, Informative)
That's Dalvik, NOT the JVM.
Re:Performance improvements indeed (Score:5, Informative)
That's Dalvik, NOT the JVM.
Whoops, you are correct. Sorry about that.
I wish I could go back and edit the post. Oh well.
steveha
Re:Android (Score:5, Informative)
1. The Microsoft patent grant for C# is more permissive than the patent grant for Java.
2. Oracle is suing Google over Java right now..
Re:Android (Score:4, Interesting)
1. The Microsoft patent grant for C# is more permissive than the patent grant for Java.
Aaa.... No it's not. There is a defensive termination clause(I will be corrected if I'm wrong...) in Microsoft's grant, but not in Oracle's.
Re:Android (Score:4, Informative)
Aaa.... No it's not. There is a defensive termination clause(I will be corrected if I'm wrong...) in Microsoft's grant, but not in Oracle's.
There is a termination clause:
I.e. you can sue Microsoft for infringement of your own patents by SQL Server or Windows, but if you sue claiming that one of the specifications/implementations covered under the open specification promise infringes your patents, Microsoft reserved their right to countersue you for infringement of the same specifications.
This is a standard defensive mechanism. Sun/Oracle has one as well:
If you were to rely on these specifications for a product you are building, it actually benefits you that there is a defensive mechanism in there to deter against crippling lawsuits.
So, not much difference. Standard defensive mechanism in the common interest of the users of the products.
Re:Android (Score:4, Interesting)
1. The Microsoft patent grant for C# is more permissive than the patent grant for Java.
Are you a lawyer? I've been reading the promise Microsoft made, and it's all gibberish to me. And I doubt that even the original lawyer who drafted it would actually understand what he had written.
Re: (Score:3)
2. Oracle is suing Google over Java right now..
I am following the Oracle suite very much, because I'm myself a Java developer (and I searched long [Python, C#, C, C++, Php, Ruby] but I can't find any other language that suites my needs better). So this statement is just wrong, because Oracle is not suing over Java, but the use of the Java API and the structure, sequence and organization (SSO).
For me, the whole suite is just a stupid attempt by Oracle to get a piece of the mobile pie from Google and such a suite can only happening in the USA with it's mo
Re: (Score:2)
Well, the thing is, this is actually happening with Oracle right now. It has not happened with C#.
So why is it that C# is the "trap" here, but not Java?
Re:Android (Score:5, Informative)
The (irrevocable, legally binding) promise Microsoft made was not just related to C#, but the .NET framework. So long as it's implemented properly (eg. all elements Microsoft deems "required" for the implementation is implemented), Microsoft will not peruse any legal action on anyone using the technology. That includes the API. The reason Microsoft did this was so people would not be afraid to use it. They want people to use it.
The two situations are not comparable at all. Microsoft would not sue over someone implementing the API.
Re: (Score:2)
Re:Android (Score:4, Informative)
IANAL but unless they did a clean room conversion to C#, then Oracle's patent, if valid, would still apply. In otherwords, if Android is found to infringe on Oracle's IP and they programmers examined the infringing code and converted it to C#, the the C# implimentation still infringes.
Re:Android (Score:4, Insightful)
Microsoft is a bigger, more evil giant than even Oracle.
I'm not entirely sure you've ever dealt with Oracle...
Re:Android (Score:5, Funny)
Microsoft is a bigger, more evil giant than even Oracle.
I'm not entirely sure you've ever dealt with Oracle...
Oracle vs Google is like "do no good" vs "do no evil".
Re: (Score:3)
Microsoft is a bigger, more evil giant than even Oracle.
I'm not entirely sure you've ever dealt with Oracle...
Oracle vs Google is like "do no good" vs "do no evil".
More like "do evil with pride" vs "do evil and hide".
Re: (Score:2, Insightful)
Both are "Do No Good". Theres a Google rap sheet a mile long stemming from the last 4 years.
"Do No Good"? Isn't there anything they might have done recently that might earn them a little karma? Like say, pulling out of China when every other corporation is busy sucking Comrade Dick for the mere hint of market access.
It's costing them, too. For instance, the PRC government has been threatening to disrupt the Motorola merger -- since Motorola has a major presence in China (including a lot of development and manufacturing), they could seriously work Google over using their regulatory agencies.
Re:Android (Score:5, Insightful)
Bigger? Perhaps. More evil? Not a chance in hell.
Re:Android (Score:5, Insightful)
Re:Android (Score:5, Interesting)
So the fact that Oracle has sued someone over their language while Microsoft hasn't doesn't matter, it's still Microsoft that is more evil.
I mean, what exactly does matter, then?
Re: (Score:3, Funny)
Re:Android (Score:5, Funny)
Re:Android (Score:5, Interesting)
I can already tell you how that will turn out: Microsoft won't be suing anyone.
C# and the core runtime are ECMA standards with strong patent promises, meaning Microsoft explicitly gives everyone in the world the right to implement their own C# compiler and version of the System.* libraries.
Their open-ness with regard to the CLR and C# is far and away better than Sun did with Java. They even contributed DLR code to mono itself.
Not to mention how much better the language is... With real co/contra variant generics (type erasure? GTFU), first-class functions with delegates, closures, lambda expressions, and LINQ. Plus the new async/await stuff. On and type inference just makes things easier on a day to day coding basis.
Meanwhile Java has spent the last 10 years standing still. They couldn't even get closures into the latest release and from my understanding of the docs they aren't going to do true first-class closures anyway. It's a freakin joke of a language at this point.
Re: (Score:2, Redundant)
Re: (Score:2)
I don't know about you, but at this point, I consider a general-purpose language without closures to be a joke. In my experience, they are very useful and I would find it hard to work on a large project without them.
Even C++ has closures now.
Re:Android (Score:4, Interesting)
What are closures main advantage over anonymous class referring to final identifiers ?
Verbosity ?
Re: (Score:2)
I must admit that I don't use Java, so I wasn't aware that you can refer to final local variables from anonymous classes.
But yeah, verbosity is a big deal. If LINQ used anonymous classes instead of lambdas, it would be almost unusable (and unreadable). A lambda that can be written in about a dozen characters in C# requires five lines when written as a Java anonymous class.
C# 2.0 had anonymous methods, which were already less verbose than anonymous classes. Then C# 3.0 introduced lambdas, with the main diffe
Re: (Score:2)
I am biased by my years of enterprise java so while I sometime do read lines and lines of lines consisting of }, the representation given by my IDE is quite ordered,
Also I do not type that stuff in, I know my IDE well. To achieve a fake lambda (copy the variable to a final identifier in a new scope in an anonymous class) I need about 15 key stroke and no mouse interaction. While I would love the have the lambda expression, I don't feel bad about resorting to lines of generated }.
Re: (Score:3)
But it's not just about writing. Reading is at least as important. And you need to read thought a lot of noise to get to the signal if you're using an anonymous class.
Re: (Score:2)
C# closures can capture mutable variables as well.
But yes, this isn't actually a big deal. Verbosity is, though. You can write code in map/filter/fold style in Java, but it'll be insanely verbose with anon inner classes - whereas C# lambdas are as compact as those in, say, Scala or Ruby (thanks to type inference).
Re: (Score:3)
Re:Android (Score:4, Insightful)
Java has something C# lacks: a good IDE. ... ? Monodevelop? Yeah right. Visual Studio. LOL!
Java has eclipse.
C# has
Re:Android (Score:4, Informative)
Wow, where did you get that opinion from? Using a beta version of VS2005? VS2001?. The team I'm in right now is coding Java for Android in NetBeans because Eclipse sucked hard. But coding in C# in Visual Studio 2008/2010 is way better, way more productive. Hell even coding Javascript / HTML in VS2010 is better than this.
Re: (Score:2)
The team I'm in right now is coding Java for Android in NetBeans because Eclipse sucked hard.
A couple of years ago I tried out Eclipse on Ubuntu and I thought it sucked horribly.
Recently I started doing some Android development , and based on the tutorials and references and such I started using Eclipse again. I was pleased to find that the current Eclipse, "Indigo", is much better than what I tried out in the past.
So now I'm wondering what version of Eclipse you were using before. I'm also wondering if I
Re:Android (Score:4, Interesting)
P.S. get Resharper and NUnit.
Re:Android (Score:4, Interesting)
their developer tools have always been first class
This is what I have noticed about Visual Studio users, and I will preface the list with this; it may be that someone just doesn't know how to use the tool, but with C#, VB.NET, C++.NET, etc... Microsoft has very clearly made the .NET platform to be developed using their tools, so knowing how to use the tool (Visual Studio) is a key requirement to knowing how to program anything for .NET (which has a lot of cons in my opinion but that's getting off topic.) [PS: In case you need an example of how absolutely dependent .NET and Visual Studio are to each other look no further than the Entity Framework]
.NET APIs is usually rampant with Visual Studio people.
.NET, Java, RPG, C++, etc... However, the people who use Visual Studio tend to have (for lack of a better term) an addiction to the "Visual" part of VS. Now there are a couple of people I've met that have written some quality code using VS, but I'd hate myself trying to convince myself that I wasn't seeing a pattern here.
1. Visual studio users tend to be autocomplete hunters. I agree autocomplete is a handy tool, but lack of knowledge of the
2. Auto-generated boiler plates *usually* makes it to production and *usually* remains until version three or four. Again, it's handy that a lot of work is done for you, in this fast pace world we live in, it can be a life saver. However, sometimes it's time to retire the boiler plate code for something that is a better fit for your solution. Visual Studio coders tend to not even realize that this is going on behind the GUI.
3. Kill diff and commit new. I can't put my finger on it, but Visual Studio coders then to forego working on already committed branches and just start fresh every time or at least every other time. For the life of me, I simply don't understand why they don't tend to follow the "dozen little gears" approach... (which leads me into)
4. If Visual Studio didn't break up the functionality, VS coders tend to cobble everything into a handful of classes. Coders tend to have a single class that handles every, single, stinking, GUI event and possible combination thereof. Really?! Why?!
5. Visual Studio coders don't seem to build components, if they do, the component isn't very focused on task. Usually the library is something along the lines of "AllTheUsefulFunctionsThatWeKeepTypingOverAndOverForOurCompany.dll" As opposed to say, "FunctionsForASingleCustomer.dll" This makes rebuilding libraries, for me, a pain in the ass because every department has to approve the changes. I have no idea why Visual Studio coders feel that everything plus a chicken is a great idea for everything and the chicken?!
6. Exceptions! Catch them please! No one is immune to this, granted. However the forgot to catch an exception for Visual Studio coders is quite higher than say the guys that write C++ or Java and use Eclipse.
I've worked at several places coding on everything from
I like Visual Studio but the most frustrating thing is it always seems to get in my way, it always wants to think for me (usually doing a pretty bad job at it), and it really does so many things behind the scene that it tends to breed a "ignorance is bliss" attitude that carries over into actual user written code.
Now before you pick up the rock and bash my head in!! I totally understand that VS is just the tool. I get that and trust me, some of the coders that I'm talking about are some of my best drinking buddies, so I really don't want to think badly of them. But I just keep seeing this wherever I go when it comes to Visual Studio coders, not just my buddies, but others too. I can't help but feel that, "if the soldiers keep dying, it may not be the soldiers' fault." Like wise, if the code keeps coming from VS, in an ugly state, it may not be the coders' fault.
Okay I'm ready to hear reasons as to why I'm just crazy and dreaming all this up.
Re: (Score:3)
1. Agreed
2 - not sure it is that big an issue, but I don't believe you're wrong.
3 - not sure what you're saying here, this is about teaching people to use the code management tools available to them, not the IDE.
4 - are you contradicting yourself - you say VS coders break things up and Coders don't?
5 - isn't just VS coders.
I'd specifically like to call out statement 6 though:
Exceptions! Catch them please! No one is immune to this, granted. However the forgot to catch an exception for Visual Studio coders is quite higher than say the guys that write C++ or Java and use Eclipse.
I think you're conflating two different approaches here. On the class library side of things, I'm strongly against catching all except
Re: (Score:3)
This is similar to how Javascript in the late 90s was used by so many laymen (who wanted to call themselves web developers) to write the mo
Re: (Score:2)
Maybe the language (C#) is better (with is a personal opinion anyway, for example I don't like C# with the class/struct distinction, the unsafe delegates, the clumsy syntax for properties, the two collection frameworks [one with generics, one without] and many more issues)
But where it counts, Java is clearly the better choice, it's not for nothing the #1 used language now.
Where it counts is the Open Source Community, the build tools (is there any equivalent of maven for C#?), the libraries, the IDEs. There
Re: (Score:3)
I don't like C# with the class/struct distinction
You must then positively hate the primitive/class distinction in Java, since it's exact same thing, except that you can't add your own primitives.
the unsafe delegates
What's unsafe about delegates? They're exactly equivalent to a single-method interface implemented by an anonymous inner class wrapping a method call - except that they're several times more efficient (because they're represented as a simple pair of object pointer + method pointer internally).
the clumsy syntax for properties
Not sure what's clumsy about it, especially since you can have it auto-d
Re: (Score:2)
You don't play an instrument? I thought it was quite a clever name...
Re: (Score:2, Funny)
Re: (Score:2)
Microsoft grossly overestimated the cardinality of the intersection between the set of programming nerds and the set of music nerds.
I think you might be underestimating it. It turns out that the creative minds that enjoy programming also enjoy other creative things. I almost went to music school, actually. I wouldn't consider myself a "music nerd" even though I play guitar occasionally, but I certainly know what a C sharp is.
Re: (Score:3)
Generally, for those who don't get it: don't explain.
Re: (Score:2)
Re: (Score:2)
They should have renamed ado.net as Db.net.
Really, this is all much ado about nothing.
Re: (Score:3)
"(for those who don't get it: in music, generally speaking, the sharps and flats overlap. C sharp = D flat)"
Unless you're a music theorist.
Re: (Score:2)
There's an enormous intersection. In fact, I'd be very suspicious of someone that claimed to be a programmer but wasn't musical or otherwise creative.
I'm a programmer and I'm writing a sci-fi novel. Does that count?
Re: (Score:3)
At least that way, you're never in doubt about the goal of its creators.
Re: (Score:2)
Philistine! Everyone knows the proper pronunciation is C-Octothorpe!
Re: (Score:2)
As every telecom expert knows...
C Pound.
Re: (Score:2)
Re: (Score:3)
Re: (Score:2)
C Number
Re: (Score:2)
C£ ?
Re:c# what a lousy name (Score:5, Funny)
Hash? I though it was a bunch of pluses squished together to save space. You're saying C# isn't C++++?
Wow, my mind's blown. Cue Lemmings' self-destruct animation: Grabs head and explodes!
Re: (Score:2)
Re: (Score:2, Informative)
Microsoft clearly says it's pronounced C Sharp.
http://msdn.microsoft.com/en-us/library/kx37x362.aspx [microsoft.com]
C# (pronounced "C sharp") is a programming language that is designed for building a variety of applications that run on the .NET Framework. C# is simple, powerful, type-safe, and object-oriented. The many innovations in C# enable rapid application development while retaining the expressiveness and elegance of C-style languages.
-wmbetts
Re: (Score:3)
Why (honestly curious)?
Re: (Score:2)
In my part of the woods, the Microsoft language is simply known as C hash.
Why (honestly curious)?
Because you have to get seriously baked to think it is a good idea to use it?
Re: (Score:2)
In my part of the woods, the Microsoft language is simply known as C hash.
If you are going to be deliberately ignorant, why not call it C octothorpe?
Re: (Score:2, Funny)
Looked like C tic tac toe to me.
Re: (Score:2)
Your part of the woods is wrong then:
http://msdn.microsoft.com/en-us/library/microsoft.csharp.aspx [microsoft.com]
Official microsoft namespaces for the underlying compiler are "microsoft.csharp".
You can pronounce c++ as "see tee tee" but you look like an idiot doing so.
Re: (Score:2)
Re: (Score:2)
It was originally called "Cool" internally, which was an acronym for "C-like Object-Oriented Language".
Re: (Score:2)
Didnt know it was dead, but i do agree why do this when java works fine for this 'use case' ?
Re: (Score:2)
Because C# is awesome, Oracle and Larry are douche bags, and Java is a sucky security risk vector?
Re: (Score:2)
Seems like a lot of work to translate Java to C# for 'performance'.
I would've first attempted to target IKVM.NET. It already runs Java bytecode on mono.
There are performance and memory footprint benefits of C# ? Benchmarks?
Re: (Score:2)
Answering my own question, I read the article.
It compares the performance of Dalvik to Mono. Java's Hotspot has been shown in the past to beat dalvik on most performance benchmarks, so if the Oracle suit ruled in their favour, Android might get a real JVM. :)
Re: (Score:2)
There doesn't seem to be a perfect option to write cross platform, and this does requ
Re: (Score:2)
No. Ubuntu 12.04 includes a lot of mono packages, including mono runtime.
Re: (Score:2)
They removed mono from Ubuntu 12.04, if you want Tomboy (I think that's the only package it was added for) you'll have to download it and its dependencies yourself.
Re: (Score:2)
I searched mono on synaptic. There are a lot of mono packages listed. The change logs show activity from April 4th, 2012, and the person listed as making that change has an ubuntu.com email address. The mono packages aren't on the CD, but the CD has only 28 packages.
Re: (Score:2)
What is a CD? Oh... you mean those round disks that Linux used to come on before net installers?
Re: (Score:2)
Got to have something to initiate the install. I've heard of doing a net boot, but does that work over the internet (as opposed to a LAN)?
Re: (Score:2)
LOL. Mono was removed from the default install on Fedora quite a while ago (I think around F13?), and is not in the default install on RHEL6.
Re: (Score:2)
Re:RUN FOR YOUR LIVES (Score:4, Funny)
I agree this is off-topic, but I really like WPF. It has a steep learning curve and a lot of quirks, but data binding, templates, and the layout system save a lot of time and make things look nice. The people complaining about WPF in your link often called themselves old; maybe that's the real problem (I'm quite young).
Re: (Score:2, Insightful)
Sounds like you are doing it wrong then, because there's a whole ecosystem of .Net developers out there who seem to get things done just fine...
Re: (Score:2)
Re: (Score:2)
you think that's bad... the current design pattern du jour for WPF is the MVVM pattern - that's Model, View, Viewmodel. (like they couldn't even come up with a good name... model, view. umm, err. I know! ViewModel!)
You know you got problems when the creator of the pattern says that the overhead involved is too great for simple projects, and the complexity is too great for large projects, and in any case you have to be really careful or you end up using massive amounts of memory in the middle bit.
So, its no
Re: (Score:2)
MVVM is so damn close to MVC that if you know MVC it is not too hard to understand MVVM....besides that, you should probably get in the habit of getting it working, then refactoring it into the pattern...it is a lot faster.
Re: (Score:3)
There are shops out there that actual utilize the principles of software engineering to get the job done. You get much better, more reusable software packages with a whole lot fewer bugs and those bugs are discovered at a much earlier point in the development life cycle....Software patterns are part of that....avoiding fads is one thing...not all patterns are fads....most patterns are not designed to be a development template, but a refactoring template to allow ease of maintenance.
Re: (Score:2)
The design pattern for WPF apps is often MVVM, but WPF itself does not impose it on you, and its data binding is flexible enough to handle direct binding to a well written model (with custom converters, and custom markup extensions for brevity) - which is what I personally recommend.
Re: (Score:2)
you realize if you find yourself hacking a weird solution, then you are likely not using the available tools correctly, and likely building the software against the grain of the framework.
Re: (Score:2)
No machine has enough RAM to hold the source code.....it's too wordy.