as an android developer in traning does it require different code for IOS and android in Kotlin how it is done? because flutter does not require.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our W3Make Forum to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Two Types of App Development
There are two types for app development one is native app development and another is cross platform. I have provided an image that shows the basic difference between these two if the image is not visible you can go to this website.
link: native and cross platform
image show difference between two development
Native app development
For complex apps
Separate apps for iOS and Android
When creating libraries is necessary
Two developers for both platforms Taking advantage of the latest trends
No features limitation
Tailor-made tools for each platform
Time-consuming solution
Cross-platform app development
For simple apps and MVPs
One codebase for iOS and Android
When creating libraries isn’t necessary
One developer can build the app
Latest trends are released after a while
Features have to be planned carefully
Universal tools for both platforms
Extremely time-saving solution
Answering to your question, Kotlin has announced as an official language by Google for Android development and it is the best language for building native app in android beside this java is also used for android app development, similarly Swift is known for building native app for IOS this because of different operating systems.
Android apps are built with Android SDK and has some platform specific APIs and libraries and iOS apps are built with iOS SDK which use Apple’s platform specific APIs and framework.
React native and Flutter does not require different code because it is cross platform it supports multiple mobile operating systems. In Flutter instead of writing different code for iOS and Android you can write single code Flutter use Dart programming language to achieve these.
Moreover flutter uses platform channels which allow developers to use platform specific APIs in simple words Flutter allow developers to communicate between their flutter code and native platform to access device-specific features and APIs, ensuring that their app can fully use the capabilities of each platform.
Does this mean we cannot use Kotlin for building iOS and Android app?
No, we can use use kotlin for multiplatform apps by using KMM(Kotling Multiplatform for Mobile)
To do this you need to do few things
”
and update the return statement in greet function as “return “Hello, ${platform.name.reversed()}!” +”\nThere are only ${dayUntillNewYear()} days untill the new year””
here we have created a function which counts the number of days left for the new year. we have declared two variable one is “today” to get date of today and the second is closest new year and assigned value as shown in code and when you run this code you get the number of days left for the new year for example if today is 20 June then it will display a string as “There are only 195 days until new year”
Conclusion
We can use Kotlin to develop app for both Android and iOS without writing different code for both platforms using KMM. Flutter offers a comprehensive cross-platform framework with a strong emphasis on UI and a vibrant ecosystem. On the other hand, KMM provides a way to share business logic and leverage platform-specific capabilities while integrating seamlessly with existing Kotlin and native projects.