From 3223e20e33f20c3180c19079253cdc888f3c2768 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Wed, 19 Feb 2014 14:52:01 -0500 Subject: [PATCH] Add support for Network Service Discovery of FDroid repos. If the device supports API level 16 (Android 4.1) then add a menu item on the repository management screen to "Find Local Repos". Activating this menu item will initiate NSD service discovery with the NsdHelper class looking for 'fdroidrepo' and 'fdroidrepos' service types on the local network. When one is found, the service is resolved and the name & IP are populated into a list of discovered repositories. Clicking an NSD discovered repo will prompt the user to add the repo. --- CHANGELOG.md | 3 + res/layout/repodiscoveryitem.xml | 27 ++ res/layout/repodiscoverylist.xml | 43 +++ res/values/strings.xml | 4 + src/org/fdroid/fdroid/net/NsdHelper.java | 251 ++++++++++++++++++ .../views/fragments/RepoListFragment.java | 76 +++++- 6 files changed, 403 insertions(+), 1 deletion(-) create mode 100644 res/layout/repodiscoveryitem.xml create mode 100644 res/layout/repodiscoverylist.xml create mode 100644 src/org/fdroid/fdroid/net/NsdHelper.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 9875f74ad..2aa8d411b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Upcoming release +* Support for Network Service Discovery of local FDroid repos on Android 4.1+ + from the repository management screen. + * Always remember the selected category in the list of apps * Send FDroid via Bluetooth to any device that supports receiving APKs via diff --git a/res/layout/repodiscoveryitem.xml b/res/layout/repodiscoveryitem.xml new file mode 100644 index 000000000..333b5e9c7 --- /dev/null +++ b/res/layout/repodiscoveryitem.xml @@ -0,0 +1,27 @@ + + + + + + + + \ No newline at end of file diff --git a/res/layout/repodiscoverylist.xml b/res/layout/repodiscoverylist.xml new file mode 100644 index 000000000..077636d55 --- /dev/null +++ b/res/layout/repodiscoverylist.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index e0708d046..54b027945 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -100,6 +100,7 @@ Search New Repository Remove Repository + Find Local Repos Run Share @@ -148,6 +149,9 @@ What\'s New Recently Updated + Local FDroid Repos + Discovering local FDroid repos… +