adle needs to include the icerock plugin -resources and an extension function multiplatformResources that will generate the resources classes.create a separate module for resources:.The library from icerock devs provides access to resources on different platforms with the support of the default system localization. Multiplatform resourcesįor my KMM projects, I use moko-resources. Same on the Android side, the common module for a ui-only module will not be needed. Having the resources independently, the iOS view class will import only this. You can share common code between iOS and Android apps and write platform-specific code only where it’s necessary. In the KMM project, the additional benefit can be seen while importing the module. From its official web: Kotlin Multiplatform Mobile (KMM) is an SDK designed to simplify the development of cross-platform mobile applications. The composables do not need to know about any business class. Now when compose is becoming a standard we can create UI-only modules with compose dependencies and app resources. Whenever your modules are features or layers based, the resources like localized texts or icons can be used anywhere in the app UI and reused in many modules. Why make a separate module for resources? If you would like to learn more, check out this video from Google I/O’19. Some say it also decreases the build time, but this is not a part of this article. In Android development, modularization of the application is a very common pattern that helps organize the code, increase the readability and make sharing between projects more straightforward.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |