Greetings and welcome to my RU-vid channel, my name is Stefan Jovanovic. I’m an Android Developer, Designer and Technology enthusiast. Love working on a new and exciting projects, sharing my knowledge with others, and always willing to learn more. I believe that permanent education is the key to success.
For sponsorships & collaborations: stefan.jovanavich@gmail.com
I am struggling with how to avoid opening and closing the database multiple times, because I read that best practise is to open it once when starting the app and to close it once when closing the app. I also read that is recommended to have the dbhelper as a singleton. I have several viewmodels that access the database through the database helper and I'm finding it difficult to put all of this together... how do I open it once if I need both a writable and readable db? Also, the context that is passed, is it the activity or fragment? I have one activity and several fragments which in turn have their own view models. Currently all viewmodels create a new dB helper and each method in the dBhelper class opens and closes the dB. I'm real,y struggling with architecture... Anybody got any tips?
Now google doesn't allow to use permission SEND_SMS in the manifest and will reject the app submission bcoz they said it doesn't match the core functionality of the app. Does anybody know how to solve this problem ?
Hi bro, I couldn't find the exported file even though it's success. Any idea what's wrong with this? BUILD SUCCESSFUL in 1s 1 actionable task: 1 executed Export finished successfully
Great explanation. I have static list of icons from drawable and i need to show them in recycler view but, recycler view lags on first load. Is there any workaround?
trying to follow the tutorial, but whenever I try to run the project generated through the wizard I get this exception: Exception in thread "main" java.lang.NoClassDefFoundError: androidx/collection/ScatterMapKt can somebody help?
@@StevdzaSan You can do so many things in one line of code in Kotlin, but... If you read such code, you must do a lot of effort to understand a sense of this oneliner. I think in this matter Java is more readable although you often must write more lines of code.
@letmebe_pro I don't think that Kotlin is less readable. However, you do need to learn its syntax to properly understand it. But once you do, it's a whole different story 🚀
Hey @Stevdza-San, I have migrated my project to Kotlin 2.0, how I can use the BackingFields now, when I'm trying to use it, I got this error: Explicit backing field declarations are not supported in FE 1.0
I'm getting "Explicit backing fields are not supported in FE 1.0" when I try the live data example you gave? Here's what Gemni says: In Kotlin 2.0.0, backing fields are not supported in the frontend (FE) 1.0. This means that you cannot access or modify the backing field of a property directly. There are a few reasons for this change. First, backing fields are not necessary in Kotlin. The compiler automatically generates getters and setters for properties, so you don't need to worry about creating them yourself. Second, backing fields can be a source of bugs. If you accidentally modify the backing field directly, you can easily break your code.
Nobody forces you to use them, or even to upgrade to 2.0. Besides, a lot of these changes actually simplify things (such as more intuitive smart casting).
What happens when I reduce the size of the list that has already been rendered. for example fist its size is 3 and then it reduces to 1. I am getting crash of IndexOutOfBound.
this is the actual function i created to change app language actual fun changeAppLanguage(language: String) { AppCompatDelegate.setApplicationLocales( LocaleListCompat.forLanguageTags(language) ) } For android 14 it is working fine in compose multiplatform if i change app language from inside app its working and if i close the app and reopen then also previous set language is coming. But for android 12 and below it i click on language change btn then app language is not changing. i have to go some other screen and come back to reflect the language change. and if i close app and reopen then delfault language is setting previous selected language is not setting
Wow these are great additions! I've never encountered the type issues fixed however. I didn't really get the extensible data arguments tho, I'll have to look into it more. It makes me wonder if it means passing an object as argument instead of having real function arguments, therefore what would be the performance drawbacks (GC pressure)
It should have been rather easy to implement it as a zero cost abstraction (similar to value classes or inline functions). The best way to find out - other than by looking up the docs - is decompiling the bytecode to Java to see how it's resolved under the hood... (I like doing it that way because it's more instructive)
@@vibovitold good point, I hope so too. In a way it is almost odd that this new concept is a "class" but I guess it avoids introducing a completely new thing in the language and its tooling.