openmobilehub / android-omh-storage

https://www.openmobilehub.org
Apache License 2.0
4 stars 1 forks source link


Android OMH Storage

NPM version License

Chat on Discord Follow on Twitter


Android OMH Storage streamlines the integration of various cloud storage providers into your Android application by offering a unified API for different storage providers. It supports both Google Mobile Services (GMS) and non-GMS configurations, making it easy to incorporate Google Drive, OneDrive and Dropbox storage providers.

Features

OMH Storage Modules

This is the main directory of the mono-repo for Android OMH Storage. If you're searching for a particular package, please click on the corresponding package link below.

A single codebase, running seamlessly on any device

For instance, the following screenshots showcase multiple devices with Android, both with GMS and Non-GMS. The same app works without changing a single line of code, supporting multiple storage provider implementations.

| Google Drive (GMS) | Google Drive (non-GMS) | Dropbox | OneDrive | | --- | --- | --- | ---| | File listing | | | | | |
Show more
| Google Drive (GMS) | Google Drive (non-GMS) | Dropbox | OneDrive | | --- | --- | --- | --- | | File searching | | | | | | | File creation | | | | | | | File update | | | | | | | File deletion | | | | | | | File upload | | | | | | | File download | | | | | | | File metadata | | | | | | | File versioning | | | | | | | File permissions | | | | | |

Documentation

Supported functionality

Features Google Drive (GMS) Google Drive (non-GMS) OneDrive Dropbox
File listing βœ… βœ… βœ… βœ…
File searching βœ… βœ… βœ… βœ…
Folder creation βœ… βœ… βœ… βœ…
File creation (by mime type) βœ… βœ… ❌ ❌
File creation (by extension) ❌ ❌ βœ… βœ…
File update βœ… βœ… βœ… βœ…
File deletion βœ… βœ… βœ… βœ…
File permanent deletion βœ… βœ… ❌ ❌
File upload βœ… βœ… βœ… βœ…
File download βœ… βœ… βœ… βœ…
File export βœ… βœ… ❌ ❌
File metadata βœ… βœ… 🟨 🟨
File versioning βœ… βœ… βœ… βœ…
File permissions 🟨 🟨 🟨 🟨
File URL βœ… βœ… βœ… βœ…
Escape hatch (get provider SDK) βœ… ❌ βœ… βœ…

File metadata

