Liwid is an Android Library designed to simplify the integration of dynamic and customisable widgets on the lock screen. It uses sophisticated notification integration, placing widgets as notifications on the lock screen. This approach grants users immediate access to the dynamic content from their lock screen, transforming their experience
-
Dynamic and Customisable Widgets: Effortlessly integrate customisable and dynamic widgets, enhancing your Android applications.
-
Error Handling: handle errors and exceptions gracefully.
-
Custom UI: Easily customize the look and feel of the widget as per your app requirements.
-
Support to more types of widgets: Currently, it supports tracking and sports type widgets, and can be extended to add more widgets in the future.
Add the following to your project level root build.gradle
:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add the dependency:
dependencies {
implementation 'com.github.GDGVIT:Liwid:1.0.0'
}
User permissions required:
<manifest>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
.
.
</manifest>
fun createCustomChannel(context: Context, activity: Activity) {
val liveWidget = LiveWidget(context = context, activity = activity, widgetType = LiveWidget.WidgetType.SPORTS)
// Configure channel settings
liveWidget.configureChannel(
id = "Custom_Channel_Id",
name = "Custom Channel Name",
description = "Custom Channel Description"
)
}
fun startSportsWidgetService(context: Any) {
LiveSportsWidget.create(
context = context,
activity = context as Activity,
baseUrl = BASE_URL,
endpoint = GAME_TYPE,
params = mapOf(
"met" to MATCH_TYPE,
"APIkey" to API_KEY,
"leagueID" to league_id,
)
)
}
GlobalScope.launch {
LiveSportsWidget.stopSportsWidget()
}
Dev Keshwani |
Made with ❤ by GDSC-VIT