Just published my first Kotlin Multiplatform Libra...
# feed
s
Just published my first Kotlin Multiplatform Library - KDeviceInfo 📱 KDeviceInfo allows developers to access device information such OS, SDK_INT, Model, isPhysicalDevice and much more data for android and ios platform without writing expect actual mechanism boilerplate code in project. Also it helps to makes the development faster. Do check it out.
👍 7
K 9
👍🏻 1
s
Do you plan to expand this to all platforms? Now it’s just iOS & Android, but at least some of the fields will be available everywhere.
a
Cool. I make it with expect/actual on many projects. +1 for more platforms support
s
Yes, for Ashampoo Photos I have expect/actuals for things like processor count, memory, etc. So I know these information is available and I would drop this code for a library that does all of that.
Also I would reconsider this „isAndroid“.. I prefer having a Platform enum
a
It seems like compose only. Any chance to make it compose-free?
3
s
There should be no need to have a compose dependency on it.
a
There are many methods on how to provide context to android library, for example https://muditsen.medium.com/how-to-get-application-context-in-your-library-without-any-initialise-method-42ba97eafea3
🙌 1
❤️ 1
👍 1
s
Sure will check it out 👍
s
s
Sure @Shreyash Kore, will take a look
Hey I have released new version 0.0.3 to allow to access device info out side the composable function, Check it out : https://github.com/swapnil-musale/KDeviceInfo?tab=readme-ov-file#usage
🎉 1
a
@Swapnil Musale, I opened an issue with the device model on physical iPhone devices https://github.com/swapnil-musale/KDeviceInfo/issues/66
👍 1