What languages are mature to develop native apps in Android [except Java] - android

Is there a languages other then Java to develop native apps in android without script layer/AIR and others 3rd party abstractions.
Mostly im interested in Clojure,JRuby, Scala

Since Scala is compiled to native JVM bytecode, it could be use to develop native Android apps.
The biggest problem is that using 3rd party library is not that easy in Android development, and you need use proguard to reduce the size of your program, sometimes this will cause problem.
But it is still feasible to develop an Android app using Scala, for example, I've wrote an little android app (page in Chinese, but there is screenshots) using Scala. It's not a complex app, but should demonstrate what Scala could do in Android app development.
Here is also an SBT plugins that help you build your Scala/Android program.
Finally, if you want develop Android using Scala, I will suggest using Scala 2.8.x. I found my program crashes during adb install when I extends a collection class using Scala 2.9.

If you use Mirah, you can get code that is exactly as fast and small as writing Java, but you get niceties like type inference, closures, and macros. The tooling is still pretty immature compared to Scala, but if you want to minimize overhead above all else you should give it a look: http://mirah.org and https://github.com/mirah/pindah

Related

Difference between SDK and NDK in android

Since 2 Years I am working as Android Application Developer. I generally use android SDK for all the Android Apps Development. Now I have a project which is an Android App in which I have to use SDK as well as NDK for App development (As per Client requirement).
But as I don't have any experience with NDK I don't know what is it. In some Blogs I have read that NDK development is based on c++.
Is it true that to work with NDK one must have the complete knowledge of c++ ?
Please Help !!
Use of NDK means you have to write portion of code in C/C++ just to achieve the speed. If it is client requirement then you have no option. But keep in mind that you should use NDK only when you feel you need better performance. And of course you must have some understanding of c/c++ to use NDK.
NDK
NDK is a set of tools to compile C code to shared lib,
which you could use in your app - and that's all.
Enables legacy code re-use between iOS and Android platforms
Good for implementing CPU intensive operations that don't
allocate much memory like signal processing, physics simulations.
SDK
SDK is the main development kit for Android apps - it contains tools for Java and resources (png, xml) compiling, packaging to apk file, installing, running and debugging them on a device, an emulator, documentation, etc.
Java has superior memory management model Superior threading model Better exception handling model Rich set of libraries Superior support for unicode characters.

Scala, Android and Eclipse

