Prathamesh More
Prathamesh More

Reputation: 25

Uploading a local database to Firebase Storage

I want to upload my local SQLite Database to Firebase. I have created SQLite database which is stored in data/databases. Is there any way I can upload and download this database with the help of Firebase? Any help will be appreciated. And I want to use Firebase Storage not Realtime Database.

Upvotes: 0

Views: 421

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598916

If you have a local file, you can upload it to Firebase Storage using its API. An example of that can be found in the Firebase documentation on uploading a local file:

Uri file = Uri.fromFile(new File("path/to/images/rivers.jpg"));
StorageReference riversRef = storageRef.child("images/"+file.getLastPathSegment());
uploadTask = riversRef.putFile(file);

Check the link for full documentation.

Upvotes: 1

Related Questions