-
Notifications
You must be signed in to change notification settings - Fork 163
Installation
For maven:
Fork Hello world of Scaloid project.
For sbt:
Fork Hello world of Scaloid for sbt
Before start using Scaloid, check your project is properly configured with Scala language.
- Import Scaloid to your project
- Declare
import org.scaloid.common._
in your code. - Modify the signature of your classes
- If your class inherits
Activity
, change it toSActivity
- If your class inherits
Service
, change it toSService
- If your class (indirectly) inherits
Context
, addtrait SContext with LoggerTag
- Otherwise, setting an implicit value is required
implicit val ctx: Context = ...
Then, you are ready to use Scaloid.
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 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