Android Scala 编程 [英] Scala Programming for Android

查看:35
本文介绍了Android Scala 编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Scala 2.7 遵循了 Scala 和 Android 上的教程.3 决赛.生成的 Android 应用程序可以运行,但即使是最基本的应用程序也需要几分钟 (!) 编译并需要 900 kb 压缩,这对于移动应用程序来说是个障碍.此外,IDE 时不时会耗尽内存.我认为 dex 不是为像 scala-library 这样的大型库制作的.

I have followed the tutorial at Scala and Android with Scala 2.7.3 final. The resulting Android App works but even the most basic application takes several minutes (!) to compile and needs 900 kb compressed, which is a show stopper for mobile applications. Additionally, the IDE runs out of memory every now and then. I assume dex is not made for big libraries like the scala-library.

  • 所以我的问题是:有没有人真的这样做过,有没有办法解决这个问题?

推荐答案

我已经用 Scala 编写了一些基本的 Android 应用程序,没什么特别的.我不是 Java 程序员,有人建议我使用treeshake",一位朋友向我解释说,这会从 jar 文件中删除所有不必要的库.

I've written some basic Android applications in Scala, nothing too epic. Not being a Java programmer I was suggested to use a "treeshake", I was explained by a friend that this strips out all the unnecessary libraries from the jar files.

我没有记录下来,但我发现其他人已经有了:

I have not documented it, but I found that someone else already has:

http://chneukirchen.org/blog/archive/2009/04/programming-for-android-with-scala.html

Proguard 不是唯一的解决方案,您可能会找到适合您的工作流程或更适合您的环境的解决方案.

Proguard is not the only solution, you might find something that suits your work flow or is more suited for your environment.

此外,谷歌刚刚实现了 JACK ,它处理了大量减少构建和内存时间的问题,参见 https://source.android.com/source/jack.html

Additionally google have just realised JACK , which deals with quite a lot of reducing build and memory times see https://source.android.com/source/jack.html

这篇关于Android Scala 编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