Bixby Developer Center

Guides

Library Capsules

This section describes how to use Bixby's library capsules, which let your capsules work with complex concepts such as dates, times, and geography.

Using Capsules

To use a library capsule, it must be imported. In your capsule.bxb file, include an import statement in the capsule-imports block:

capsule {
capsule-imports {
import (viv.time) {
as (time) version (2.58.56)
}
}
}

This import lets you refer to concepts and actions in the viv.time.* namespace simply with time.*.

Capsules import their own dependencies (for example, viv.contact relies on viv.geo, viv.time, and other library capsules); your capsule does not need to import these separately.

Library Capsule Versions

Last updated October 3, 2019

When importing library capsules, these are the current versions to specify:

Library CapsuleVersion
bixby.audioPlayer0.3.6
viv.common3.32.18
viv.contact2.5152.2
viv.entity3.20.5
viv.geo9.20.3
viv.image2.12.10
viv.location1.0.18
viv.measurement2.14.6
viv.money2.22.3
viv.navigation1.9.19
viv.openHours4.1.14
viv.rating3.2.10
viv.self3.5.141
viv.time2.92.45

Importing Capsule Versions

Instead of indicating a version for each imported capsule, once you import a library, you can use version-from to transitively import any of its dependencies. This is useful in order to keep versions aligned and prevent your capsule dependency chain from using two different versions of the same imported capsule.

Because of the transitive nature of version-from, you only have to point to a capsule that indirectly imports that capsule. Take, for example, the following diagram, that shows various capsule dependencies for each of the library capsules shown above:

Capsule Dependencies

In the example below, the capsule first specifies the version when importing viv.entity. It then uses the capsule to get capsule versions for other imported capsules, such as viv.common and viv.time.


capsule {
id (example.spaceResorts)
version (1.0.0)
format (3)
targets {
target (bixby-mobile-en-US)
target (bixby-mobile-ko-KR)
}
capsule-imports {
import (viv.core) {
as (core)
}
import (viv.entity) {
as (entity)
version (3.14.9)
}
import (viv.common) {
as (common)
version-from (entity)
}
import (viv.time) {
as (time)
version-from (entity)
}
import (viv.money) {
as (money)
version (2.18.9)
}
import (bixby.profile) {
as (profile)
version (1.0.0)
}
}
}

Capsules

These are some of the most commonly used library capsules along with links to further discussion.