Docs
Use Cases
Producer Guide
SDK
Search…
v24
Introduction
Use Cases
When to choose Monterosa / Interaction Cloud™
Platform Components
Core Concepts
Experiences
User Management
Interaction SDK
TV & Big Screen Graphics
Scaling Capacity
FAQs
Creator User Guide
Getting Started
Studio Guide
Image or File Fields & Hosting
Localisation
Project Assets
Data Capture
Voting Certification
Curation
Twitter #Voting
User Roles
DEVELOPER GUIDES
What is an App?
Available APIs & Libraries
Creating an App in JavaScript
App Specs
TV & Big Screen Graphics
Working with Gamify
Browser Support
Advanced Topics
JavaScript lib
JavaScript Lib Overview
LViS
Listings
Event
Elements
Data Element
Regular Poll Element
Flexible Poll Element
Swing Poll Element
Emoting Poll Element
Prediction Element
Trivia Element
Powerbar Element
Curation Element
Connection Manager
Project
Date
Run
User
Storage
Sync
Migration Guide
Changelog
Android lib
Android Lib Overview
LViS
Project
Event
Elements Common API
Regular Poll Element
Swing Poll Element
Emoting Poll Element
Combi Poll Element
Powerbar Element
Trivia Element
Prediction Element
Data Element
Changelog
iOS lib
iOS Lib Overview
LViS
Project
Event
Elements Common API
Regular Poll Element
Swing Poll Element
Diametric Element
Emoting Poll Element
Combi Poll Element
Powerbar Element
Quiz Element
Trivia Element
Prediction Element
Data Element
Changelog
CONTROL API V2
Control API v2 Overview
Element Resource
Organisations
Brands
Apps
App Setup
Projects
Events
Event Templates
Elements
Objects definitions
PUBLIC FEEDS
Public Feeds
Listings
Elements
Event History
Demographics
LIMITS
Content
Vote Elements
Social Voting
Leaderboard
Extensions
Overview
Instance handshake
Project handshake
Project delete
Tabs
Event Tabs
Listings notification
Elements notification
Analytics
Assets
Event-level feed
Webhooks
COMPLIANCE
Data Requests
RELEASE NOTES
v23.0
V23.1
V23.2
Migration Guide
Powered By
GitBook
Android Lib Overview
Monterosa / Interaction Cloud (M/IC) was previously known as LViS. As such, you will find API documentation using the term.
The Android lib allows Android developers to connect natively to the platform.
Add to project
Add to the
/build.gradle
1
allprojects
{
2
repositories
{
3
maven
{
4
url
"s3://fankit.android.s3.amazonaws.com"
5
credentials
(
AwsCredentials
)
{
6
accessKey
"AKIAILV2UEEPQRSY726A"
7
secretKey
"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"
8
}
9
}
10
}
11
}
Copied!
Add to the
app/build.gradle
. Please see changelog for latest LViS versions.
1
implementation
'co.monterosa.fankit:lvis:23.0.1'
Copied!
Add Proguard rules:
https://gitlab.monterosa.co.uk/mobile/enmasse_android/blob/master/proguard-rules.pro
_[_
https://gitlab.monterosa.co.uk/mobile/lvis_android/blob/master/proguard-rules.pro
](
https://gitlab.monterosa.co.uk/mobile/lvis_android/blob/master/proguard-rules.pro
)
Dependencies
The LViS library internally depends on Enmasse library and its dependencies and all of them are fetched automatically when you add LViS library to client project.
Groovy
1
implementation 'co.monterosa.fankit:enmasse:23.0.0'
Copied!
LViS library structure
There are 4 basic blocks that you need to work with:
LViS
- is an entry point to work with LViS lib
Project
- is an entity that represents an 'LViS Project'
Event
- is an entity that represents an 'LViS Event'
Elements
- are entities that represent 'LViS Elements'
How to use
You can override default TRUE values if needed.
1
void
setWssSupport
(
boolean
useWss
);
2
void
setReloadEventsHistorySupport
(
boolean
reload
);
Copied!
LViS needs to store its values internally. So you need to set a path to your internal or external storage:
1
void
setCacheDir
(
String
cacheDirPath
);
Copied!
LViS needs to be initialized with
projectUuid
and
host
1
void
setProject
(
String
host
,
String
projectUuid
);
Copied!
It's possible to load App Setup before connecting to LViS
1
void
loadSettings
(
new
ResultCallback
()
{
2
@Override
3
public
void
onSuccess
(
Object
result
)
{
4
}
5
@Override
6
public
void
onFailed
(
String
reason
)
{
7
}
8
});
Copied!
To open LViS and subscribe to its changes:
1
void
open
(
new
LViSObserver
()
{
2
@Override
3
public
void
onInit
(
boolean
reinit
)
{
4
Project
project
=
LViS
.
getInstance
().
getProject
();
5
}
6
@Override
7
public
void
onScheduleReinit
(
long
backoffMillis
)
{
8
}
9
@Override
10
public
void
onEventPublished
(
Event
event
)
{
11
}
12
@Override
13
public
void
onSettingsChanged
()
{
14
}
15
});
Copied!
To subscribe to an event:
1
void
subscribe
(
event
,
new
ResultCallback
()
{
2
@Override
3
public
void
onSuccess
(){}
4
@Override
5
public
void
onFailed
(
String
reason
)
{}});
Copied!
After you've subscribed to an event you can get all event elements:
1
List
<
Element
>
allElements
=
event
.
getHistory
();
Copied!
And you can listen to an event's changes:
1
event
.
registerCallback
(
new
Event
.
Callback
()
{
2
@Override
3
public
void
onUpdated
()
{
4
}
5
@Override
6
public
void
onStateChanged
(
Event
.
State
state
)
{
7
}
8
@Override
9
public
void
onElementPublished
(
Element
element
)
{
10
}
11
@Override
12
public
void
onElementRevoked
(
Element
element
)
{
13
}
14
});
Copied!
You can listen to each element's changes. For example, to listen to a Regular poll's changes:
1
if
(
element
instanceof
RegularPoll
){
2
RegularPoll
regularPoll
=
(
RegularPoll
)
element
;
3
regularPoll
.
registerCallback
(
new
RegularPoll
.
Callback
()
{
4
@Override
5
public
void
onStateChanged
(
RegularPoll
.
State
state
)
{
6
}
7
@Override
8
public
void
onResults
()
{
9
}
10
@Override
11
public
void
onVote
()
{
12
}
13
});
14
}
Copied!
To unsubscribe from an event:
1
void
unsubscribe
(
event
);
Copied!
To log in with your userId and signature
1
User
.
login
(
String
userId
,
long
timestamp
,
String
signature
,
ResultCallback
resultCallback
)
Copied!
After you've done with LViS you need to close it to clean all resources:
1
void
close
()
Copied!
If you need to manage logs:
1
Log
.
enableTags
(
String
[]
tags
)
//Supported tags are {LViS.TAG, Enmasse.TAG, TransportApi.TAG}
2
Log
.
registerCallback
(
Callback
callback
)
Copied!
Changelog
https://gitlab.monterosa.co.uk/mobile/lvis_android/tags
JavaScript lib - Previous
Changelog
Next - Android lib
LViS
Last modified
1yr ago
Copy link
Contents
Add to project
Dependencies
LViS library structure
How to use
Changelog