Author Topic: Android remote  (Read 95553 times)

kelsos

  • Sr. Member
  • ****
  • Posts: 302
The main part of my exams ends on Friday. I will have only one lesson after this for the 3rd of march, so I will be able to spend more time on the development. After Friday I will work on things that need to be done for a basic working version with the features that are already displayed on the videos.

Alexis

  • Sr. Member
  • ****
  • Posts: 712
Thank you for keeping us up to date and your dedication.  Best wishes on your exams.
They are not lazy... just more efficient.


peterchen

  • Newbie
  • *
  • Posts: 7
looks wonderful :) but one question: will that be ported to ios, too? :D

kelsos

  • Sr. Member
  • ****
  • Posts: 302
Sorry for the lack of updates, I try at the moment to solve some connectivity issues on the application/plugin and also rewriting and cleaning my codebase. I am still not sure about the specific time that it will be ready, but as soon as I manage to fix the connectivity issues I will manage to get a test version out. As for iOS probably not. I wouldn't mind learning Objective-C, however Apple does not provide tools for development in any other platform than Mac OS.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34410
re: IOS, if someone is willing to do a nice HTML front end i can create a web-server plugin so you can remove control from your phone browser

silasje1

  • Member
  • Sr. Member
  • *****
  • Posts: 652
What you mean with HTML front-end? Like a router like interface?
HDMI GTX570->YAMAHA RX-V471->DALI ZENSOR 1

Dutch Translation

WMP 12 Skin

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34410
it would be building an HTML front end (that maybe looks like what kelsos did) that calls defined methods from a webserver (MB would have a plugin to make it act like a web-server) eg. when a play button is clicked, a function will be called

kelsos

  • Sr. Member
  • ****
  • Posts: 302
Ok first the application is in an Alpha state that means there are lots of possible issues.  The target version of Android is at least 2.2. The application at the moment has been tested on only 4.3" screen with 480x800 resolution. So I have no idea how it would work on smaller screen sizes and resolutions, if the application fails to display properly I would like a report including a screen shot along with a report of your device's screen resolution and size.

The application will probably have an impact on your battery life. The application uses a service for communication that starts running with the application's first startup and continues to run as long as the device operates. I plan to make it possible to close the service when exiting the application, but at the moment the only way to close it is through the Android operating system settings.

On the plugin side there is a known issue with the restart button. The restart button is supposed to restart the listening server when the user changes the listening port for the plugin. This is known to cause an exception that will lead in MusicBee closing. So at the moment when you change the listening port, you have to save the settings and restart MB manually.

The Playlist feature at the moment has a limit to up to 200 tracks. I am not sure about the actual limit but when I tried to pull a 5000+ track I couldn't get them through.

There is another known issue with the plugin that will cause a null object reference when connecting after being disconnected, this will also close MB. I am working on figuring out the exact cause of this.

Now on the client side there is a known issue of the client appearing connected (green indicator above the repeat) without being, if the issue is not caused by the issue above then, a known workaround is to close and open the wifi connection again.

The application uses the following permissions. Network communication, network state, wifi state, to communicate, and do various checks before trying to communicate. For example when the application detected that the wifi is connected appears to connect to MB. The Phone State is only used for a feature which when selected will reduce the player's volume to the 20% of the initial volume during an incoming call.   

Also security wise the application traffic is completely unencrypted, there is no handshake at the moment so every socket, client application can connect if it knows the ip/port where the plugin is listening. Also there is no limit on the IP addresses that can connect, so at the moment everyone is able to connect. If for example you don't have some type of Firewall/NAT system then I guess it would be possible for everyone to connect through the internet. These are things that I plan to solve in the future.

If you are ok with everything above then here is a link to download the alpha, plugin and apk: http://www.mediafire.com/?iu7b1ip69gc1zu2

To connect you have to put the plugin dll inside MB's plugin folder and start the plugin. The default listening port for the server is 3000 but you can change it. Then after installing the apk on your Android device you can open the application, go to the application settings and add the port (3000 if left unchanged or the port you used) and use the ip of the computer that runs MB with the plugin. The connect button can be used in case the auto connect won't work for whatever reason.

Feel free to report issues and suggest features.

----- Issues appear with small screen devices on the provided apk----

If the above apk keeps force closing in your device: this will probably work. http://www.mediafire.com/?kpp9kpquavle3f7 The only minus is that the notifications don't work.
Last Edit: April 03, 2012, 12:32:01 PM by kelsos

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34410
The Playlist feature at the moment has a limit to up to 200 tracks. I am not sure about the actual limit but when I tried to pull a 5000+ track I couldn't get them through.
if this is important for your application, it might be because you are using
NowPlayingList_QueryGetAllFiles()
try instead:
NowPlayingList_QueryFiles(null)
and loop using NowPlayingList_QueryGetNextFile()

silasje1

  • Member
  • Sr. Member
  • *****
  • Posts: 652
Hey,

some feedback:
App works fine inAndroid 4.0.4 with SEMC neo. I dont know how to set my ip or what i need to do on pc side? maybe some more clearer explanation please :)

otherwise it works fine and doesnt crash
HDMI GTX570->YAMAHA RX-V471->DALI ZENSOR 1

Dutch Translation

WMP 12 Skin

kelsos

  • Sr. Member
  • ****
  • Posts: 302
On the pc side if you don't change the default port you only need to install the plugin and know the ip address that the computer uses on the local network http://www.oldpapers.info/2007/finding-internal-ip-in-windows/ here is a link on who to find the internal ip on your LAN. Now on the client application you go to the Settings, and under connection Settings you put the IP on the field Hostname or IP and the port (3000 if you used the default) in the port field. Now go back to the main screen, and if the indicator on the upper right side is still red open the menu and press the connect button. When connected the indicator should be green.

Thanks Steven for the suggestion that's exactly the issue :)

silasje1

  • Member
  • Sr. Member
  • *****
  • Posts: 652
Works man! Windows 7 64 bits and SEMC (sony ericsson) Xperia Neo rooted on CM9 (android 4.0.4)

edit:
MusicBee v2.0.4474.11613 (Win6.1), 3 apr 2012 15:03:

System.ArgumentException: The IAsyncResult object was not returned from the corresponding asynchronous method on this class.
Parameter name: asyncResult
   at System.Net.Sockets.Socket.EndAccept(IAsyncResult asyncResult)
   at MusicBeePlugin.SocketServer.OnClientConnect(IAsyncResult ar)
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Net.ContextAwareResult.CompleteCallback(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.ContextAwareResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Sockets.Socket.CompleteAcceptResults(Object nullState)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

when pressing restart :(
Last Edit: April 03, 2012, 02:04:22 PM by Silas Arentsen (Silasje1)
HDMI GTX570->YAMAHA RX-V471->DALI ZENSOR 1

Dutch Translation

WMP 12 Skin

kelsos

  • Sr. Member
  • ****
  • Posts: 302
Yeah this is a known issue as noted above... I ll try to figure out why it happens as soon as possible. But thanks for reporting :)

kelsos

  • Sr. Member
  • ****
  • Posts: 302
Here is a newer version of the plugin: It will have fewer unhandled exceptions, and the number of supported tracks in the now playing list should be up to 500 tracks. http://www.mediafire.com/?cviceff9iia73iz