[Android] Migrate database to Room

Habib Kazemi git at videolan.org
Wed Jul 25 12:01:32 CEST 2018


vlc-android | branch: master | Habib Kazemi <kazemihabib1996 at gmail.com> | Tue Jul 24 18:46:37 2018 +0430| [5fc48e37f6af8387b70f6342b4bee126463df96a] | committer: Geoffrey Métais

Migrate database to Room

Database migrated to Room Android Room Persistence Library.
Also, Android testing dependencies added to build.gradle.
I also wrote Tests for Dao and repository

Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>

> https://code.videolan.org/videolan/vlc-android/commit/5fc48e37f6af8387b70f6342b4bee126463df96a
---

 build.gradle                                       |    3 +
 .../org/videolan/vlc/database/BrowserFavDaoTest.kt |  104 ++
 .../org/videolan/vlc/database/ConvertersTest.kt    |   41 +
 .../videolan/vlc/database/ExternalSubDaoTest.kt    |   94 ++
 .../org/videolan/vlc/database/MigrationTest.kt     |  108 ++
 .../org/videolan/vlc/database/SlaveDaoTest.kt      |   75 ++
 .../database/helpers/SqliteDatabaseTestHelper.kt   |   98 ++
 .../vlc/database/helpers/SqliteTestDbOpenHelper.kt |   40 +
 .../vlc/repository/BrowserFavRepositoryTest.kt     |   74 ++
 .../vlc/repository/ExternalSubRepositoryTest.kt    |   93 ++
 .../videolan/vlc/repository/SlaveRepositoryTest.kt |   77 ++
 .../27.json                                        |  115 ++
 vlc-android/build.gradle                           |   22 +-
 .../src/org/videolan/vlc/database/BrowserFavDao.kt |   51 +
 .../src/org/videolan/vlc/database/Converters.kt    |   32 +
 .../org/videolan/vlc/database/ExternalSubDao.kt    |   41 +
 .../src/org/videolan/vlc/database/MediaDatabase.kt |   61 +
 .../src/org/videolan/vlc/database/Migrations.kt    |  174 +++
 .../src/org/videolan/vlc/database/SlaveDao.kt      |   39 +
 .../org/videolan/vlc/database/models/BrowserFav.kt |   39 +
 .../videolan/vlc/database/models/ExternalSub.kt    |   34 +
 .../src/org/videolan/vlc/database/models/Slave.kt  |   39 +
 .../vlc/gui/browser/BaseBrowserFragment.kt         |    6 +-
 .../vlc/gui/browser/NetworkBrowserFragment.java    |   65 +-
 .../vlc/gui/browser/StorageBrowserFragment.java    |    2 -
 .../vlc/gui/dialogs/NetworkServerDialog.java       |   19 +-
 .../src/org/videolan/vlc/gui/tv/MainTvFragment.kt  |   48 +-
 .../vlc/gui/tv/MediaItemDetailsFragment.java       |   18 +-
 .../vlc/gui/video/VideoPlayerActivity.java         |   13 +-
 .../src/org/videolan/vlc/media/MediaDatabase.java  | 1364 --------------------
 .../src/org/videolan/vlc/media/PlayerController.kt |   18 +-
 .../src/org/videolan/vlc/media/PlaylistManager.kt  |    4 +-
 .../org/videolan/vlc/providers/NetworkProvider.kt  |    7 +-
 .../vlc/repository/BrowserFavRepository.kt         |   91 ++
 .../vlc/repository/ExternalSubRepository.kt        |   58 +
 .../org/videolan/vlc/repository/SlaveRepository.kt |   66 +
 .../src/org/videolan/vlc/util/Constants.java       |    5 +
 .../org/videolan/vlc/util/SubtitlesDownloader.java |    4 +-
 38 files changed, 1801 insertions(+), 1441 deletions(-)

Diff:   https://code.videolan.org/videolan/vlc-android/commit/5fc48e37f6af8387b70f6342b4bee126463df96a


More information about the Android mailing list