isar / hive

Lightweight and blazing fast key-value database written in pure Dart.
Apache License 2.0
4.11k stars 409 forks source link

Default Hive file folder location on Android? #1072

Open davoutuk opened 2 years ago

davoutuk commented 2 years ago

Can somebody advise what folder is used as the default location for Hive data on Android?

I am trying to work out how to port data from my old to a new Android phone

BenWildeman commented 2 years ago

Hive uses getApplicationDocumentsDirectory from the Flutter path_provider as seen here: https://github.com/hivedb/hive/blob/3b12c31a221f97f5ec86fe20df63515aeedf88f0/hive_flutter/lib/src/hive_extensions.dart#L16

What getApplicationDocumentsDirectory actually uses in Android through is a function called getDataDirectory which is invisible to the user, and thus would not be copyable, as noted in the path_provider docs: https://github.com/flutter/plugins/blob/main/packages/path_provider/path_provider/lib/path_provider.dart#L108