Wednesday, March 23, 2011

More laziness with the XBMC Remote Android App

The XBMC android app is great. I mean really really great. It might just be the best android app on my shiny new Atrix. There is/was one problem though. While the wake on LAN properly wakes my box up, the app has no suspend feature.

Hmm... eerily similar to the situation I ran into a few weeks ago. Luckily the app is GPL and I can have a go at fixing things.

XBMC has a secure auth http port exposed and a second unauthed raw command port for LAN only use. The patch below adds a suspend function that sends json to the raw port, and adds a button on the home screen to call the new function. For now this is just a simple get it done hack (hardcoded hostname/port, not following the code style/convention), but it would be cool to build a nice full featured "Shutdown" menu that enables exit, shutdown, suspend, etc. functionality.

Maybe later. Need sleep now... Self.Suspend()

$ svn di src/org/xbmc/android/remote/presentation/controller/
Index: src/org/xbmc/android/remote/presentation/controller/
--- src/org/xbmc/android/remote/presentation/controller/ (revision 759)
+++ src/org/xbmc/android/remote/presentation/controller/ (working copy)
@@ -21,6 +21,11 @@


import java.util.ArrayList;
import java.util.HashMap;
import java.util.Observable;
@@ -103,8 +108,8 @@
private static final int HOME_ACTION_RECONNECT = 5;
private static final int HOME_ACTION_WOL = 6;
private static final int HOME_ACTION_TVSHOWS = 7;
+ private static final int HOME_ACTION_SUSPEND = 8;

private IInfoManager mInfoManager;

private static final String TAG = "HomeController";
@@ -229,6 +234,7 @@
homeItems.add(new HomeItem(HOME_ACTION_NOWPLAYING, R.drawable.icon_home_playing, "Now Playing", "See what's"));
+ homeItems.add(new HomeItem(HOME_ACTION_SUSPEND, R.drawable.icon_home_power, "Suspend", "Invoke"));

final ArrayList offlineItems = new ArrayList();
@@ -310,6 +316,9 @@
+ doSuspend();
+ break;
if (intent != null) {
@@ -318,6 +327,18 @@

+ private void doSuspend() {
+ try {
+ final Socket mySocket = new Socket("myth.lan", 9090);
+ final PrintWriter out = new PrintWriter(mySocket.getOutputStream(), true);
+ out.println("{\"jsonrpc\": \"2.0\", \"method\": \"System.Suspend\", \"id\": \"1\"}'jsonrpc': \"2.0\", 'method': \"VideoLibrary.ScanForContent\", 'id': \"1\"");
+ out.close();
+ mySocket.close();
+ } catch (IOException e) {
+ }
public void update(Observable observable, Object data) {
if (data instanceof BroadcastListener.Event) {
BroadcastListener.Event event = (BroadcastListener.Event)data;


At December 31, 2021 at 10:56 PM , Blogger unknown said...

Thankyou for sharing.
Universal remote codes

At January 1, 2022 at 12:28 AM , Blogger unknown said...

visit eagleapk and download gloud games mod apk for free. you can also download other mod apks and games

At January 1, 2022 at 1:06 AM , Blogger unknown said...

visit our website fromscratchmag and read guides online and magazines

At January 3, 2022 at 6:38 AM , Blogger unknown said...

visit site and download letspush plugin. Web Push Notification plugin for Wordpress, Woocommerece and BuddyPress.

At January 3, 2022 at 6:39 AM , Blogger unknown said...

Free download ThopTV Pro APK file latest version v45.9.0 for Android and watch live TV channels, movies, series, radio, TV shows

At January 3, 2022 at 6:39 AM , Blogger unknown said...

Thankyou for your kind information.

At February 6, 2022 at 7:57 AM , Blogger unknown said...

thanks for your kind information. visit our blog and check guide of best golf grips

At February 14, 2022 at 10:09 AM , Blogger unknown said...

Thankyou for sharing. visit our website and read best gpu for ryzen 5 3400g
also check genyoutube download photo

At May 14, 2022 at 1:16 PM , Blogger unknown said...

Thanks for sharing. visit our website and get universal remote codes for sanyo tv with Instructions

At May 21, 2022 at 3:38 PM , Blogger unknown said...

MacBook Air is a strong computer and can play several games without damaging any hardware or software. However, it should only be used for casual gaming and not excessive gaming. If you intend to spend the whole day playing video games, you should not use your MacBook Air.

At May 22, 2022 at 12:20 AM , Blogger my website said...

I was looking for another article by chance and found your article I am writing on this topic, so I think it will help a lot. I leave my blog address below. Please visit once.

At May 22, 2022 at 12:21 AM , Blogger my website said...

you have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site

At May 29, 2022 at 11:03 AM , Blogger unknown said...

Are you thinking about Assisted Living Costs?

It can be paid up front or prorated monthly. It usually runs between $1,000 and $5,000. What should you look for in a contract? Pricing is usually broken down into rent and services. check more details about Assisted living Seattle

At December 22, 2022 at 6:01 AM , Blogger hlb8sbodfo said...

For example, if a participant bets $1, spins the reels and receives no payout, that’ll be the worth – not 10 cents. What about slot machines makes them such 로스트아크 reliable cash makers? In part, it has something to do with casinos’ ability to cover their true value from even the savviest of gamblers. The inaugural video games in the highly-anticipated James Bond collection second are|are actually} available! The video games are offered in each a near-area progressive model, properly as|in addition to} a model contains a|that options a} single-level wide-area progressive that's {part of|a part of} Scientific Games’ Cash Connection® or Reel Adventures™ WAP hyperlinks.

At January 20, 2023 at 1:04 AM , Blogger 82gn0szya6 said...

That is why one must be very attentive when on the lookout for Korean casino websites. When selecting the best on-line casino Korea residents ought to follow expert recommendations. Due to 카지노사이트 those causes, DoubleU Casino, a world top-tier social casino developer, doesn't provide services in Korea - where its headquarters is positioned. Secondly, most Korean folks - including those who are cost of|in command of|in management of} nationwide coverage - have a tendency to think that more folks will suffer from gambling habit if regulations for on-line gambling are relaxed.


Post a Comment

Subscribe to Post Comments [Atom]

<< Home