{"id":13602049,"url":"https://github.com/scizers/react-native-otg-storage","last_synced_at":"2025-04-11T08:31:19.986Z","repository":{"id":92360283,"uuid":"145690395","full_name":"scizers/react-native-otg-storage","owner":"scizers","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-07T13:07:08.000Z","size":10,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-07T05:38:24.848Z","etag":null,"topics":["android","libaums","mass-storage-device","otg","react-native","storage","usb-otg"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scizers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-08-22T09:57:51.000Z","updated_at":"2023-12-14T09:26:05.000Z","dependencies_parsed_at":"2023-05-17T00:00:18.416Z","dependency_job_id":null,"html_url":"https://github.com/scizers/react-native-otg-storage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scizers%2Freact-native-otg-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scizers%2Freact-native-otg-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scizers%2Freact-native-otg-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scizers%2Freact-native-otg-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scizers","download_url":"https://codeload.github.com/scizers/react-native-otg-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248361525,"owners_count":21090919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","libaums","mass-storage-device","otg","react-native","storage","usb-otg"],"created_at":"2024-08-01T18:01:12.753Z","updated_at":"2025-04-11T08:31:19.696Z","avatar_url":"https://github.com/scizers.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"\n# react-native-otg-storage\n\n## Getting started\n\n\n`\n$ npm install scizers/react-native-otg-storage#master\n`\n\n### Mostly automatic installation\n\n`$ react-native link react-native-otg-storage`\n\n### Manual installation\n\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.reactlibrary.RNOtgStoragePackage;` to the imports at the top of the file\n  - Add `new RNOtgStoragePackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-otg-storage'\n  \tproject(':react-native-otg-storage').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-otg-storage/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':react-native-otg-storage')\n  \t```\n\n\n#### Important \nThe library can be included into your project like this:\n\n```ruby\ncompile 'com.github.mjdev:libaums:0.5.5'\n```\n\n\n## Usage\n```javascript\nimport RNOtgStorage from 'react-native-otg-storage';\nimport {DeviceEventEmitter} from 'react-native';\n\n\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tDeviceEventEmitter.addListener('onOTGConnected', (event) =\u003e {\n\t\t\tconsole.log(event, 'onOTGConnected');\n\t\t});\n\n\t\tDeviceEventEmitter.addListener('onOTGDisconnected', (event) =\u003e {\n\t\t\tconsole.log(event, 'onOTGDisconnected');\n\t\t});\n\n\n\t\tDeviceEventEmitter.addListener('logger', (event) =\u003e {\n\t\t\tconsole.log(event);\n\t\t});\n\n\n\t\tDeviceEventEmitter.addListener('newDeviceConnected', (event) =\u003e {\n\t\t\tconsole.log(event);\n\t\t});\n\t}\n\n\n\tconnectDevice() {\n\n\t\tRNOtgStorage.connectDevice().then((d)=\u003e {\n\t\t\tconsole.log(d)\n\t\t});\n\n\t}\n\n\topenDevice() {\n\n\t\tRNOtgStorage.openDevice().then((d)=\u003e {\n\n\t\t\tRNOtgStorage.openRootFolder(\"foo\", function (data) {\n\t\t\t\tconsole.log(data);\n\n\t\t\t\tRNOtgStorage.openRootFolderFile(\"foo\", \"bar.txt\", function (x) {\n\n\t\t\t\t\tconsole.log(x);\n\n\t\t\t\t\tRNOtgStorage.udpateOrCreateRootFolderFile(\"foo\", \"barsdf.txt\", \"sadf asdf jasdfk asf\" , function (r) {\n\t\t\t\t\t\tconsole.log(r);\n\t\t\t\t\t})\n\n\n\t\t\t\t})\n\n\t\t\t})\n\n\t\t});\n\n\t}\n\n\n```\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscizers%2Freact-native-otg-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscizers%2Freact-native-otg-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscizers%2Freact-native-otg-storage/lists"}