Android application in haskell - java

Hi i know there are similar questions. But maybe thare are any updates or new libraries in this area.
What I'm looking for:
Best practices of writing android
appplication in Haskell. I know in
c#(monodroid)/java there are millions
of samples.
Do you know bloggers, articles which write about android+Haskell
I saw these useful links:
Haskell interpreter on Android?
Running a Haskell program on the Android OS
http://news.ycombinator.com/item?id=1251408
And I understand that I could use
GHC targeting ndk gcc
JHC
What about converting Haskell to C and using NativeActivity? http://developer.android.com/reference/android/app/NativeActivity.html
If you want to do android UI code in Haskell somebody will have to write Haskell bindings to Java through JNI/C
Are there any Haskell, Android experts?

It really depends what you want from your Haskell on Android.
If you want to write Haskell98 code on Android, you can use JHC and create NDK bindings yourself. I
GHC is available on ARM. This should enable using most Hackage packages available in an ARM environment. I've haven't heard much in terms of experience reports working with GHC ARM Builds.
It seems like the inevitable conclusion of functional programmers on Android is to invest your time in Clojure and Scala.

Related

Phone applications written in c++

I have an application idea that I want to create and I want to create this app for both iOS-iphone and Android.
So I would like to ask for some advise!
Is it possible to create a full fledged ( IOS and ANDROID ) application in pure C++ ?
Is it smart to create an application in C++ for both ( IOS and ANDROID ) or is it better to write the application in ( Objective-C and Java ) for each devise target.
Take a look at Xamarin. I believe that will do what you want. I haven't used it, but colleagues of mine have. They say by writing with Xamarin, they will accomplish about 75% of their code. But they will need to go in to each iOS and Android to work on specific code, usually for the UI.
Both Android and iOS can handle c++, but the UI is programmed in their native languages. Obj-C for iOS and Java for Android.
If you don't need to use native APIs for anything, you can write your app in C++
Most people seem to think that the biggest downside is that you can't use the UI APIs for the platforms, but if your app has a simple interface, you can render and handle it in OpenGL. The biggest downside would be the lack of networking APIs imo.
As far as Android is concerned, writing your Model and Controller in C++ and then just doing the View part as Java code would be a pretty horrible - C++ may be 15-20% faster in execution, but constantly doing calls to the native layer would make your app slower overall due to the overhead.
It really depends on what your app needs to accomplish. I'm not familiar with cross-platform tools like Xamarin, but if you find something that generates Android Java and iOS Objective C which you can then edit however you like, that would be your best bet.
IOS is written in objective-c whereas Android is written in Java. Although Android apps can use C/C++ as part of the NDK it wouldn't really be suitable, maybe not even possible for the entireity of the app to be written in C++. C++ in Java would only be used really in time critical parts of the app where you can't afford to have delays from overheads in Java such as the memory management/Garbage collection.
AS Binghammer pointed out, Xamarin could be used to create a cross platform Android/IOS app although this would be written in C#.
Apportable enables Objective-C apps to be run on both iOS and then rebuild for Android.
The advantage of Apportable over C# or C++ is support for much of the rich set of Objective-C API's that facilitate mobile device programming.

Does Unity3D let you code with Java?

I have been searching but I get the mixed up answers with Java and Javascript. Basically I am wondering if Unity3D lets me make games with Java? I want to make browser based games, not android.
Currently unity3d doesn't support java.
According to unity3d website.
Scripting with Unity brings you fast iteration and execution and the
strength and flexibility of a world-leading programming environment.
Scripting is uncluttered, straightforward and incredibly fast. In
Unity, you write simple behavior scripts in JavaScript, C# or Boo. All
three languages are easy to use and run on the Open Source .NET
platform, Mono, with rapid compilation times.
What Language is Used To Develop Using Unity
http://unity3d.com/unity/workflow/scripting
In Unity, you write simple behavior scripts in C# or JavaScript (UnityScript). Both languages are easy to use and run on the integrated scripting runtimes.
Read more: https://unity3d.com/unity/workflow/scripting
As stated above, Unity as of now don't support java coding.
For Java, libGDX is the best option: http://libgdx.badlogicgames.com/
Though Unity has better support and documentation, libGDX is also really powerful.
Clash of the Olympians is a popular game made with libGDX
https://play.google.com/store/apps/details?id=com.ironhide.games.clashoftheolympians

