Extract RouterService into a router library
Opened 6 years ago
Last modified 2 years ago
#1556assignedtask
Extract RouterService into a router library
Reported by:str4dOwned by:Meeh Priority: minor Milestone: eventually Component: apps/android Version: 0.9.19 Keywords:
Cc:
Parent Tickets:
Sensitive: no
(last modified by str4d)
DescriptionWe already have a client library for apps that want to use the Java I2P APIs, and it can be used with either a remote router via I2CP, or I2P Android via a DomainSocket (which the client library handles). But there is a third option: bundle a router and use that. Bote currently bundles router.jar itself; it's not hard to do, but it isn't dead simple either.
Bundling a router is IMHO a good idea to decrease the barrier to using an app. But running multiple routers on a single device is a bad idea. So I propose that the router code in I2P Android be extracted out into a router library, which additionally would contain code to detect multiple instances of itself (and distinguish between I2P Android instances and router lib instances). Then we provide it as the recommended way to bundle an I2P router inside an app. If a user installs two apps that both bundle routers, but doesn't have I2P Android installed, the router lib will automatically prompt them to install I2P Android, and will prevent itself from starting if an I2P router is already running.
Some related discussion that prompted me to finally make this ticket:
https://lists.mayfirst.org/pipermail/guardian-dev/2015-April/004368.html
https://lists.mayfirst.org/pipermail/guardian-dev/2015-April/004376.html
https://lists.mayfirst.org/pipermail/guardian-dev/2015-April/004379.html