-
Notifications
You must be signed in to change notification settings - Fork 163
Installation
Fork one of this to start a new project:
- Hello world of Scaloid for sbt (recommended)
- Hello world of Scaloid for maven
- Hello world of Scaloid for gradle
Before start using Scaloid, check your project is properly configured with Scala language. After it is done, you can add Scaloid as follows:
- Add Scaloid dependency 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.
Proguard is not properly setup. Please refer a configuration file from official template project for sbt and maven.
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+'
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