Developing GIS Apps for Android: Java or Python?

I am a newbie in android apps development. I was wondering which of the two is easier for developing android apps which are more geared towards GPS and GIS related data/activity.
I see python being predominently used for GIS related applications/programs. I have also heard/read that Python is easier to code and learn to code. In addition, I am not looking for an complicated applications other than simply logging acceleration, GPS data along with triggering camera activity.
What IDE would you suggest me based on your answer?
I was playing with Eclipse IDE for Java to develop some "Hello World Apps".
This post seem to be old to me and the answers does not seem to consider the GIS aspects.
My advice is unless you have a highly compelling reason that has been peer-reviewed, do not fight the Android platform. That means you should just use the standard Java Android APIs.
I've programmed a couple of apps that make use of the Android GPS hardware. You will find many examples and guides using Java.
If you find some compelling reason to use python for your back-end of an enterprise system, that will still be possible.
As far as IDE advice, I prefer IntelliJ IDEA, having used both eclipse and IDEA. Eclipse is great, though I find the IDEA UI and features to be easier to learn and use. No doubt they are both fantastic and complicated software that will at times frustrate you.
The answer is Java as Java is Android's language.
There are other options like Mono with C#, Python, C++ with NDK, C++ with Marmalade, etc
Most official android docs are about java and C++ with NDK.
Python on Android is mostly used by python fans in rooted environment.
If you wish to make commercial and release it in Google Play market then you should use Java in such application.

C++ or Java for android?

I am thinking about picking up android development in my free time. I see that development is possible in Java and C++ but the latter is limited.
I am much more comfortable with C++.
So my question is what limitations exist with C++ on Android? Will I be able to develop full apps with it, or will I eventually have to learn Java?
Pick the right tool for the job. The right tool for android is java, and occasionally c++ if it's really needed. Android runs on several different CPUs, and you'd be required to deal with fun stuff like compiling for platforms that you can't really test on - at least if you want to make apps for anyone but yourself.
It's all dependent on what you want to do, but the general rule of thumb:
C++ is for speed (for example games).
Java is for UI and general Android programming.
You cannot code an entire Android application using only C++, the android SDK is written in Java and that is what you will have to use.
This said you can still use C++ for heavy stuff.

Starting with Android: Java or Python (SL4A)

I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).
I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a "second class" language on Android. On the SL4A website it is also stated to be alpha quality software, which is not exactly encouraging.
I'm also not quite sure what the limitations of the scripting environment are and if they would be problematic.
At the moment you cannot create a releasable program with Python (or any other scripting language) using SL4A. I have heard rumours that this is something Google is working on, but even if they do enable it Python apps are likely to be slow and power-hungry compared to Java. Also the scripting API only gives you access to a limited subset of the native Java API. I would not consider using SL4A for serious development work at the moment, only for one-off scripts and prototyping.
Take a look at Scala. It is a statically typed language on the JVM, but uses type inference to remove most of the noise that you get in Java. It also fully supports functional programming, and has a lot of pythonish features. Because it is statically typed it is as efficient as straight Java with none of the disadvantages. IMHO it is the language that Java should have been in the first place.
A lot of people are blogging about using Scala on Android, so Google around for more information.
More likely will depend what type of applications you will develop.
I would start with Java to become familiar with Android SDK. Anyway first you need to look into some examples, tutorials. Most of them are done in Java, and only a few, probably on the dev site of SL4A for that.
Also there is native development Android NDK, that can be programmed with C++.
But anyway Java rules for general applications.
Adding an update to Dave Kirby's answer:
Issue 55, Distribute scripts as APKs, in the issue tracker at SL4A deals specifically with that.
There is a solution being worked out (may be complete by now) described at SharingScripts. The only issue seems to be that you need to have a interpreter APK already installed.
you may want to check out Ruboto it is a framework for developing Android apps based on JRuby which means your JRuby code can call Android APIs and can also be called back from the Android Java side.
Here is an introduction article .
Consider ising Kivy, if you want to write Android apps with Python. The process of packing script to .apk file is described here.
The problem is, resulting .apk will be big (~7Mb for 300Kb data). It is obvious, because you need to pack there Python runtime and all libraries.
Another solution I have heard of, is Pygame for Android, but it works on lower lewel, so you need to draw graphics manually.
Unfortunately, I have not tried any of this ways yet, but it looks, that I'm going to start using kivy soon.

Categories