Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading files from SD-card in microservice, Android #199

Open
boby1975 opened this issue Nov 27, 2020 · 1 comment
Open

Reading files from SD-card in microservice, Android #199

boby1975 opened this issue Nov 27, 2020 · 1 comment

Comments

@boby1975
Copy link

Could someone read the files from the SD card in the microservice? I get the error "access denied (EACCES)". But from the application where the microservice is running I can read this file. Of course the app has permission READ_EXTERNAL_STORAGE.

Someone knows how to get SD card read access from microservice?
Thanks a lot.

@1stRadiant
Copy link

I don't know if you are still looking for an answer to this but here how's I did it:
Create a method that reads files and returns content in your java. Then create a microservice event which runs readfile java method upon receiving the message from your javascript, then emits the read contents to your js code.

In your js code you need to also emit/send a message to your java code which includes and instruction to run the readfile method as well as the filename.

lastly you need to create an event which is triggered when your file is read this need's to happen after a millisecond so make sure you put set timeout above the event. This event will receive the contents of the file read, you can do whatever you want with value in node js.

I'll be happy to share the code if you need it just let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants