This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Scala and Android 1.5

4 replies
michaelg
Joined: 2009-06-11,
User offline. Last seen 1 year 23 weeks ago.

I am working on an article on using Scala on Android. I had seen descriptions
of doing this on this list, as well as on the main Scala site:
http://www.scala-lang.org/node/160. I didn't think it would be too hard to
get the basic mechanisms working based on these results. I wanted to add
some more Scala-ish goodness, similar to how some of the Scala/Swing support
work (use closures for event handlers via implicits, for example.) However I
have had some issues. Android 1.5's ant build is not as easy to customize as
had been done in the past, as most of it is compiled Java now. So I tried to
use the Eclipse style build as in the note on the Scala site. That proved
non-trivial too. Some of the issues I encountered can be seen here:
http://groups.google.com/group/android-developers/browse_thread/thread/d....
So I'm hoping somebody on here can help me get this working.

Jesper Nordenberg
Joined: 2008-12-27,
User offline. Last seen 42 years 45 weeks ago.
Re: Scala and Android 1.5

michaelg wrote:
> So I tried to
> use the Eclipse style build as in the note on the Scala site. That proved
> non-trivial too. Some of the issues I encountered can be seen here:
> http://groups.google.com/group/android-developers/browse_thread/thread/d....
> So I'm hoping somebody on here can help me get this working.

To get the scala-library.jar file working I simply unpacked it, removed
the scala/testing directory, repacked it and added it as an external Jar
file in the Eclipse Android project. It works, but the build times are
quite long as the APK file must be rebuilt for each code change.

/Jesper Nordenberg

Walter Chang
Joined: 2008-08-21,
User offline. Last seen 3 years 26 weeks ago.
Re: Re: Scala and Android 1.5
use proguard.  there were some articles on the net detailing how to do this.

On Thu, Jun 11, 2009 at 3:06 PM, Jesper Nordenberg <megagurka@yahoo.com> wrote:
michaelg wrote:
So I tried to
use the Eclipse style build as in the note on the Scala site. That proved
non-trivial too. Some of the issues I encountered can be seen here:
http://groups.google.com/group/android-developers/browse_thread/thread/d81404181a393a14.
So I'm hoping somebody on here can help me get this working.

To get the scala-library.jar file working I simply unpacked it, removed the scala/testing directory, repacked it and added it as an external Jar file in the Eclipse Android project. It works, but the build times are quite long as the APK file must be rebuilt for each code change.

/Jesper Nordenberg




--
.......__o
.......\<,
....( )/ ( )...
michaelg
Joined: 2009-06-11,
User offline. Last seen 1 year 23 weeks ago.
Re: Re: Scala and Android 1.5
Thanks Jesper. Did you recompile scala-library.jar using the android-library to change ScalaObject and ScalaBeanInfo as well? 
-- Michael

On Thu, Jun 11, 2009 at 12:06 AM, Jesper Nordenberg <megagurka@yahoo.com> wrote:
michaelg wrote:
So I tried to
use the Eclipse style build as in the note on the Scala site. That proved
non-trivial too. Some of the issues I encountered can be seen here:
http://groups.google.com/group/android-developers/browse_thread/thread/d81404181a393a14.
So I'm hoping somebody on here can help me get this working.

To get the scala-library.jar file working I simply unpacked it, removed the scala/testing directory, repacked it and added it as an external Jar file in the Eclipse Android project. It works, but the build times are quite long as the APK file must be rebuilt for each code change.

/Jesper Nordenberg


michaelg
Joined: 2009-06-11,
User offline. Last seen 1 year 23 weeks ago.
Re: Re: Scala and Android 1.5
Removing the scala/testing directory seems to be key. I posted the jar I used here: http://scala-android.googlecode.com/files/android-library.jar. I am also going to add a few more utilities there as well. Thanks all for the help.
-- Michael

On Thu, Jun 11, 2009 at 9:41 AM, Michael Galpin <mike.sr@gmail.com> wrote:
Thanks Jesper. Did you recompile scala-library.jar using the android-library to change ScalaObject and ScalaBeanInfo as well? 
-- Michael

On Thu, Jun 11, 2009 at 12:06 AM, Jesper Nordenberg <megagurka@yahoo.com> wrote:
michaelg wrote:
So I tried to
use the Eclipse style build as in the note on the Scala site. That proved
non-trivial too. Some of the issues I encountered can be seen here:
http://groups.google.com/group/android-developers/browse_thread/thread/d81404181a393a14.
So I'm hoping somebody on here can help me get this working.

To get the scala-library.jar file working I simply unpacked it, removed the scala/testing directory, repacked it and added it as an external Jar file in the Eclipse Android project. It works, but the build times are quite long as the APK file must be rebuilt for each code change.

/Jesper Nordenberg



Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland