Extract RouterService into a router library #45

Open
opened 2025-04-21 14:45:15 -04:00 by idk · 3 comments
Owner

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

Description (last modified by str4d)

We 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

Subtickets

Opened [6 years ago](/timeline?from=2015-05-03T02%3A11%3A42Z&precision=second "See timeline at May 3, 2015 2:11:42 AM") Last modified [2 years ago](/timeline?from=2019-04-18T14%3A36%3A26Z&precision=second "See timeline at Apr 18, 2019 2:36:26 PM") ## [\#1556](/ticket/1556)[assigned](/query?status=assigned)[task](/query?status=!closed&type=task) # Extract RouterService into a router library Reported by:[str4d](/query?status=!closed&reporter=str4d)Owned by:[Meeh](/query?status=!closed&owner=meeh) Priority: [minor](/query?status=!closed&priority=minor) Milestone: [eventually](/milestone/eventually "No date set") Component: [apps/android](/query?status=!closed&component=apps%2Fandroid) Version: [0.9.19](/query?status=!closed&version=0.9.19) Keywords: Cc: Parent Tickets: Sensitive: [no](/query?status=!closed&sensitive=0) ### Description [(last modified by str4d)](/ticket/1556?action=diff&version=1 "2015-05-03 02:12:20.174971+00:00") We 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/004368.html) [​https://lists.mayfirst.org/pipermail/guardian-dev/2015-April/004376.html](https://lists.mayfirst.org/pipermail/guardian-dev/2015-April/004376.html) [​https://lists.mayfirst.org/pipermail/guardian-dev/2015-April/004379.html](https://lists.mayfirst.org/pipermail/guardian-dev/2015-April/004379.html) ### Subtickets
idk added this to the eventually milestone 2025-04-21 14:45:15 -04:00
idk added the #1556apps.androideventually labels 2025-04-21 14:45:15 -04:00
Author
Owner

comment:3 Changed 2 years ago by zzz

Owner:
changed from str4d to _Meeh_Status:open →
assigned

[comment:3](https://trac.i2p2.de/\#comment:3) Changed [2 years ago](https://trac.i2p2.de//timeline?from=2019-04-18T14%3A36%3A26Z&precision=second "See timeline at Apr 18, 2019 2:36:26 PM") by zzz Owner: changed from _str4d_ to _Meeh_Status:open → assigned
Author
Owner

comment:2 Changed 5 years ago by str4d

Status:new →
open

[comment:2](https://trac.i2p2.de/\#comment:2) Changed [5 years ago](https://trac.i2p2.de//timeline?from=2016-02-18T04%3A24%3A46Z&precision=second "See timeline at Feb 18, 2016 4:24:46 AM") by str4d Status:new → open
Author
Owner

comment:1 Changed 6 years ago by str4d

Description:
modified ( diff)

[comment:1](https://trac.i2p2.de/\#comment:1) Changed [6 years ago](https://trac.i2p2.de//timeline?from=2015-05-03T02%3A12%3A20Z&precision=second "See timeline at May 3, 2015 2:12:20 AM") by str4d Description: modified ( [diff](https://trac.i2p2.de//ticket/1556?action=diff&version=1))
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: I2P_Developers/i2p.android.base#45
No description provided.