Friday, May 9, 2025
Alternative Way
  • Home
  • Latest
    • Latest
  • News
  • World Tech
  • World Gaming
  • Minecraft
  • Guides
  • Contact Us
  • About The Team
    • Privacy Policy
    • Terms of Use
No Result
View All Result
  • Home
  • Latest
    • Latest
  • News
  • World Tech
  • World Gaming
  • Minecraft
  • Guides
  • Contact Us
  • About The Team
    • Privacy Policy
    • Terms of Use
No Result
View All Result
Alternative Way
No Result
View All Result

Kotlin SDK for Jellyfin supporting Android and the JVM

Gordon James by Gordon James
October 3, 2021
in World Tech Code
0 0
0
Home World Tech Code

Jellyfin is a next-generation Java ME platform that can be run on Android and other devices. With Jellyfin, you can speed up your Java ME application development, provide a fast and stable platform for your application development, and save the development cost. In addition, Jellyfin can run on all Android devices, including Android TV, Android Handets, Android Tablets, and more.

This is a brief overview of the current state of Kotlin support in Jellyfin, the Android SDK for JavaScript. Jellyfin supports Android and the JVM, and currently supports the Kotlin language. Please check out the resources section for links to the documentation, API reference and blog posts.

Table of Contents

Toggle
  • Jellyfin Kotlin SDK
  • Setting
  • Use
    • Create a jellyfin instance
    • Create API instance
    • User Authentication
    • WebSockets
    • Server opening
  • Other examples
  • GitHub
      • Related Tags:

Jellyfin Kotlin SDK

The Jellyfin Kotlin SDK is a library that implements the Jellyfin API for easy access to servers. It is currently available for the JVM and Android 4.4 and above. Java 8 or higher required. In Android versions lower than Android 8, you need to use the de-oiling libraries.

Setting

The versions are published on mavenCentral(). Make sure you are using the correct library for the platform. Kotlin SDK for Jellyfin supporting Android and the JVM Gradle with Kotlin DSL implementation(org.jellyfin.sdk:jellyfin-core:$sdkVersion) // Or when using the Android implementation (org.jellyfin.sdk:jellyfin-platform-android:$sdkVersion) Gradle with Groovy implementation org.jellyfin.sdk:jellyfin-core:$sdkVersion // Or if you are using the Android implementation org.jellyfin.sdk:jellyfin-platform-android:$sdkVersion Maven org.jellyfin.sdk jellyfin-core $sdkVersion org.jellyfin.sdk jellyfin-platform-android $sdkVersion Using SNAPSHOT versions If you’re working on new features in your application, you may need to create an SDK targeting the next server version. For this use case, we publish two SNAPSHOT versions: master-SNAPSHOT and openapi-unstable-SNAPSHOT. To use the snapshot versions of , add a snapshot store to your build script: https://s01.oss.sonatype.org/content/repositories/snapshots/ An example of using Gradle with the Kotlin DSL which only allows the SNAPSHOT master version: Repositories { maven(https://s01.oss.sonatype.org/content/repositories/snapshots/) { content { // Allow only SDK snapshots includeVersionByRegex(org.jellyfin.sdk, .*, master-SNAPSHOT) } } }

Use

Create a jellyfin instance

