This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Which programming languages can I use on Android Dalvik?
Mostly, Android applications are written in Java. But i heard that its also possible to use Scala or some other languages. And I also read that it's possible to include native C/C++ code.
Is there a refernce/list available that shows which languages can be used?
At launch, Java was the only officially supported programming language for building distributable third-party Android software.
Android Native Development Kit (Android NDK) which will allow developers to build Android software components with C and C++.
In addition to delivering support for native code, Google is also extending Android to support popular dynamic scripting languages. Earlier this month, Google launched the Android Scripting Environment (ASE) which allows third-party developers to build simple Android applications with perl, JRuby, Python, LUA and BeanShell. For having idea and usage of ASE, refer this Example link.
Scala is also supported. For having examples of Scala, refer these Example link-1 , Example link-2 , Example link-3 .
Just now i have referred one Article Here in which i found some useful information as follows:
programming language is Java but bridges from other languages exist (C# .net - Mono, etc).
can run script languages like LUA, Perl, Python, BeanShell, etc.
I have read 2nd article at Google Releases 'Simple' Android Programming Language . For example of this, refer this .
Just now (2 Aug 2010) i have read an article which describes regarding "Frink Programming language and Calculating Tool for Android", refer this links Link-1 , Link-2
On 4-Aug-2010, i have found Regarding RenderScript. Basically, It is said to be a C-like language for high performance graphics programming, which helps you easily write efficient Visual effects and animations in your Android Applications. Its not released yet as it isn't finished.
Here's a list of languages that can be used to develop on android:
Java - primary android development language
Kotlin, language from JetBrains which received first-party support from Google, announced in Google I/O 2017
C++ - NDK for libraries, not apps
Python, bash, et. al. - Via the Scripting Environment
Corona- One is to use the Corona SDK . Corona is a high level SDK built on the Lua programming language. Lua is much simpler to learn than Java and the SDK takes away a lot of the pain in developing Android app.
Cordova - which uses HTML5, JavaScript, CSS, and can be extended with Java
Xamarin technology - that uses c# and in which mono is used for that. Here MonoTouch and Mono for Android are cross-platform implementations of the Common Language Infrastructure (CLI) and Common Language Specifications.
As for your second question: android is highly dependent on it's java architecture, I find it unlikely that there will be other primary development languages available any time soon. However, there's no particular reason why someone couldn't implement another language in Java (something like Jython) and use that. However, that surely won't be easier or as performant as just writing the code in Java.
Scala is supported. See example.
Support for other languages is problematic:
7) Something like the dx tool can be forced into the phone, so that Java code could in principle continue to generate bytecodes, yet have them be translated into a VM-runnable form. But, at present, Java code cannot be generated on the fly. This means Dalvik cannot run dynamic languages (JRuby, Jython, Groovy). Yet. (Perhaps the dex format needs a detuned variant which can be easily generated from bytecodes.)
As stated above, many languages are available for developing in Android. Java, C, Scala, C++, several scripting languages etc. Thanks to Mono you are also able to develop using C# and the .Net framework. Here you have some speedcomparisions: http://www.youtube.com/watch?v=It8xPqkKxis
Clojure can be used, but it's slow.
See also: Clojure fork for Android, and a tutorial.
I made good experiences with Scala.
I use the simple build tool (sbt: http://code.google.com/p/simple-build-tool/) with the Android-Plugin (http://github.com/jberkel/android-plugin)
Java and C:
C used for low level functionalities and device connectivities
Java used for Framework and Application Level
You may find more information in Android developers site.
Related
I've been searching solutions for my enterprise apps, at least 3 platforms need to be supported, which are iOS, Android and Window Phone. After a whole day's search, I finally set my eyes on 2 promising cross platform solutions, one is monocross and the other phonegap.
monocross seems to use c# and .net at all, is it possible to access native libraries and languages? I read somewhere it's compiled directly into binaries that can execute on target platforms.
And about phonegap, it uses webviews on each platform to provide the capabilities of presenting user interfaces to final users. As it's implemented via interpreted language and high level apis, the performance may not meet our needs.
Finally, we(my team) decide to give it a try with mono, the architecture is illustrated as bellow:
+++++++++++++++++++++representation layer++++++++++++++++++++++++++
[monotouch,monodroid,silverlight]or [native gui calls] or [html5/js/css]
+++++++++++++representation controller/business logic layer+++++++++++++++
[ mono/c# ]
++++++++++++++++++++++++++++server side+++++++++++++++++++++++++++
[ the cloud ]
I want to use mono/c# to write some common purpose business logic and data structures, and when it comes to some common platform features, like storage service, notifications, I'd like to wrap them up on each platform and expose uniform apis for c#(business logic layer) to use. As to the representation layer, we decide to choose from the 3 optional solutions listed above.
To make this happening, first I have to figure out if it is possible to call native frameworks.
So, my questions are:
1, How does mono work, I mean, are the c# codes compiled into binaries that can be executed directly on iOS, Android and Windows Phone?
2, Is there a mechanism to make native invocations? Like in cocos2d-x, I can call java methods via JNI, and in iOS, c++ can call oc directly. Can I call cocoa touch stuffs in mono with c#?
3, Is it possible to manage all these stuffs in one single project, and how to build them?
4, Are there any better solutions?
Any suggestions will be appreciated, thanks for your patience!
I wonder why Xamarin does not land on the first page of your search result,
http://xamarin.com/features
But that's what the Mono guys created for the C# developers that want to target mobile platforms. MonoTouch and Mono for Android are there each featuring a common library base with Microsoft .NET, and also platform specific bindings.
Your non-UI code should be able to be used in portable libraries and share among them. Microsoft's portable library is Windows specific, and right now I am not sure how much Mono guys can embrace that, but even if PCL fails, you can create multiple platform specific projects based on the same copy of source files (which I did in #SNMP). The remaining task is to develop platform specific UI for Windows Phone, iOS, and Android.
There are tons of articles showing the features,
http://docs.xamarin.com/
and also many successful apps
http://xamarin.com/apps
The best way to learn a product is to try it out (for free in Xamarin's case). This also applies to MonoCross (which is a framework built upon Mono).
I am not familiar with PhoneGap, so you need someone's advice on that.
Disclaimer: this is not a complete answer - but I do hope it answers at least part of your question
I encountered a similar problem when I started cross-platform dev using the Mono products 18 months ago.
The approach I've built since is called MvvmCross - it forked off of MonoCross a long time ago - now shares no code with it (but maybe we'll team up again one day!).
The approach uses PCLs to share code. This is not entirely painless, but is easy after you've done a few setup steps - http://slodge.blogspot.co.uk/2012/12/cross-platform-winrt-monodroid.html
You can learn more about this approach on this video: http://slodge.blogspot.co.uk/2012/12/mvvmcross-video-presentation-xaminar.html
If something is written in VB is it compatible with android?
If so, can you give me some documentation?
No, you can not use programs written in visual basic on android. Android uses java. The closest you'll get is Mono For Android which currently doesn't support VB.NET.
EDIT: (7/12/2016): This is now supported via Xamarin
I assume you are talking about VB.NET, then Mono does not yet support it.
Currently Mono for Android does not support Visual Basic.
We are looking at adding support for Visual Basic on upcoming versions
of Mono for Android.
Technically, what needs to happen is the following: we need to provide
the Visual Basic helper library (part of Microsoft.VisualBasic.dll)
and compile it to work with the Mono for Android mscorlib.dll instead
of the standard Mono 2.0 mscorlib.dll
With the above it will be possible to use Microsoft's Visual Studio to
compile VB code that will run on Mono for Android. But we want to
support Mono's own Visual Basic compiler, but that will also require
the compiler to run using the Mono for Android mscorlib.dll. This is
not difficult, but requires time to get done and integrate into our
release process.
At this point there is no ETA on when the above will happen.
2: http://mono-android.net/FAQ
You could try however Basic4android if that suits your needs.
The closest you're probably going to get is VB.NET via MonoDroid, which according to their FAQ currently does not support Visual Basic. (But they do have it on their radar at least.)
VB is a Microsoft product. While there are some 'nix' implementations of .Net product like Mono, Android is unlikely to support .Net mainly due to liscencing.
I know C# rather well and just love Visual Studio as IDE. :) Yet now I want to start developing for android...
I found out about MonoDroid and wanted to ask if it has any downsides to it that would make Java more preferable, or should I uninstall Eclipse and dive straight into MonoDroid?
If I understand right, MonoDroid deploys/compiles native android applications and does not need any additional .net-like framework or anything?
Are there any significant limitations to what I can do with MonoDroid? For example, having the app run in the background or using some external .net libraries for image editing, etc. ?
I've been worrying about the same thing - productivity in C# instead of playing with an unfamiliar language, vs developing how the OS developers intended it to be.
Its easy to list pros vs cons -
pros (of monodroid, for C# developers)
familiar dev environment, can develop using Visual Studio
C# instead of Java
Reusable code assets - you can use a lot of code in your iphone project or Windows phone 7 project using monotouch and the WP7 SDK.
cons -
debugging could be difficult, due to lack of api documentation from Google. Will have to depend solely on monodroid documentation.
there could be a lag when it comes to latest cutting edge features - safe to assume that the monodroid team will require some time to wrap around the latest android features every time there is a new OS release
availability of libraries - I am not sure how you can use the open source libraries that would have evolved around the android platform, that could cut down on development time
Much of the documentation available is in Java: so if you run into difficulties with phone behavior when using MonoDroid you won't really find that much help or debugging information so you may want to stick with Eclipse.
There's a lot more than just a set of wrappers running under davlick, truth to be told, there is much more of a horizontal relationship between MonoDroid and Android;
When did using the same language as the OS developers become a big issue? There's lots of C++ programmers wondering how to use BSD or SVR5 and many C programmers who want to know what the heck to do on Windows++...
If you will write in c# anyway you will be have to wrap it into a Java code, so what's the point ? Also you may head with a very difficult issues while trying to understand the APIs who written for Java programming...
Here are some points that you can mull over:
Android applications are predominately written with Java. The Android SDK itself is natively written in Java.
Working in Mono may not provide all the functionality available in the Java SDK.
If you are a C# Developer you wont be able to find, in Java, some of the (cool) features available in C# (like Property Delegates etc).
Code written in .NET can be re-used for other environments - this may save a lot time that would have been spent learning a new language/environment (like Objective C), and coding in it.
.NET extends the Android development stack with it's existing libraries and API's.
I think both are good for certain reason. It will be very hard to say which one is preferable for Android development - in the end that is up to you too decide.
Also note that any release build using monodroid adds an additional 4mb to the apk filesize and increases app startup time with a few seconds.
For simple apps this can mean a 500-800% increase in filesize - whic is pretty bad in my book.
I'd like to start creating Android apps but I don't like Java. I read that scala can be used to do it. Are there another option?(Clojure?)
I'm a Python/Django developer so it would be great to learn a pretty different language.
At this point Scala is the one that is most mature..I wanted to try groovy myself but its not even out of alpha..
Plus Scala on android has docs..:)
It's not hard to do with Mirah (formerly Duby), a very young language based on Ruby that compiles to bytecode that's basically indistinguishable from Java's, but adds some great new features like closures, type inference, and obviously a Ruby-like syntax. It's particularly well-suited for Android because it has no runtime or standard library (it uses compiler plugins instead) outside the JDK, whereas basically all other JVM languages bring along a lot of baggage, especially languages that weren't designed to target the JVM (like Ruby and Python).
http://github.com/technomancy/Garrett
Much nicer than writing Java!
for clojure development a useful tutorial: http://riddell.us/ClojureAndAndroidWithEmacsOnUbuntu.html
Clojure gets a LOT of benefit from android-2.2's JIT compiler and has not really been widely adopted on previous versions.
Appcelerator Titanium is an awesome environment for using web-ish skills (like HTML, CSS, and JavaScript) to build native apps for Android (and iPhone, and desktops, etc.). For example, the gang at Intridea have made several popular Android & iPhone apps with Titanium Mobile, including the OilReporter app that has been used for gathering data on the extent of the Gulf oil spill.
If you use Python, maybe SL4A (Scripting Layer for Android) is a good choice.
You could write python script that runs on Android and use Android API, but it also has a drawback that you need install Python/SL4A runtime library on your Android device.
In addition to the other solutions listed here previously, you have:
PhoneGap
Rhodes
AIR (pre-release)
AppInventor
Clojure
Another immature implementation is JRuby/Ruboto: http://blog.danieljackoway.com/first-ruboto-release.html
I want to learn a new programming language and develop for the Android platform.
I'm a fulltime C# / F# - developer and I also use C# in the most functional way possible (because I like this paradigm far better than the old skool style "lets iterate and describe to the barkeeper how to make the cocktail", to quote Microsoft).
However, I have a strong dislike for Java, because in my opinion it is outdated and, hm, a dinosaur - it lacks exactly the features I like best about C# and F#.
On the other hand, developing for the Android platform requires JDK use.
So, would you recommend Scala? Or is the JDK stuff not for me at all?
Scala rocks exactly as you'd expect that a functional language built on the JVM might. The only downside compared to C# for me (I haven't used F#) is that the IDEs haven't quite got the refactoring down yet. It isn't bad. I'm using IntelliJ's plugin for Scala; that seems to work well enough.
Of course, the main benefit you get from Scala is being able to leverage all the many Java libraries out there, since they work (mostly) interchangeably. That might not be important for the Android platform where your apps will be small and stand-alone, but for commercial development it means that Scala is already a serious Enterprise language. Learning Scala will therefore give you more job opportunities in the future. I would definitely recommend Scala.
One of my large financial clients is using it as their server-side language and it works beautifully. There are a few interesting clashes between eg: Scala and Java lists, Scala and Java booleans, all well-documented, but otherwise it's smooth.
Good luck!
An alternative to using Scala might be the upcoming MonoDroid, a port of the Mono runtime to android. Unfortunately it isn't completed yet, and will cost something like 400$.
I'd recommend looking into scala if you develop a new application for android and only use monodroid if you want to create a port of an existing .net application.