AlpsSDK
is a contextualized publish/subscribe model which can be used to model any geolocated or proximity based mobile application. Save time and make development easier by using our SDK. We are built on Android Location services and we also provide iBeacons compatibility.
SDK is written using Kotlin 1.2.
AlpsSDK
requires Android 4.4+
Gradle
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
}
SDK
implementation 'com.github.matchmore.alps-android-sdk:sdk:<latest version>'
Rx Wrapper
implementation 'com.github.matchmore.alps-android-sdk:rx:<latest version>'
Maven
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
SDK
<dependency>
<groupId>com.github.matchmore.alps-android-sdk</groupId>
<artifactId>sdk</artifactId>
<version>latest version</version>
</dependency>
Rx Wrapper
<dependency>
<groupId>com.github.matchmore.alps-android-sdk</groupId>
<artifactId>rx</artifactId>
<version>latest version</version>
</dependency>
The Matchmore
is a static wrapper that provides you all the functions you need to use our SDK.
Setup application API key, get it for free from http://matchmore.io/.
override fun onCreate() {
super.onCreate()
Matchmore.config(context = this, apiKey = SdkConfigTest.API_KEY, debugLog = false)
}
}
Create first device, publication and subscription. Please note that we're not caring about errors right now.
Matchmore.instance.apply {
startUsingMainDevice({ device ->
Log.i(TAG, "start using device ${device.name}")
// Create publication
val publication = Publication("Test Topic", 1.0, 0.0)
publication.properties = hashMapOf("test" to "true")
createPublicationForMainDevice(publication, { result ->
Log.i(TAG, "Publication created ${result.topic}")
}, Throwable::printStackTrace)
// Create subscription
val subscription = Subscription("Test Topic", 1.0, 0.0)
subscription.selector = "test = 'true'"
createSubscriptionForMainDevice(subscription, { result ->
Log.i(TAG, "Subscription created ${result.topic}")
}, Throwable::printStackTrace)
// Start getting matches
matchMonitor.addOnMatchListener { matches, _ ->
Log.i(TAG, "Matches found: ${matches.size}")
}
matchMonitor.startPollingMatches()
}, Throwable::printStackTrace)
}
in alps-android-sdk/example/
you will find working simple example.
See the http://matchmore.io/documentation/api or consult our website for further information http://matchmore.io/
- @kubatatami, kubatatami@gmail.com
- @maciejburda, maciej.burda@matchmore.com
AlpsSDK
is available under the MIT license. See the LICENSE file for more info.