Skip to content

Commit 9597aa9

Browse files
committed
📦 NEW: implement local data source in the form of a cache using a room DB
Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
1 parent 41242c2 commit 9597aa9

File tree

1 file changed

+21
-0
lines changed
  • app/src/main/java/com/github/swent/echo/data/repository/datasources

1 file changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.github.swent.echo.data.repository.datasources
2+
3+
import android.app.Application
4+
import androidx.room.Room
5+
import com.github.swent.echo.data.room.AppDatabase
6+
import com.github.swent.echo.data.room.Converters
7+
8+
class Cache(application: Application) : LocalDataSource {
9+
val db =
10+
Room.databaseBuilder(
11+
application.applicationContext,
12+
AppDatabase::class.java,
13+
"echo-cache-db"
14+
)
15+
.addTypeConverter(Converters())
16+
.build()
17+
18+
override fun getLocalData(): String {
19+
TODO("Not yet implemented")
20+
}
21+
}

0 commit comments

Comments
 (0)