Android Jukebox Control

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

Android Jukebox Control

Postby meld0 » Fri Oct 21, 2011 10:30 am

Hey guys,

i extended the Android App to support Jukebox Control.
I submitted the current code to Sindre and i think he is reviewing my changes and will hopefully include it into the public app.

You can download the newest version here.
If you have the market app installed you need to uninstall it first and then install the .apk file using a browser (ES File Explorer) or something of your choice.

changes:
- new jukebox tab in the menubar
- while browsing through the music collection on the server and long clicking on a artist / folder / file, you can add it to the jukebox playlist.
- and the jukebox tab itself: shuffle, start, stop, next, previous, volume control bar, edit the playlist by longklicking on an entry (clear playlist, remove entry)

known issues:

- crash if server is not available - fixed
- no check if user has jukebox permissions

I hope you guys can give me some feedback and help me improve the jukebox control.

Regards
meld0

UPDATE 1: the major issue has been fixed and there are a lot of improvments in the ui and server connection
Last edited by meld0 on Fri Oct 21, 2011 10:43 pm, edited 1 time in total.
meld0
 
Posts: 8
Joined: Thu Oct 20, 2011 10:42 pm

Re: Android Jukebox Control

Postby kermit22 » Fri Oct 21, 2011 2:14 pm

I haven't had a chance to try it yet but I like the idea. This has been a long time request of the android app and I'm glad that someone was finally able to start to tackle this. Thanks!
-My Subsonic Server-

OS: Windows Server 2016
Processor: Intel Xeon E5630
Memory: 8GB


2,098 artists
4,266 albums
39,450 songs
2,606 hours
User avatar
kermit22
 
Posts: 218
Joined: Fri Feb 20, 2009 7:00 pm

Re: Android Jukebox Control

Postby Eloquence » Sun Oct 23, 2011 8:29 pm

Nice mod! Works fine on my setup. It's snappy and responsive, and I like the way the server communication is handled, looks like network activity is kept to a minimum.

I've actually done this myself, integrating the jukebox tab with the existing "now playing" tab and including a setting to enable/disable jukebox control per server instead (so you would have a jukebox "now playing" or a on-phone "now playing" depending on the server). It's still slightly buggy and needs some cleaning up, however, so I haven't done anything to get it included "officially" and now it seems I may be too late to the ball anyway :) But do give me a shout if you'd like to exchange ideas or feedback on the two solutions.

A few UI things I found confusing in your mod (but that may be just because I have a clear idea of "my" version, of course):

- Now playing icon is always on, even if the jukebox isnt't playing. Maybe a different icon to show "current non-playing track", so it doesn't look like it's playing? (If you're not in the same place as the physical jukebox and/or if you can't hear any sound, it's hard to know from the UI if it's actually playing. Knowing which song would start when pushing the play button is a bonus, though, thus the idea about the different icon)
- Also (a related point), the "now playing" doesn't advance automatically when the jukebox plays several songs in sequence. This also results in buggy behaviour on the start/stop buttons since clicking them will actually stop/start a different song than the one with the "now playing" icon. The only way I found to force an update to the current song for me was to change tabs back and forth, or using the skip buttons (which seem to re-load the playlist first?). Personally I implemented a polling solution to see what the jukebox status was every 20 seconds or so, not ideal however. (I'd love for some server-side push protocol to be implemented, if possible. xmpp or something?)
- Stop/start button - this looks better as a single button IMHO, start button when jukebox isn't playing and stop button while it is. I realise that this has implications for stuff like detecting "playing finished" etc., same as the previous point really.
- Scroll-to-currently-playing on long playlists. Doesn't seem like your app is doing this at the moment, the regular now playing tab does this so should be easy to implement in your tab as well.
- The volume bar doesn't seem to be updated with current volume level from the jukebox (if you switch out of the jukebox tab and back it's at zero again). The gain value is a part of the jukebox playlist xml so that's an easy fix.
- I also had a random force close while the jukebox tab was open (but not clicking anything at the time). Maybe take a look at what could cause this? :)
Code: Select all
E/AndroidRuntime(12555): FATAL EXCEPTION: main
E/AndroidRuntime(12555): java.lang.ArrayIndexOutOfBoundsException
E/AndroidRuntime(12555):    at net.sourceforge.subsonic.androidapp.activity.JukeboxActivity$1.done(JukeboxActivity.java:120)
E/AndroidRuntime(12555):    at net.sourceforge.subsonic.androidapp.activity.JukeboxActivity$1.done(JukeboxActivity.java:1)
E/AndroidRuntime(12555):    at net.sourceforge.subsonic.androidapp.util.TabActivityBackgroundTask$1$1.run(TabActivityBackgroundTask.java:35)
E/AndroidRuntime(12555):    at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime(12555):    at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(12555):    at android.os.Looper.loop(Looper.java:143)
E/AndroidRuntime(12555):    at android.app.ActivityThread.main(ActivityThread.java:4196)
E/AndroidRuntime(12555):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(12555):    at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(12555):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(12555):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime(12555):    at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 1339):   Force finishing activity net.sourceforge.subsonic.androidapp/.activity.JukeboxActivity