I've started learning Scala, and I... I think I'm in love. I've only coded small test snippets so far, but since I currently working in Android development, what I really want to do is try my hand at writing Android applications in Scala.
I've found articles and questions on the matter, but mostly referring to older versions of the three tools (Android SDK/Scala/Eclipse), so the general question is:
Is anybody coding Android apps in Scala right now, with the latest SDK, Scala 2.9 and Eclipse Indigo? How viable is it?
And, in particular:
How's the interaction/integration between Scala's features and the Android library?
What's the state of the Scala plugin for Eclipse? I've read all the features you'd expect are there, but I'd like to know first-hand stories, specially about the debugger.
How well does the build process (scala to java to dalvik, ant, proguard, etc.) automate?
Thanks!
We are using Scala heavily to test our Android code - you can read a writeup of how we're doing so here. We use Ant or SBT to compile - there's an excellent SBT plugin for Android development.
Having said all of that, I'm not sure that I would recommend Scala for production Android development. In particular Scala 2.9.x is basically unusable as there is no good way to get the libraries to work on Android. You can read about the issue here.
It's a real pity, as Android development would benefit considerably from Scala if we could get it working properly.
Solution found here to use the latest Android SDK, with Eclipse 3.7.2 and Scala 2.9 :
https://stackoverflow.com/a/11084146/1287856
It completely handles the android library
You can make Android Library out of scala projects as usual
The build process is completely automated, including proguard-ing and exporting the project with the regulard Android tools.
I started to implement the android application (a twitter client) from the book "Learning Android" with Scala 2.9.0-1 a while ago.
In my opinion you can use it. I had only one problem with the parameter list at AsyncTask (see this link, problem #3).
If you want to checkout out the project, you can find it here.
This video from ScalaDays 2011 may be hepful:
Scala on Android: Real-world Experience at Bump Technologies by Michael Galpin
EDIT:
If you really really want to run Scala code on Android (and not really make an app, but for yourself), then I have an easier solution. It depends on if your phone supports the procedure. In summary the steps are:
Install Ubuntu on your device (as described here). This will not affect the Android installation.
Boot Ubuntu, install JDK, Scala, etc, copy your Scala jars and run from there.

How to create Android apps using Delphi

I have been asked to research on how to make an android app using Delphi, Now I am not sure that this can be done. I have not come across tutorials on the same. Somebody please clarify on this issue.
Delphi cannot create Android apps at present. This is being worked on for a future release.
Update: As of the release of XE5, Delphi now supports Android development for certain ARM hardware using the mobile Delphi compiler.
Free Pascal is now able to produce code for the Java platform - so it might be feasible to create Delphi code which can be compiled to Java bytecode with FPC and then converted for the Dalvik VM.
The FPC backend for the Java Virtual Machine (JVM) generates Java byte
code that conforms to the specifications of the JDK 1.5 (and later).
While not all FPC language features work when targeting the JVM, most
do (or will in the future) and we have done our best to introduce as
few differences as possible.
This FPC JVM backend is not related to Project Cooper by RemObjects,
nor does FPC now support the Oxygene language.
Two choices to follow at present - check out Delphi for Android which is in design/beta phase: http://lenniedevilliers.blogspot.com/
Or, use Prism http://www.embarcadero.com/products/prism (and check out their Oxygen for Java coming soon http://www.remobjects.com/oxygene/java.aspx which is in Beta)
With DWS as backend script compiler and the soon to come Smart Mobile Studio (aka OP4JS) component library and RAD interface it will be possible to make apps running with HTML5 in android applications (and iOS or any other html5 compatible system).
By using object pascal, all Delphi and freepascal users will have a short learning curve and a high code reuse factor.
There are some samples using only the DWS backend here :
taming-the-flock-with-object-pascal
taming-html5-verlets-with-object-pascal
Update :
More samples can now be found on their homepage.
First steps with native Android applications made with Lazarus/FPC are here.
One way is to use a combination of Delphi, Sencha and PhoneGap by leveraging the Raudus framework. You can try the RaudusEmployee.apk example on your phone and see if this method will work for you.
http://www.raudus.com/samples/
This is not a native application, but similar to many new HTML5 applications.
Delphi XE5 is now released with Android support.
http://www.embarcadero.com/products/rad-studio/create-android-apps

What is the Android Native Development Kit (NDK)?

What is the Android NDK (native development kit) ? How can one use it? Why should one use it?
The NDK (Native Development Kit) is a tool that allows you to program in C/C++ for Android devices. It's intended to integrate with the SDK (it's described as a "companion tool") and used only for performance-critical portions of a project. See here for more information.
NDK may improve application performance. This is usually true for many
processor-bound applications. Many multimedia applications and video games use
native code for processor-intensive tasks.
The performance improvements can come from three sources. Firstly, the native code is compiled to a binary code and run directly on OS, while Java code is translated into Java
byte-code and interpreted by Dalvik Virtual Machine (VM). At Android 2.2 or higher,
a Just-In-Time (JIT) compiler is added to Dalvik VM to analyze and optimize the Java
byte-code while the program is running (for example, JIT can compile a part of the
byte-code to binary code before its execution). But in many cases, native code still
runs faster than Java code.
Java code is run by Dalvik VM on Android. Dalvik VM is specially designed
for systems with constrained hardware resources (memory space, processor
speed, and so on).
The second source for performance improvements at NDK is that native code allows
developers to make use of some processor features that are not accessible at Android SDK,
such as NEON, a Single Instruction Multiple Data (SIMD) technology, allowing multiple
data elements to be processed in parallel. One particular coding task example is the color
conversion for a video frame or a photo. Suppose we are to convert a photo of 1920x1280
pixels from the RGB color space to the YCbCr color space. The naive approach is to apply a
conversion formula to every pixel (that is, over two million pixels). With NEON, we can process multiple pixels at one time to reduce the processing time.
The third aspect is that we can optimize the critical code at an assembly level, which is a
common practice in desktop software development.
Disadvantage
NDK cannot access lots of APIs available in the Android SDK directly, and developing in NDK will always introduce extra complexity
into your application.
The Android NDK is a companion tool used only in conjunction with Android SDK which allows application developers to build performance-critical portions of their apps by use of native (C/C++) code.
This provide benefits in form of reuse of existing code and increased speed.
Please go through below links.
Link-1
Link-2
Link-3
The Android NDK is a companion tool to the Android SDK that lets you build performance-critical portions of your apps in native code. It provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C or C++. If you write native code, your applications are still packaged into an .apk file and they still run inside of a virtual machine on the device. The fundamental Android application model does not change.
The following links also answers your question:
What is NDK?
When to Develop in Native Code
NDK Download
How to build NDK app
how to work with NDK
10 tips for Android NDK
The Android NDK is a toolset that lets you embed components that make
use of native code in your Android applications.
Android applications run in the Dalvik virtual machine. The NDK allows
you to implement parts of your applications using native-code
languages such as C and C++. This can provide benefits to certain
classes of applications, in the form of reuse of existing code and in
some cases increased speed.
Source: http://developer.android.com/sdk/ndk/overview.html
The Android NDK is a companion tool to the Android SDK that lets you
build performance-critical portions of your apps in native code. It
provides headers and libraries that allow you to build activities,
handle user input, use hardware sensors, access application resources,
and more, when programming in C or C++. If you write native code, your
applications are still packaged into an .apk file and they still run
inside of a virtual machine on the device. The fundamental Android
application model does not change.
Source: http://developer.android.com/sdk/ndk/index.html
NDK is just a set of tools which lets you to write C/C++ codes for your application.For example suppose you want to add a critical function/performance to your app and you want to write it in C/C++ then eclipse or any other IDE will not allow you to write your C/C++ and in that case you have to use NDK and integrate it in your app.
NDK is a toolset that allows you to implement parts of your app using native-code languages such as C and C++....Checkout this https://developer.android.com/tools/sdk/ndk/index.html
Android NDK (native development kit)
Android Native Development Kit (NDK) is developers to write code in C/C++ that compiles to native code
Why should one use it?
The source code is compiled directly into machine code for the CPU (and not into an intermediate language, as with Java) then developers are able to get the best performance
How can one use it?
Here best tutorials
https://developer.android.com/ndk/index.html
https://www.androidauthority.com/android-ndk-everything-need-know-677642/
https://www.ntu.edu.sg/home/ehchua/programming/android/Android_NDK.html

ruby on android : ruboto vs rhodes?

Has anyone tried developing an Android app using Ruby? If so, which tool would you recommend?
What are the advantages and disadvantages, comparing (between) both?
Any sharing of experience, insight, etc., would be much appreciated.
Disclamer: I haven't used this project at all. Having said that:
The Mirah programming language's syntax is based heavily on Ruby and it compiles to Java byte code which you could then run through the dx android tool.
Another option to consider would be JRuby. JRuby is a fairly mature implementation of Ruby which, I believe, supports ahead of time compilation.
Rhodes uses compiled Ruby 1.9 bytecode at run time, and does not use the Dalvik JVM at all (it's written in C++ with the NDK). Hence, it is much faster than Ruboto.

Categories

Resources