Show details [`OmhStorageEntity.OmhFile`](https://openmobilehub.github.io/android-omh-storage/api/packages/core/com.openmobilehub.android.storage.core.model/-omh-storage-entity/-omh-file) | Property | Google Drive (GMS) | Google Drive (non-GMS) | OneDrive | Dropbox | | ------------ | :----------------: | :--------------------: | :------: | :-----: | | id | βœ… | βœ… | βœ… | βœ… | | name | βœ… | βœ… | βœ… | βœ… | | createdTime | βœ… | βœ… | ❌ | ❌ | | modifiedTime | βœ… | βœ… | βœ… | βœ… | | parentId | βœ… | βœ… | βœ… | βœ… | | mimeType | βœ… | βœ… | βœ… | βœ… | | extension | βœ… | βœ… | βœ… | βœ… | | size | βœ… | βœ… | βœ… | βœ… | [`OmhStorageEntity.OmhFolder`](https://openmobilehub.github.io/android-omh-storage/api/packages/core/com.openmobilehub.android.storage.core.model/-omh-storage-entity/-omh-folder) | Property | Google Drive (GMS) | Google Drive (non-GMS) | OneDrive | Dropbox | | ------------ | :----------------: | :--------------------: | :------: | :-----: | | id | βœ… | βœ… | βœ… | βœ… | | name | βœ… | βœ… | βœ… | βœ… | | createdTime | βœ… | βœ… | ❌ | ❌ | | modifiedTime | βœ… | βœ… | βœ… | ❌ | | parentId | βœ… | βœ… | βœ… | βœ… | [`OmhStorageMetadata.originalMetadata`](https://openmobilehub.github.io/android-omh-storage/api/packages/core/com.openmobilehub.android.storage.core.model/-omh-storage-metadata/original-metadata.html) | Storage provider | Type | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Google Drive (GMS) | [`com.google.api.services.drive.model.File`](https://developers.google.com/resources/api-libraries/documentation/drive/v3/java/latest/com/google/api/services/drive/model/File.html) | | Google Drive (non-GMS) | `String` | | OneDrive | [`com.microsoft.graph.models.DriveItem`](https://learn.microsoft.com/en-us/graph/api/resources/driveitem#properties) | | Dropbox | [`com.dropbox.core.v2.files.Metadata`](https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.0.x/com/dropbox/core/v2/files/Metadata.html) |

File permissions

Show details [`OmhPermission.IdentityPermission`](https://openmobilehub.github.io/android-omh-storage/api/packages/core/com.openmobilehub.android.storage.core.model/-omh-permission/-identity-permission) | Property | Google Drive (GMS) | Google Drive (non-GMS) | OneDrive | Dropbox | | ----------- | :----------------: | :--------------------: | :------: | :-----: | | id | βœ… | βœ… | βœ… | 🟨 | | role | βœ… | βœ… | βœ… | βœ… | | isInherited | 🟨 | 🟨 | βœ… | βœ… | | identity | βœ… | βœ… | βœ… | βœ… | > **Google Drive**: The `isInherited` property is available only for items in shared drives. > **Dropbox**: The `id` corresponds to the underlying identity ID. [`OmhIdentity`](https://openmobilehub.github.io/android-omh-storage/api/packages/core/com.openmobilehub.android.storage.core.model/-omh-identity) | Type | Google Drive (GMS) | Google Drive (non-GMS) | OneDrive | Dropbox | | ----------- | :----------------: | :--------------------: | :------: | :-----: | | User | βœ… | βœ… | βœ… | βœ… | | Group | βœ… | βœ… | βœ… | βœ… | | Domain | βœ… | βœ… | ❌ | ❌ | | Anyone | βœ… | βœ… | ❌ | ❌ | | Device | ❌ | ❌ | βœ… | ❌ | | Application | ❌ | ❌ | βœ… | ❌ | [`OmhIdentity.User`](https://openmobilehub.github.io/android-omh-storage/api/packages/core/com.openmobilehub.android.storage.core.model/-omh-identity/-user) | Property | Google Drive (GMS) | Google Drive (non-GMS) | OneDrive | Dropbox | | -------------- | :----------------: | :--------------------: | :------: | :-----: | | id | ❌ | ❌ | βœ… | βœ… | | displayName | βœ… | βœ… | βœ… | 🟨 | | emailAddress | βœ… | βœ… | ❌ | βœ… | | expirationTime | βœ… | βœ… | βœ… | ❌ | | deleted | βœ… | βœ… | ❌ | ❌ | | photoLink | βœ… | βœ… | ❌ | ❌ | | pendingOwner | ❌ | βœ… | ❌ | ❌ | > **Dropbox**: Invited users who do not have a Dropbox account will not have a `displayName`. [`OmhIdentity.Group`](https://openmobilehub.github.io/android-omh-storage/api/packages/core/com.openmobilehub.android.storage.core.model/-omh-identity/-group) | Property | Google Drive (GMS) | Google Drive (non-GMS) | OneDrive | Dropbox | | -------------- | :----------------: | :--------------------: | :------: | :-----: | | id | ❌ | ❌ | βœ… | βœ… | | displayName | βœ… | βœ… | βœ… | βœ… | | emailAddress | βœ… | βœ… | ❌ | ❌ | | expirationTime | βœ… | βœ… | βœ… | ❌ | | deleted | βœ… | βœ… | ❌ | ❌ | [`OmhPermissionRole`](https://openmobilehub.github.io/android-omh-storage/api/packages/core/com.openmobilehub.android.storage.core.model/-omh-permission-role) | Role | Google Drive (GMS) | Google Drive (non-GMS) | OneDrive | Dropbox | | --------- | :----------------: | :--------------------: | :------: | :-----: | | OWNER | βœ… | βœ… | βœ… | βœ… | | WRITER | βœ… | βœ… | βœ… | 🟨 | | COMMENTER | βœ… | βœ… | ❌ | βœ… | | READER | βœ… | βœ… | βœ… | 🟨 | > **Dropbox**: > > - While the `READER` role is documented in the API, Dropbox does not support granting this role. Attempting to do so will throw an exception with the user message: `viewer_no_comment isn’t yet supported`. > - Dropbox also does not support granting the `WRITER` role for uploaded files. Any attempt will result in an exception with the user message: `You don’t have permission to perform this action`. [`OmhPermissionRecipient`](https://openmobilehub.github.io/android-omh-storage/api/packages/core/com.openmobilehub.android.storage.core.model/-omh-permission-recipient) | Type | Google Drive (GMS) | Google Drive (non-GMS) | OneDrive | Dropbox | | ------------ | :----------------: | :--------------------: | :------: | :-----: | | User | βœ… | βœ… | βœ… | βœ… | | Group | βœ… | βœ… | βœ… | ❌ | | Domain | βœ… | βœ… | ❌ | ❌ | | Anyone | βœ… | βœ… | ❌ | ❌ | | WithObjectId | ❌ | ❌ | βœ… | βœ… | | WithAlias | ❌ | ❌ | βœ… | ❌ | > **Dropbox**: To invite a group, use `WithObjectId` and provide the group ID.

Contributing

License