Most SDK functions require an instance of the Jellyfin class. This class contains the configurations needed to create platform-specific API calls and options. The Jellyfin class can be instantiated with its own Kotlin DSL: val jellyfin = Jellyfin { clientInfo = ClientInfo(name = My awesome client!, version = 1.33.7,) // Do not comment if you are not using jellyfin-platform-android : // deviceInfo = DeviceInfo(id = UUID.randomUUID().toString(), name = Awesome device,) // Do not comment when using jellyfin-platform-android : // android() } Be sure to provide client and device information when making API calls. Use the android() helper function when working with Android to enable server discovery and automatically set device information.

Create API instance

API calls require an API instance. This can be done with the createApi function. This requires a server address of . Customer and device information is set automatically, but can be changed. All properties can be changed later in the API instance. val api = jellyfin.createApi( baseUrl = https://demo.jellyfin.org/stable/, // optional options : // accessToken = access token or api key // clientInfo = ClientInfo(), // default to parent information // deviceInfo = DeviceInfo(), // default to parent information // httpClientOptions = HttpClientOptions() // allow additional options )

User Authentication

All API operations are grouped together. To use this operation, you must create an instance of group and pass your API instance to it. val userApi = UserApi(api) try { trap authenticationResult by userApi.authenticateUserByName( username = demo, password = , ) // Use the access token in the Api instance api.accessToken = authenticationResult.accessToken // display session information println(authenticationResult.sessionInfo) } catch(err : ApiClientException) { // catch exceptions println(Something went wrong ! ${err.message}) }

WebSockets

Jellyfin uses WebSockets to communicate events such as library changes and actions. This API can be used with a special WebSocketApi class. val webSocketApi = WebSocketApi(api) // publish messages webSocketApi.publish(ActivityLogEntryStartMessage() webSocketApi.publish(SessionsStartMessage()) webSocketApi.publish(ScheduledTasksInfoStartMessage()) // Waiting for messages webSocketApi.subscribe().collect { message -> println(message) }

Server opening

The server search function allows you to search for servers on the local network, normalize the entered server addresses, and determine the best server from the list of addresses. // Discover local network servers jellyfin.discovery.discoverLocalServers().collect { println(Server ${it.name} was found at address ${it.address}) } // Get all candidates for a given item val candidates = jellyfin.discovery.getAddressCandidates(demo.jellyfin.org/stable) // Get the stream of potential servers to connect to val recommended = jellyfin.discovery.getRecommendedServers(candidates, RecommendedServerInfoScore.GOOD)

Other examples

We offer several small projects in a sample folder. The samples are used to test the new possibilities of the and can be used as a basis for your own application.

GitHub

https://github.com/jellyfin/jellyfin-sdk-kotlin

Related Tags:

jellyfin-android githubjellyfin githubjellyfin rest apijellyfin android tvjellyfin-vueemby api,People also search for,Privacy settings,How Search works,jellyfin-android github,jellyfin github,jellyfin rest api,jellyfin android tv,jellyfin-vue,emby api,jellyfin mobile download,jellyfin repositories

Total
0
Shares
Share 0
Tweet 0
Pin it 0
Share 0
ShareTweet
Gordon James

Gordon James

Next Post

A Quick Guide On How To Use Pivot Table In Google Sheets

  • Trending
  • Comments
  • Latest
How To Get Free Internet On Android Without Service

How To Get Free Internet On Android Without Service

March 10, 2022
🥇 +4 Neo Geo Emulators for Android  List ▷ 2021

🥇 +4 Neo Geo Emulators for Android  List ▷ 2021

October 3, 2021

Fix: Notifications not working on Nova Launcher

October 3, 2021
How to Fix OpenVPN Connected but Not Changing IP Address

How to Fix OpenVPN Connected but Not Changing IP Address

October 3, 2021

Setting Up Directory Sync Between On-Premises Active Directory with Microsoft 365 Azure AD

0
🥇 DELETE ACCOUNT from PS4  ▷ Step by Step Guide ▷ 2020

🥇 DELETE ACCOUNT from PS4  ▷ Step by Step Guide ▷ 2020

0
🥇 PPTX File Extension  What is .Pptx and how to open them? ▷ 2020

🥇 PPTX File Extension  What is .Pptx and how to open them? ▷ 2020

0
🥇 Make a Crossword in Microsoft Word  Step by Step Guide ▷ 2020

🥇 Make a Crossword in Microsoft Word  Step by Step Guide ▷ 2020

0
What to Know About Car Shipping Services

What to Know About Car Shipping Services

May 7, 2025
CS2 Skins-Why Trade Them?

CS2 Skins-Why Trade Them?

May 7, 2025
Alternative Routes: Successfully Exiting Your Wyndham Timeshare Without The Stress

Alternative Routes: Successfully Exiting Your Wyndham Timeshare Without The Stress

May 6, 2025
The Ultimate Seiko Watch Gift Guide

The Ultimate Seiko Watch Gift Guide

May 1, 2025

There's always an alternative Way!
Find us at 4145 Zolynthian Street, Vylorthos, QP 78425
No Result
View All Result
  • Home
  • Latest
    • Latest
  • News
  • World Tech
  • World Gaming
  • Minecraft
  • Guides
  • Contact Us
  • About The Team
    • Privacy Policy
    • Terms of Use

© 2022 - Alternative Way

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT
No Result
View All Result
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
  • Travel News

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.