- Saved searches
- Use saved searches to filter your results more quickly
- amanjeetsingh150/kotlin-android-examples
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Create your first cross-platform app
- Create the project from a template
- Examine the project structure
- Run your application
- Run your application on Android
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
💪 [Examples] Isolated applications purely on Kotlin, for all android devs out there
amanjeetsingh150/kotlin-android-examples
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
This repository contains all the example apps demonstrating features/integrations of different libraries/functionality in your android apps purely developed on Kotlin.
Show some ❤️ and star the repo to support the project
- Create a folder kotlin-android-examples
- Next download and add the dependencies.gradle to this kotlin-android-examples folder
- Now move the example app folder inside the kotlin-android-examples folder
- ActivityLifecycle
- ApolloGraphQLExample
- AutoCompleteTextViewWithRx
- BottomSheets
- BroadcastReceiver
- CircularReveals
- ContentProviders
- CoroutineAdapters
- CustomView
- DataBinding
- DiffUtil
- EmojiCompat
- FormsWithRx
- GraphQL
- IntentService
- JacksonKotlinModule
- Kodein
- Koin
- KotlinCoroutines
- KotlinTest
- MoshiExample
- MVPSample
- MVVMSample
- ObjectAnimator
- RealmDB
- RecyclerView
- RuntimePermissions
- SharedElementTransition
- SpekExample
- SqlBrite
- TimberExample
- UsingDagger2
- UsingFirebaseJobDispatcher
- UsingRetrofit
- UsingRoom
- UsingSpringAnimation
- UsingSugar
- ValueAnimator
- ViewModelAndroidArch
- ViewPager
- BottomNavigationView
- HandlerThread
- MobileVisionBarCode
- FingerprintAPI
- WidgetExample
- JniSample
- AnimatedVectorDrawble
- ListAdapter
- Paging Library
- Motion Layout
I encourage all the developers out there to contribute to the repository and help me to expand it. To contribute just think up of an example which could be a feature or some demo to how to use a library. Develop the demo and create a pull request and you are in.
If you found this code demo helpful or you learned something today and want to thank me, consider buying me a cup of ☕ at PayPal
I made this repository after inspiration from this wonderful work by nisrulz. You can find his repo on following link:
About
💪 [Examples] Isolated applications purely on Kotlin, for all android devs out there
Create your first cross-platform app
Here you will learn how to create and run your first Kotlin Multiplatform application using Android Studio.
Create the project from a template
You can also watch the video version of this tutorial created by Ekaterina Petrova, Kotlin Product Marketing Manager.
- In Android Studio, select File | New | New Project.
- Select Kotlin Multiplatform App in the list of project templates, and click Next.
- Specify a name for your first application, and click Next.
- In the iOS framework distribution list, select the Regular framework option.
We recommend using the regular framework for your first project, as this option doesn’t require third-party tools and has fewer installation issues. For more complex projects, you might need the CocoaPods dependency manager that helps handle library dependencies. To learn more about CocoaPods and how to set up an environment for them, see CocoaPods overview and setup.
- Keep the default names for the application and shared folders. Click Finish.
The project will be set up automatically. It may take some time to download and set up the required components when you do this for the first time.
Examine the project structure
To view the full structure of your mobile multiplatform project, switch the view from Android to Project.
Each Kotlin Multiplatform project includes three modules:
- shared is a Kotlin module that contains the logic common for both Android and iOS applications – the code you share between platforms. It uses Gradle as the build system that helps you automate your build process. The shared module builds into an Android library and an iOS framework.
- androidApp is a Kotlin module that builds into an Android application. It uses Gradle as the build system. The androidApp module depends on and uses the shared module as a regular Android library.
- iosApp is an Xcode project that builds into an iOS application. It depends on and uses the shared module as an iOS framework. The shared module can be used as a regular framework or as a CocoaPods dependency, based on what you’ve chosen in the previous step in iOS framework distribution. In this tutorial, it’s a regular framework dependency.
The shared module consists of three source sets: androidMain , commonMain , and iosMain . Source set is a Gradle concept for a number of files logically grouped together where each group has its own dependencies. In Kotlin Multiplatform, different source sets in a shared module can target different platforms.
This is an example structure of a Multiplatform Mobile project that you create with the project wizard in IntelliJ IDEA or Android Studio. Real-life projects can have more complex structures.
Run your application
You can run your multiplatform application on Android or iOS.
Run your application on Android
- Create an Android virtual device.
- In the list of run configurations, select androidApp.
- Choose your Android virtual device and click Run.