Skip to content
Sung-Ho Lee edited this page Jun 1, 2014 · 45 revisions

Quick start

Starting a new project

For maven:

Fork Hello world of Scaloid project.

For sbt:

Fork Hello world of Scaloid for sbt

Adopting Scaloid for your existing project

Before start using Scaloid, check your project is properly configured with Scala language.

  1. Import Scaloid 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.

Import Scaloid to your project

Scaloid is released to the central maven repository.

For maven:

<dependency>
    <groupId>org.scaloid</groupId>
    <artifactId>scaloid_2.11</artifactId>
    <version>3.4-10</version>
</dependency>

For sbt:

libraryDependencies += "org.scaloid" %% "scaloid" % "3.4-10"

For Android Studio using gradle:

Add this line to your build.gradle file:

compile 'org.scaloid:scaloid_2.11:3.3-8+'
Version number

Version number of Scaloid is consisted of two parts, separated by a - character. The first part is the version of Scaloid, the second is the level of Android API.

Please note that Android API provides backward compatibility. Therefore you can use a Scaloid artifact targeted to API level 10 for the Android application using the level 10 or above. In other side, Scala does not provide binary compatibility. The Scaloid artifact uploaded to the central repo is compiled with Scala 2.11. If you use other Scala versions, build the artifact as shown in the following subsection.


* See also: Building Scaloid