Skip to content

Commit

Permalink
coinLoreAPI standalone for koin initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
iankang committed Mar 12, 2022
1 parent 0a9559d commit 7b226c1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
6 changes: 6 additions & 0 deletions app/coinLoreAPI/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.coinloreapi">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name=".CoinLore"
>

</application>
</manifest>
23 changes: 23 additions & 0 deletions app/coinLoreAPI/src/main/java/com/example/coinloreapi/CoinLore.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.example.coinloreapi

import android.app.Application
import com.example.coinloreapi.di.coinLoreModule
import com.example.coinloreapi.di.repositoryModule
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
import org.koin.core.logger.Level

class CoinLore:Application() {
override fun onCreate() {
super.onCreate()
startKoin{
androidLogger(Level.DEBUG)
androidContext(applicationContext)
modules(listOf(
coinLoreModule,
repositoryModule
))
}
}
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.cryptknow">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name=".CryptKnow"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand Down
7 changes: 1 addition & 6 deletions app/src/main/java/com/example/cryptknow/CryptKnow.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.example.cryptknow

import android.app.Application
import com.example.coinloreapi.di.coinLoreModule
import com.example.coinloreapi.di.repositoryModule
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
Expand All @@ -16,10 +14,7 @@ class CryptKnow:Application() {
startKoin{
androidLogger(Level.DEBUG)
androidContext(applicationContext)
modules(listOf(
coinLoreModule,
repositoryModule
))
modules()
}
}
}

0 comments on commit 7b226c1

Please sign in to comment.