Go to file
Synced Synapse 7dfd982643 Tweak connection threads
This PR fixes some issues with connections and threading. Specifically, the  change in #618 introduced threading in `HostConnection`, which had some issues. To fix them, the following changes were made:
- A specific TCP listener thread is used and manually started, instead of using one of the threads in the pool. The TCP listener thread is a long lived thread that should always be running (as long as the connection is through TCP), blocked listening on the TCP socket, so it shouldn't be managed in a pool, where, theoretically, it can be paused and reused. 
- Changed the number of threads to 5. We shouldn't need more than this, otherwise we can overwhelm some Kodi hardware.
- Had to sprinkle some `synchronized` to avoid race conditions. For instance, through a TCP connection, as soon as Kore is opened (on the remote screen) it will call at least `GetActivePlayers`, `GetProperties`, `Ping`. If the TCP socket isn't set up yet, each of these calls would create a socket (and a TCP listener thread), so we would open 3 or more sockets when we should just open 1. A `synchronized` in `executeThroughTcp` prevents this. The others prevent similar issues.

Aditionally:
- Tweaked the playlist fetching code, so that it happens exclusively in `HostConnectionObserver` and when PlaylistFragment is notified of changes, it already gets the playlist data. This somewhat simplifies the code, and makes it more consistent with the Player Observer code;
- Change `EventServerConnection` to accept a Handler on which to post the result of the connection, so that the caller can control on which thread the result is called;
- Calls to the various `RegisterObserver` loose the reply immediately parameter, as it was always true.
2019-09-28 22:10:04 +02:00
.github Add google repository (#603) 2018-12-11 20:03:43 +00:00
app Tweak connection threads 2019-09-28 22:10:04 +02:00
art Add Adaptive Icon For API 26+ (#450) 2017-11-11 15:26:18 +00:00
doc Implemented showing playlists even when not playing (#618) 2019-03-30 11:08:58 +00:00
fastlane/metadata/android/en-US Add metadata for fdroid (#527) 2018-04-05 18:30:52 +01:00
gradle/wrapper Updated gradle and compile and target SDK version (#640) 2019-06-03 10:50:31 +01:00
tools Fix Jenkins build to upload the correctly signed apk 2019-05-14 20:02:18 +02:00
.gitignore Fixed .gitignore to keep gradle-wrapper.properties 2015-01-14 11:54:23 +00:00
.travis.yml Updated gradle and compile and target SDK version (#640) 2019-06-03 10:50:31 +01:00
CHANGELOG.md Bump version for release 2019-02-11 11:20:06 +00:00
LICENSE.txt First dump 2015-01-14 11:12:47 +00:00
README.md Updated documentation on running local and instrumentation tests (#460) 2017-09-28 19:54:52 +01:00
build.gradle Updated gradle and compile and target SDK version (#640) 2019-06-03 10:50:31 +01:00
gradlew First dump 2015-01-14 11:12:47 +00:00
gradlew.bat First dump 2015-01-14 11:12:47 +00:00
settings.gradle First dump 2015-01-14 11:12:47 +00:00

README.md

Travis CI status Build Status

Codacy analysis Codacy Badge

Doxygen documentation Documentation

Kore - Kodi/XBMC remote for Android

GitHub repository for the Kore Android app.

Kore is the official remote for Kodi, and aims to be a simple and easy to use remote.

Building

  1. Make sure you have a working Android build system;
  2. The version of Android SDK and Build Tools needed is specified in app/build.gradle. Make sure you have them installed;
  3. Install the version of Android support library that is specified in app/gradle (dependencies section);
  4. Git pull
  5. Gradle should be able to fetch all the other needed libraries.

Testing

  1. Make sure you are able to build Kore as described in the previous section.
  2. To run the local tests see README
  3. To run the instrumented tests see README

We currently use travis-ci to automatically build and run the local tests for each pull request.

Credits

Libraries used

License

Copyright 2017 XBMC Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Google Play and the Google Play logo are trademarks of Google Inc.