Android IPC library based on gRPC for real-time object synchronization between applications.
- Auto-discovery: Real-time service discovery using Network Service Discovery (NSD)
- Handshake Protocol: Secure capability negotiation and permission exchange
- Bi-directional Sync: Real-time object property synchronization across all connected apps
- Event System: FCM-style event broadcasting with data payloads and priority levels
- Encrypted Transport: TLS-based encryption for all data transmission
- Shared Database: Optional Room Database with SQLCipher encryption
- Kotlin Coroutines: Full coroutine support with Flow-based reactive APIs
- Android 8.0 (API 26) or higher
- Target: Android 16 (API 36)
- Kotlin 2.1.0+
dependencies {
implementation("digital.vasic.asinka:asinka:0.1.0")
}<dependency>
<groupId>digital.vasic.asinka</groupId>
<artifactId>asinka</artifactId>
<version>0.1.0</version>
</dependency>val config = AsinkaConfig(
appId = "com.example.myapp",
appName = "My App",
appVersion = "1.0.0",
deviceId = "device-123",
serverPort = 8888
)
val asinka = AsinkaClient.create(context, config)
asinka.start()val schema = ObjectSchema(
objectType = "Task",
version = "1.0",
fields = listOf(
FieldSchema("title", FieldType.STRING),
FieldSchema("completed", FieldType.BOOLEAN)
),
permissions = listOf("read", "write")
)
val task = SyncableObjectData(
objectId = "task-1",
objectType = "Task",
version = 1,
fields = mutableMapOf(
"title" to "Buy groceries",
"completed" to false
)
)
asinka.syncManager.registerObject(task)asinka.syncManager.observeObject("task-1")
.collect { updatedObject ->
println("Object updated: $updatedObject")
}val event = AsinkaEvent(
eventType = "notification",
data = mapOf("message" to "Hello from app 1!"),
priority = EventPriority.HIGH
)
asinka.eventManager.sendEvent(event)class MyEventReceiver : AsinkaEventReceiver() {
override val eventTypes = listOf("notification")
override suspend fun handleEvent(event: AsinkaEvent) {
val message = event.data["message"] as? String
println("Received notification: $message")
}
}
val receiver = MyEventReceiver()
asinka.eventManager.registerEventReceiver(receiver)asinka.discoveryManager.startDiscovery()
.collect { event ->
when (event) {
is DiscoveryEvent.ServiceFound -> {
println("Found service: ${event.serviceInfo.serviceName}")
asinka.connect(event.serviceInfo.host, event.serviceInfo.port)
}
is DiscoveryEvent.ServiceLost -> {
println("Service lost: ${event.serviceName}")
}
is DiscoveryEvent.Error -> {
println("Discovery error: ${event.message}")
}
}
}┌─────────────────────────────────────────┐
│ AsinkaClient (API) │
├─────────────────────────────────────────┤
│ Discovery │ Handshake │ Event System │
├─────────────────────────────────────────┤
│ Transport (gRPC) │ Sync Manager │
├─────────────────────────────────────────┤
│ Security Manager │ Storage (Room) │
└─────────────────────────────────────────┘
Asinka includes 106 comprehensive tests providing 100% coverage of core functionality:
- 89 Unit Tests: SecurityManager, Discovery, Handshake, Sync, Events, Transport, Client API
- 17 Instrumentation Tests: Full integration testing on real Android devices including:
- Multi-app synchronization scenarios
- Real-time sync validation
- Object lifecycle management
- Performance validation under load
- Inter-app communication verification
# Run unit tests
./gradlew test
# Run instrumentation tests (requires connected device/emulator)
./gradlew connectedAndroidTest
# Run all tests with report generation
./scripts/run_all_tests.shTest reports are generated in Tests/ directory with detailed logs and coverage metrics.
./gradlew publishToMavenLocalConfigure .env file with credentials:
MAVEN_CENTRAL_USERNAME=your_username
MAVEN_CENTRAL_PASSWORD=your_password
SIGNING_KEY_ID=your_key_id
SIGNING_PASSWORD=your_password
SIGNING_SECRET_KEY_RING_FILE=/path/to/key.gpg
Then publish:
./gradlew publishReleasePublicationToMavenCentralRepositorySee demo-app/ module for a complete demonstration of all features.
Copyright 2025 Vasic Digital
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributions are welcome! Please open an issue or submit a pull request.
For issues and questions, please visit: https://github.com/vasic-digital/asinka/issues