xamarin / xobotos Goto Github PK
View Code? Open in Web Editor NEWXobotOS - Android ported to C#
XobotOS - Android ported to C#
XobotOS project =============== XobotOS is a Xamarin research project that explored porting Android 4.0 from Java/Dalvik to C# to explore the performance and memory footprint benefits of C#. XobotOS is a semi-automated port of the Android 4.0 source code from Java to C#. The automated parts were ported using an improved version of Sharpen that can compile more advanced Java constructs and supports generics. Most of the manual bits of code fall in two categories (a) code to integrate with the host operating system and (b) replace the Java JNI code used to call into C, with the ECMA CLI P/Invoke functionality. License ======= The various components of XobotOS are licensed under the same license as their upstream providers. The C# versions of Android is licensed under the terms of the Apache 2 license, while the improved version of Sharpen is licensed under the GPL. XobotOS Source Code =================== XobotOS is made up of the following sources: sharpen: * Our updated version of Sharpen, see below for changes. android/generated: * Fully translated Java to C# code, classes that have been translated in this way contain the attribute [Sharpen.Sharpened] * Empty C# stubs based on the Java declaration: these are needed as intermediate steps to get things to build in the new C# world. Classes with empty stubs are decorated with the [Sharpen.NakedStub] attribute android/extra-sources: * Custom written code that either fine tunes the port, provides an alternative optimized version to a class or provides a runtime facility. android/api: * XML files that describe the translation process from Java to C#. android/upstream: * Google's Android 4.0 source code. libxobotos: * Glue code to integrate with various Android C++ libraries as well as the Linux X11 host that sets up the toplevel window and the optional OpenGL context. * Mostly calls into Skia, Jpeg, OpenGL and ICU libraries. binaries: * Libraries to get you started without requiring you to build Skia, and other native Android tools. * Screenshots, videos, and some basic precompiled samples. monodevelop: * Add-in to build native XobotOS applications with MonoDevelop samples: * Ported samples to C# using XobotOS external: * Native libraries needed to build the unmanaged libxobotos C library Sharpen ======= The outcome of this project is a vastly improved Sharpen tool that is able to port very sophisticated and advanced Java codebases from Java to C#. This code lives in the "sharpen" directory. This modified version of Sharpen can cope with the following enhancements: * Java generics * XML-driven translation process * Type remapping for native Java types to C# types, and supports for custom type mappings. * Support for translating code that does native interop * Support for generating C's .c and .h files for native glue (to assist in P/Invoke support) * Add attribute-supported translations * Improved incremental compilation Documentation on the improved Sharpen engine will be posted in the future so other developers can more easily port Java code to C#. Support ======= This code is provided as-is, and we do not offer support for any bits of code here, nor does Xamarin plan on continuing evolving XobotOS at this point.
This adds nothing to the original/linked issue. Closing as duplicate.
Originally posted by @conceptdev in xamarin/ios-samples#381 (comment)
xobot-os-report
Cannot compile android project.
Environment:
MacOSX
Eclipse
Eclipse Java EE IDE for Web Developers.
Version: Juno Release
Build id: 20120614-1722
Steps:
loaded
Building android
Multiple problems have occurred
An interal error occurred during : "Build Project"
Build Project :
An internal error occurred during: "Build Project".
Java heap space
Building Workspace:
An internal error occurred during: "Building Workspace".
Java heap space
log:
[10:10:49] Starting build
[10:10:52] Converting 2812 files (must parse 2812).
[10:10:52] Parsing 2812 compilation units.
[10:13:09] Conversion finished successfully at Fri Jul 20 10:13:07 CEST 2012 (141 seconds).
Event
Error
Message=An internal error occurred during: "Build Project".
StackTrace=
java.lang.OutOfMemoryError: Java heap space
at org.eclipse.jdt.core.dom.ASTConverter.convertType(ASTConverter.java:3123)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:785)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:454)
at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:183)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2656)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1219)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:885)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:581)
at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:894)
at sharpen.xobotos.XobotBuilder.stage1_parse(XobotBuilder.java:377)
at sharpen.xobotos.XobotBuilder.run(XobotBuilder.java:147)
at sharpen.xobotos.XobotBuilder.run(XobotBuilder.java:232)
at sharpen.xobotos.builder.SharpenBuilder.build(SharpenBuilder.java:156)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:432)
at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:305)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Message=An internal error occurred during: "Building Workspace".
Stack=
java.lang.OutOfMemoryError: Java heap space
!SESSION 2012-07-20 10:05:41.241 -----------------------------------------------
eclipse.buildId=I20120608-1400
java.version=1.6.0_31
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.platform.ide
Command-line arguments: -product org.eclipse.platform.ide -data /Users/moljac/Documents/workspace/../runtime-EclipseApplication -dev file:/Users/moljac/Documents/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os macosx -ws cocoa -arch x86 -consoleLog
!ENTRY org.eclipse.core.resources 2 10035 2012-07-20 10:05:45.718
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
No binding table for org.eclipse.ui.contexts.dialog
!ENTRY org.eclipse.core.net 1 0 2012-07-20 10:05:51.180
!MESSAGE System property http.nonProxyHosts has been set to local|.local|169.254/16|.169.254/16 by an external source. This value will be overwritten using the values from the preferences
Jul 20, 2012 10:07:13 AM sharpen.xobotos.XobotLogger setLogFile
INFO: Added logfile /Users/moljac/Documents/workspace/XobotOS/android/logfile.txt
Jul 20, 2012 10:07:16 AM sharpen.core.Sharpen Log
INFO: Starting build
Jul 20, 2012 10:07:18 AM sharpen.core.Sharpen Log
INFO: Converting 2812 files (must parse 2812).
Jul 20, 2012 10:07:18 AM sharpen.core.Sharpen Log
INFO: Parsing 2812 compilation units.
Exception in thread "[Timer] - Main Queue Handler" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.(String.java:215)
at java.lang.StringBuffer.toString(StringBuffer.java:585)
at org.eclipse.equinox.internal.util.impl.tpt.threadpool.ThreadPoolFactoryImpl.execute0(ThreadPoolFactoryImpl.java:94)
at org.eclipse.equinox.internal.util.impl.tpt.timer.TimerImpl.run(TimerImpl.java:110)
at java.lang.Thread.run(Thread.java:680)
java.lang.OutOfMemoryError: Java heap space
at java.lang.AbstractStringBuilder.(AbstractStringBuilder.java:45)
at java.lang.StringBuffer.(StringBuffer.java:91)
at org.eclipse.osgi.util.NLS.internalBind(NLS.java:168)
at org.eclipse.osgi.util.NLS.bind(NLS.java:91)
at org.eclipse.core.internal.jobs.Worker.handleException(Worker.java:43)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:64)
Jul 20, 2012 10:09:40 AM sharpen.core.Sharpen Log
SEVERE: Conversion finished successfully at Fri Jul 20 10:09:38 CEST 2012 (145 seconds).
Jul 20, 2012 10:10:46 AM sharpen.xobotos.XobotLogger setLogFile
INFO: Added logfile /Users/moljac/Documents/workspace/XobotOS/android/logfile.txt
Jul 20, 2012 10:10:49 AM sharpen.core.Sharpen Log
INFO: Starting build
Jul 20, 2012 10:10:52 AM sharpen.core.Sharpen Log
INFO: Converting 2812 files (must parse 2812).
Jul 20, 2012 10:10:52 AM sharpen.core.Sharpen Log
INFO: Parsing 2812 compilation units.
Jul 20, 2012 10:13:09 AM sharpen.core.Sharpen Log
SEVERE: Conversion finished successfully at Fri Jul 20 10:13:07 CEST 2012 (141 seconds).
!ENTRY org.eclipse.core.jobs 4 2 2012-07-20 10:50:28.248
!MESSAGE An internal error occurred during: "Building Workspace".
!STACK 0
java.lang.OutOfMemoryError: Java heap space
!ENTRY org.eclipse.core.jobs 4 2 2012-07-20 10:50:28.250
!MESSAGE An internal error occurred during: "Build Project".
!STACK 0
java.lang.OutOfMemoryError: Java heap space
at org.eclipse.jdt.core.dom.ASTConverter.convertType(ASTConverter.java:3123)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:785)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:454)
at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:183)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2656)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1219)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:885)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:581)
at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:894)
at sharpen.xobotos.XobotBuilder.stage1_parse(XobotBuilder.java:377)
at sharpen.xobotos.XobotBuilder.run(XobotBuilder.java:147)
at sharpen.xobotos.XobotBuilder.run(XobotBuilder.java:232)
at sharpen.xobotos.builder.SharpenBuilder.build(SharpenBuilder.java:156)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:432)
at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:305)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Hi Xamarin Crew,
You mentioned in the initial post that you were planning to add some documentation so people could take advantage of the improved Sharpen bits. Any news if this is still forthcoming? We'd love to use Sharpen to move and maybe maintain some .net ports of some of the popular open source semantic libraries. Any help with Sharpen would be great.
Thanks,
Dave Gerding
You guys spent a lot of time porting Android to C#, but it's hard to appreciate your work if the build process is so convoluted. I think if you distributed a working build all setup in a VM, then a lot more people would get involved in this project. It's cool if you don't plan on evolving this project further, but at least give us a jumping off point :)
Well, you did an awesome job. And what's also great is that you provide some implementation, in c#, of the java.util class. I'm actually interested in using them, and was wondering what license applies to this files.
Thanks in advance.
Can you update code for Android 4.2, latest Linux Kernel and Dalvik?
Thanks!
After getting the appropriate Eclipse SDK plugins installed so that the repository check out builds, I've pointed my Indigo Eclipse running on Mac to the path down to my sharpen.site directory: /Users//Development/XobotOS/XobotOS/sharpen/sharpen.site. In there is still just the original site.xml file. All I get in the list of software when it's pointed to it is "There are no categorized items." I've tried pointing one level up, at sharpen.feature, and a few other directories and have not been able to get the plugin listed. I have no build errors but do have literally thousands of warnings about "raw types" and the like in my "Problems" tab.
Are there any plans to update this project? Or is it dead?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.