Thanks again for a nice mod, there's nothing I've wanted more from the Subsonic Android app than a proper jukebox control solution so whatever happens it seems we're going to get one now! Good job so far!
Eloquence
 
Posts: 14
Joined: Thu Nov 27, 2008 10:55 am

Re: Android Jukebox Control

Postby shayo » Mon Oct 24, 2011 3:46 am

Installed the mod, but whenever I click on the "J" icon, I get an error saying "java.lang.String.isEmpty" and nothing happens.
any ideas?

-- Shay
shayo
 
Posts: 8
Joined: Sun Oct 09, 2011 1:27 am

Re: Android Jukebox Control

Postby meld0 » Mon Oct 24, 2011 1:48 pm

@ Eloquence

Thanks for your input. I'd like to look at your version if that's possible. I like the idea of enabling jukebox control per server.

To answer your questions:
1. i don't quite get what you mean, do you mean the now playing icon in the playlist, or the start /stop buttons.
2/3. Are just like you said. I wanted to minimize network traffic and a constant pull version was on my mind, but i did not want to do it because of unrealiability issues (wlan/3g)...
So i made two buttons for stop/start because i do not know the playing state (at all times). I don't think i will change this.
4. easy, will do
5. i forgot to update the gain bar on create/resume, will do
6. is because of some, well i guess bad coding :twisted:. will fix it, thanks.

@shayo
I don't know what could cause this. Your server is otherwise reachable within the app (library) ? Does the user you connect with does have jukebox control rights?
A stack trace would be more helpful.

Thanks you guys
meld0
meld0
 
Posts: 8
Joined: Thu Oct 20, 2011 10:42 pm

Re: Android Jukebox Control

Postby shayo » Mon Oct 24, 2011 2:34 pm

Hi,

User has access to jukebox and server is fine (I can stream music with it).
How do I access the stack? Is it saved in a log somewhere?

-- Shay
shayo
 
Posts: 8
Joined: Sun Oct 09, 2011 1:27 am

Re: Android Jukebox Control

Postby meld0 » Mon Oct 24, 2011 6:20 pm

After subsonic crashes there should be a logfile in the root of your sd card called subsonic-stacktrace.txt
Can you have a look if it exists ?

meld0
meld0
 
Posts: 8
Joined: Thu Oct 20, 2011 10:42 pm

Re: Android Jukebox Control

Postby shayo » Mon Oct 24, 2011 6:28 pm

Hi,

No. No such file exist.
Is there another way to debug this? Do I need to install Android SDK or something? I am willing to invest some time (I have programming skills) but I have never developed something for smart phones, so I'll need some guidance.

-- Shay
shayo
 
Posts: 8
Joined: Sun Oct 09, 2011 1:27 am

Re: Android Jukebox Control

Postby meld0 » Mon Oct 24, 2011 6:48 pm

Yeah it's possible, depending on your phone. Which phone do you have ?

