Installation

Sung-Ho Lee edited this page Mar 9, 2016 · 45 revisions

Quick start

Starting a new project

Fork one of this to start a new project:

Adopting Scaloid for your existing project

Before start using Scaloid, check your project is properly configured with Scala language. After it is done, you can add Scaloid as follows:

  1. Add Scaloid dependency to your project
  2. Declare import org.scaloid.common._ in your code.
  3. Modify the signature of your classes
  • If your class inherits Activity, change it to SActivity
  • If your class inherits Service, change it to SService
  • If your class (indirectly) inherits Context, add trait SContext with LoggerTag
  • Otherwise, setting an implicit value is required
    implicit val ctx: Context = ...

Then, you are ready to use Scaloid.

Troubleshooting

java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536

Proguard is not properly setup. Please refer a configuration file from official template project for sbt and maven.

Add Scaloid dependency to your project

Scaloid is released to the central maven repository.

For maven:

<dependency>
    <groupId>org.scaloid</groupId>
    <artifactId>scaloid_2.11</artifactId>
    <version>4.2</version>
</dependency>

For sbt:

libraryDependencies += "org.scaloid" %% "scaloid" % "4.2"

For Android Studio using gradle:

Add this line to your build.gradle file:

compile 'org.scaloid:scaloid_2.11:4.2+'
Version number

Scaloid distribution is compiled with Android API Level 16, still retaining compatibility with Level 10. Accessor methods and deprecation warning is based on API Level 16, so you have to carefully check the availability of API if you target lower version of Android.

To compile with Scaloid, you have to specify build time Android API in project.properties file as android-16 or higher.


* See also: Building Scaloid