Scala, Android and Eclipse

前端 未结 4 1300
逝去的感伤
逝去的感伤 2020-12-14 06:15

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

相关标签:
4条回答
  • 2020-12-14 06:56

    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.

    0 讨论(0)
  • 2020-12-14 07:05

    Solution found here to use the latest Android SDK, with Eclipse 3.7.2 and Scala 2.9 :

    https://stackoverflow.com/a/11084146/1287856

    1. It completely handles the android library
    2. You can make Android Library out of scala projects as usual
    3. The build process is completely automated, including proguard-ing and exporting the project with the regulard Android tools.
    0 讨论(0)
  • 2020-12-14 07:09

    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:

    1. Install Ubuntu on your device (as described here). This will not affect the Android installation.

    2. Boot Ubuntu, install JDK, Scala, etc, copy your Scala jars and run from there.

    0 讨论(0)
  • 2020-12-14 07:15

    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.

    0 讨论(0)
提交回复
热议问题