A good start would be to install the sdk from http://developer.android.com/sdk/index.html
If you do not want to develop you do not need eclipse at this moment. Your phone must be available via adb the android debugging bridge.
You need to enable USB debugging in: Settings -> Application Settings -> Development -> USB debugging.
Then you need to install the adb drivers. You can install them from the SDK Manager -> Extras -> Google USB Driver package (I'm assuming your on windows).
You need the "Android SDK Platform-tools" as well. And then update the drivers for the Android device in the Windows Device Manager.

You can test if adb works by opening a command prompt. Navigate to the <android-sdk>\platform-tools and run adb devices.
If your device is listed you can run the debugger found in <android-sdk>\ddms.bat.

It will launch the Dalvik Debug Monitor and you should see your device and select it. The log should start coming in now.
You can filter the log for subsonic by setting the filter to net.sourceforge.subsonic.androidapp.

Reproduce your steps leading to the error, copy the log and paste it into pastebin for example.
Post the link here and i will have a look at it.

Thanks for your help
meld0
meld0
 
Posts: 8
Joined: Thu Oct 20, 2011 10:42 pm

Re: Android Jukebox Control

Postby Eloquence » Mon Oct 24, 2011 7:08 pm

@meld0: Sure, you can look at my version. Do you mean the source or just test the .apk first? I can attach a source .zip or an .apk here for instance, or mail it to you?

For point 1., I meant the now playing icon in the playlist. But I understand that what I was thinking about won't be feasible unless the client pulls state from the server once in a while.
2/3: ok, that's fine. But surely you can at least pull state when an action is triggered by the user? Ie if play/stop is pressed, the playlist could be grabbed as well so that the client would know which song will start the next time you push start? Not a huge point for me but it does seem a bit confusing to the user. (Also, of course you might want to consider having a pull model implemented while the phone is on wlan but not on 3g, or something.)

@shayo: Yeah, the SDK would give you the adb logcat thing that can show you the phone's log in your console or in an android-supported IDE (I use NetBeans, Eclipse is the "standard" but IntelliJ Idea has recently come out with more Android support - I'm thinking of switching to that myself. Point being, any decent IDE will probably do :)). Take a look here on how to look at the logs after the phone is up and running with the SDK. (Windows user? If you have HTC sync installed on your PC you should be all set with regards to drivers, unless you're on Windows 7 where I at least had to jump through some extra hoops. Give it a try and post your progress and I can try to help you along if needed.)

Did you have your phone mounted as a USB drive while trying out the app, by the way? If so it wouldn't be able to reach the SD card so the subsonic-stacktrace.txt couldn't be written.
Eloquence
 
Posts: 14
Joined: Thu Nov 27, 2008 10:55 am

Re: Android Jukebox Control

Postby shayo » Tue Oct 25, 2011 1:03 am

OK. I'll try to install things.
The USB was not connected when the crash happened. I repeated this again and again and no file is generated.
I'll try to follow your steps tomorrow/next day and see if I can get the stack log.

Thanks!

-- Shay
shayo
 
Posts: 8
Joined: Sun Oct 09, 2011 1:27 am

Re: Android Jukebox Control

Postby Eloquence » Tue Oct 25, 2011 7:48 pm

OK, cool, I'll do my best to help! One more thing - you wouldn't happen to be using a localized version of the app? There's a french version, for instance, with its own strings defined - maybe the new strings in meld0's version haven't been added there yet?
Eloquence
 
Posts: 14
Joined: Thu Nov 27, 2008 10:55 am

Re: Android Jukebox Control

Postby shayo » Tue Oct 25, 2011 8:10 pm

No. I'm using the standard version.
I'm running on a LG Optimus T (Android 2.2)

-- Shay
shayo
 
Posts: 8
Joined: Sun Oct 09, 2011 1:27 am

Re: Android Jukebox Control

Postby maxslug » Fri Oct 28, 2011 12:59 am

Fantastic, can't wait to try this out!
maxslug
 
Posts: 44
Joined: Tue Oct 26, 2010 11:23 pm

Re: Android Jukebox Control

Postby sindre_mehus » Sat Oct 29, 2011 11:05 am

Just wanted to let you know that I have started working on jukebox support in the "official" Subsonic Android app.

I've reviewed the mod from meld0 and another one from Øyvind - but I have decided to start from scratch.

Anyone interested in the code can find it in this svn branch: https://subsonic.svn.sourceforge.net/sv ... id-jukebox

It's still very early days, but I hope to make a prototype available in not too long.

Cheers,
Sindre
Subsonic developer
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Next

Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 2 guests