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

Run fula under a android forgrand service #52

Closed
farhoud opened this issue Jan 7, 2023 · 9 comments
Closed

Run fula under a android forgrand service #52

farhoud opened this issue Jan 7, 2023 · 9 comments

Comments

@farhoud
Copy link
Contributor

farhoud commented Jan 7, 2023

on android wrap the FULA client inside service
is the better way to run FULA clients this way:

  • the service can run on its own process
  • auto start on boot
  • the service can create and control notification

If you need I can make PR. I have done it on a project like this with a more complicated interface.

@ehsan6sha
Copy link
Member

@farhoud perfect, a PR for this would be great

@farhoud
Copy link
Contributor Author

farhoud commented Jan 19, 2023

#54
I started the PR who is working on this currently? @ehsan6sha

@ehsan6sha
Copy link
Member

#54 I started the PR who is working on this currently? @ehsan6sha

Thank you Farhood. I am the one working on it

@farhoud
Copy link
Contributor Author

farhoud commented Jan 20, 2023

So there are 2 services fula and wnfs.
Do they need to run in background?
Or they are schedule jobs?
Or non they only needed when the app is open?

@farhoud
Copy link
Contributor Author

farhoud commented Jan 20, 2023

Let me share my reason for these question's.
Android is limiting background service and added some new task management APIs.
There are type of service's which run on its own process and use bridge interface to communicate with activities. So task like streaming data from ui are not suitable for these kind of service's.

And another ting do you need android native notification?

@ehsan6sha
Copy link
Member

They are not scheduled jobs. WNFS is responsible for encryption and creating merkle dag from a file, amd fula transfers the created dag to blox. Also whenever user download a file, wnfs requests the needed cids and fula bring them to wnfs from blox and wnfs decrypt .

So to the question:

1- i think if we keep libp2p connection always open, it drains battery and we need to turn it on when application is in foreground (open) and when app is in background or closed, schedule it to turn on and check for updates and then close the connection
2- we need notification which will be on top of fula libp2p but we don't have a notification service yet to blox and back

Did this answer all questions?

@farhoud
Copy link
Contributor Author

farhoud commented Jan 22, 2023

My situation in Hoodchat was pretty much different and I need libp2p to always run. but based on this Documentation I think we can implement upload and download as Jobs and let the android job scheduler handle them:

but bounded service and foreground service are still an option.
So @ehsan6sha What do you think we should do?

@ehsan6sha
Copy link
Member

Doesn't always running libp2p connection means keeping it open and drains battery?

@farhoud
Copy link
Contributor Author

farhoud commented Jan 22, 2023

Sure big time especially if I enable DHT and hole punching but that's the price of privacy.
I don't have a choice I'm waiting on chats, but you have multiple choices.

@farhoud farhoud closed this as completed Feb 9, 2023
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