From 97fde75ee48b22130d4985f5f0de94d5e0d99ed8 Mon Sep 17 00:00:00 2001 From: Cedric Priscal Date: Sun, 11 Nov 2012 15:27:08 +0100 Subject: [PATCH 1/2] Added support for Sony SmartWatch In order to build the project, you will need to download and import the Smart Extension SDK from http://developer.sonymobile.com/downloads/tool/smart-extension-sdk/ Supported features: - Display of the playing media on the watch - Single touch to Play/Pause - Swipe left to go backward by 30 seconds - Swipe right to go forward by 30 seconds - Swipe up to play previous media of the playlist - Swipe down to play the next media of the playlist --- AndroidManifest.xml | 30 ++ project.properties | 1 + res/drawable/ext_icon.png | Bin 0 -> 2139 bytes res/drawable/ext_icon_bw.png | Bin 0 -> 211 bytes .../smartextension/XbmcExtensionReceiver.java | 38 +++ .../XbmcExtensionRegistrationInformation.java | 120 ++++++++ .../smartextension/XbmcExtensionService.java | 63 ++++ .../XbmcSmartWatchControlExtension.java | 281 ++++++++++++++++++ 8 files changed, 533 insertions(+) create mode 100644 res/drawable/ext_icon.png create mode 100644 res/drawable/ext_icon_bw.png create mode 100644 src/org/xbmc/android/smartextension/XbmcExtensionReceiver.java create mode 100644 src/org/xbmc/android/smartextension/XbmcExtensionRegistrationInformation.java create mode 100644 src/org/xbmc/android/smartextension/XbmcExtensionService.java create mode 100644 src/org/xbmc/android/smartextension/XbmcSmartWatchControlExtension.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 1b0bd7cc..c9ab4ce8 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -27,6 +27,7 @@ + @@ -89,8 +90,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/project.properties b/project.properties index e5e4e95b..fded4dde 100755 --- a/project.properties +++ b/project.properties @@ -12,3 +12,4 @@ split.density=false # Project target. target=android-10 android.library.reference.1=../xbmc-jsonrpclib-android +android.library.reference.2=../SmartExtensionUtils diff --git a/res/drawable/ext_icon.png b/res/drawable/ext_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b9b2289c049dbc0b6f9f4aabfda7932bb07e15ba GIT binary patch literal 2139 zcmV-h2&DIkP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyw^ z05u-zdstKe00-MiL_t(o!|j(_j2y)khQF$=nx3BCogI(u9q+Q99bbq6b6I0=z{c3J z10>i+N+iUC{eV%pgo|Vp9wH-N5+#J7ghWBZZ^Rs;y7BLN90q;x&-@z z(OHR-Xsv{HH8RzxtR#vvI3h;*bz0LNPF7hdjEEy}q(*57!w^Rz;y4l*WE2IiBSmlA zj(UC1U(!{`ukH4`nOiKhuUWV1U2E<4gb>diKW?S!xL|%scek%-2FiyGC$?Wlxqk_dJ~|9Q1U&q! zw|L;2Ln7a?#nx?)bH%c?&Uf!#1;D>FH}RJ%Ty;fTy0`$iWW>*>uq#Sa_Z0&a3a} z9MWfwvGS4v>#m%K0(LxkfYq1I<>niQST{VM*G6IIZ};)Sox=SHC*TR@KWyZ+n zoAfO`#in(y0v$s6o^HzXFJNe>GqsoXC|Al1Egu4))CZ-$5+H?;N_g3<=co|7x3O z^1xTt3L%=zWIceGT4Pj7IT1C((TPt^1ml0XOdQ-bWUB}JYE05(D}E5Pwcc*wUc8$a*fWU!WQ*64gy4yQxy-t&bC4Io9NG-D4yv5Ed&*R9r&F z^QOW5U1$Aon{#WK#$7Vp)1TjD<7oK$E0?Vq=wGO!G!+@wMMwwfxJW5Q7{%nfav(dY z-gPAohA3{KjG@q_(Ke!6C+MVMJtEw=X$vmamob{edS17B?pXfOdw=rqcXonv52T+V zKY9kb<_+FN#<_YR?_RrNc;kW?Hx)`c%F#%ra2$=B(WHPQRma69K{*z!9IGT&nAm0< z&^8pBM7TtvM})ZX6kaq&g@4qS6~~@u2hUOf@x3qTDHrnkJPsTz8ttt5ZANfKwsR2F&M?uxH@o&b!3P7q9f)?l}pe zlO_qIX_^=(0@K38VJdZiQ~`#-js1pjT7irRf}k2gD}=FVCO;;eD-A!Vral{4=$TEf z(1Y8P$;v2gg{>4+f(+X<+%`1YFdldIkeE)S*w4H8e|s4a=kG-4aUTB<_$Ny3cC?t! Rc_IJ+002ovPDHLkV1h1B6;S{H literal 0 HcmV?d00001 diff --git a/res/drawable/ext_icon_bw.png b/res/drawable/ext_icon_bw.png new file mode 100644 index 0000000000000000000000000000000000000000..8c8194c1af52ffe481c58c81c270125130f27ba7 GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh@3?y?HWJG`zV{wqX6T`Z5GB1G~wg8_HS0MfW z|No^o=iddgI14-?iy0WWg+Z8+Vb&Z8pdfpRr>`sf9d0fLPL-IJACf>J$r9Iy66gHf z+|;}h2Ir#G#FEq$h4Rdj3?M5RU7~2@Fh|*%a&;j_^19U>5k# w@W|fb4}Zsh=a2R)Zt$;|#U5bGs~{}FP}(P$?0?!q9;lPS)78&qol`;+06Xh9+yDRo literal 0 HcmV?d00001 diff --git a/src/org/xbmc/android/smartextension/XbmcExtensionReceiver.java b/src/org/xbmc/android/smartextension/XbmcExtensionReceiver.java new file mode 100644 index 00000000..f2ad4b3a --- /dev/null +++ b/src/org/xbmc/android/smartextension/XbmcExtensionReceiver.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 Cedric Priscal + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC Remote; see the file license. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +package org.xbmc.android.smartextension; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.os.Build.VERSION; + +public class XbmcExtensionReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + if (VERSION.SDK_INT >= 7) { + intent.setClass(context, XbmcExtensionService.class); + context.startService(intent); + } + } + +} diff --git a/src/org/xbmc/android/smartextension/XbmcExtensionRegistrationInformation.java b/src/org/xbmc/android/smartextension/XbmcExtensionRegistrationInformation.java new file mode 100644 index 00000000..a5efb841 --- /dev/null +++ b/src/org/xbmc/android/smartextension/XbmcExtensionRegistrationInformation.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2012 Cedric Priscal + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC Remote; see the file license. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +package org.xbmc.android.smartextension; + +import android.content.ContentValues; +import android.content.Context; + +import com.sonyericsson.extras.liveware.aef.registration.Registration; +import com.sonyericsson.extras.liveware.extension.util.ExtensionUtils; +import com.sonyericsson.extras.liveware.extension.util.registration.RegistrationInformation; +import com.sonyericsson.extras.liveware.sdk.R; + +public class XbmcExtensionRegistrationInformation extends + RegistrationInformation { + + final Context mContext; + + protected XbmcExtensionRegistrationInformation(Context context) { + if (context == null) { + throw new IllegalArgumentException("context == null"); + } + mContext = context; + } + + /* + * (non-Javadoc) + * + * @see com.sonyericsson.extras.liveware.extension.util.registration. + * RegistrationInformation#getRequiredNotificationApiVersion() + */ + @Override + public int getRequiredNotificationApiVersion() { + return API_NOT_REQUIRED; + } + + /* + * (non-Javadoc) + * + * @see com.sonyericsson.extras.liveware.extension.util.registration. + * RegistrationInformation#getExtensionRegistrationConfiguration() + */ + @Override + public ContentValues getExtensionRegistrationConfiguration() { + ContentValues values = new ContentValues(); + + values.put(Registration.ExtensionColumns.NAME, + mContext.getString(R.string.app_name)); + values.put(Registration.ExtensionColumns.EXTENSION_KEY, + XbmcExtensionService.EXTENSION_KEY); + values.put(Registration.ExtensionColumns.HOST_APP_ICON_URI, + ExtensionUtils.getUriString(mContext, R.drawable.icon)); + values.put(Registration.ExtensionColumns.EXTENSION_ICON_URI, + ExtensionUtils.getUriString(mContext, R.drawable.ext_icon)); + values.put( + Registration.ExtensionColumns.EXTENSION_ICON_URI_BLACK_WHITE, + ExtensionUtils.getUriString(mContext, R.drawable.ext_icon_bw)); + values.put(Registration.ExtensionColumns.NOTIFICATION_API_VERSION, + getRequiredNotificationApiVersion()); + values.put(Registration.ExtensionColumns.PACKAGE_NAME, + mContext.getPackageName()); + + return values; + } + + /* + * (non-Javadoc) + * + * @see com.sonyericsson.extras.liveware.extension.util.registration. + * RegistrationInformation#getRequiredWidgetApiVersion() + */ + @Override + public int getRequiredWidgetApiVersion() { + return API_NOT_REQUIRED; + } + + /* + * (non-Javadoc) + * + * @see com.sonyericsson.extras.liveware.extension.util.registration. + * RegistrationInformation#getRequiredControlApiVersion() + */ + @Override + public int getRequiredControlApiVersion() { + return 1; + } + + /* + * (non-Javadoc) + * + * @see com.sonyericsson.extras.liveware.extension.util.registration. + * RegistrationInformation#getRequiredSensorApiVersion() + */ + @Override + public int getRequiredSensorApiVersion() { + return API_NOT_REQUIRED; + } + + @Override + public boolean isDisplaySizeSupported(int width, int height) { + return true; + } +} diff --git a/src/org/xbmc/android/smartextension/XbmcExtensionService.java b/src/org/xbmc/android/smartextension/XbmcExtensionService.java new file mode 100644 index 00000000..5ef01169 --- /dev/null +++ b/src/org/xbmc/android/smartextension/XbmcExtensionService.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2012 Cedric Priscal + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC Remote; see the file license. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +package org.xbmc.android.smartextension; + +import android.util.Log; + +import com.sonyericsson.extras.liveware.extension.util.ExtensionService; +import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; +import com.sonyericsson.extras.liveware.extension.util.registration.RegistrationInformation; + +public class XbmcExtensionService extends ExtensionService { + + public static final String EXTENSION_KEY = "org.xbmc.android.smartextension"; + private static final String LOG_TAG = "XbmcExtensionService"; + + public XbmcExtensionService() { + super(EXTENSION_KEY); + Log.d(LOG_TAG, "Starting XbmcExtensionService"); + } + + /* (non-Javadoc) + * @see com.sonyericsson.extras.liveware.extension.util.ExtensionService#getRegistrationInformation() + */ + @Override + protected RegistrationInformation getRegistrationInformation() { + return new XbmcExtensionRegistrationInformation(this); + } + + /* (non-Javadoc) + * @see com.sonyericsson.extras.liveware.extension.util.ExtensionService#keepRunningWhenConnected() + */ + @Override + protected boolean keepRunningWhenConnected() { + return false; + } + + /* (non-Javadoc) + * @see com.sonyericsson.extras.liveware.extension.util.ExtensionService#createControlExtension() + */ + @Override + public ControlExtension createControlExtension(String hostAppPackageName) { + return new XbmcSmartWatchControlExtension(this, hostAppPackageName); + } + +} diff --git a/src/org/xbmc/android/smartextension/XbmcSmartWatchControlExtension.java b/src/org/xbmc/android/smartextension/XbmcSmartWatchControlExtension.java new file mode 100644 index 00000000..a138abff --- /dev/null +++ b/src/org/xbmc/android/smartextension/XbmcSmartWatchControlExtension.java @@ -0,0 +1,281 @@ +/* + * Copyright (C) 2012 Cedric Priscal + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC Remote; see the file license. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +package org.xbmc.android.smartextension; + +import org.xbmc.android.remote.business.ManagerFactory; +import org.xbmc.android.remote.business.NowPlayingPollerThread; +import org.xbmc.android.util.ConnectionFactory; +import org.xbmc.api.business.DataResponse; +import org.xbmc.api.business.IControlManager; +import org.xbmc.api.business.IEventClientManager; +import org.xbmc.api.data.IControlClient.ICurrentlyPlaying; +import org.xbmc.api.info.PlayStatus; +import org.xbmc.eventclient.ButtonCodes; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.os.Bundle; +import android.os.Handler; +import android.os.Handler.Callback; +import android.os.Message; +import android.util.DisplayMetrics; +import android.util.Log; +import android.view.ViewGroup.LayoutParams; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import com.sonyericsson.extras.liveware.aef.control.Control; +import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; +import com.sonyericsson.extras.liveware.extension.util.control.ControlTouchEvent; +import com.sonyericsson.extras.liveware.sdk.R; + +public class XbmcSmartWatchControlExtension extends ControlExtension implements + Callback { + + // DEBUG + private static final String LOG_TAG = "XbmcSmartWatchControlExtension"; + // Connection with XBMC + private final IEventClientManager mEventClientManager; + private final IControlManager mControlManager; + // PLAYING STATUS + private Handler mNowPlayingHandler; + private int mLastPosition; + private int mPlayStatus; + private int mPlayListId; + //private String mTitle; + //private String mArtist; + //private String mAlbum; + //private int mProgressPosition; + // GUI + private final int mWidth; + private final int mHeight; + private final LinearLayout mLayout; + private final Bitmap mBackground; + private final Canvas mCanvas; + // private final TextView mTitleView; + private final ImageView mCoverView; + private final LayoutParams mLayoutParams; + + public XbmcSmartWatchControlExtension(Context context, + String hostAppPackageName) { + super(context, hostAppPackageName); + mNowPlayingHandler = new Handler(this); + mControlManager = ManagerFactory.getControlManager(null); + mEventClientManager = ManagerFactory.getEventClientManager(null); + mWidth = context.getResources().getDimensionPixelSize( + R.dimen.smart_watch_control_width); + mHeight = context.getResources().getDimensionPixelSize( + R.dimen.smart_watch_control_height); + mLayoutParams = new LayoutParams(mWidth, mHeight); + + // Create background bitmap for drawing. + mBackground = Bitmap.createBitmap(mWidth, mHeight, + Bitmap.Config.RGB_565); + // Set default density to avoid scaling. + mBackground.setDensity(DisplayMetrics.DENSITY_DEFAULT); + mCanvas = new Canvas(mBackground); + + mLayout = new LinearLayout(context); + // mTitleView = new TextView(context); + mCoverView = new ImageView(context); + mCoverView.setImageResource(R.drawable.coverbox_back); + mCoverView.setLayoutParams(mLayoutParams); + + mLayout.setLayoutParams(mLayoutParams); + mLayout.addView(mCoverView); + // mLayout.addView(mTitleView); + } + + @Override + public void onResume() { + setScreenState(Control.Intents.SCREEN_STATE_ON); + refresh(); + } + + @Override + public void onPause() { + } + + @Override + public void onStart() { + new Thread("nowplaying-spawning") { + @Override + public void run() { + ConnectionFactory.getNowPlayingPoller( + mContext.getApplicationContext()).subscribe( + mNowPlayingHandler); + } + }.start(); + } + + @Override + public void onStop() { + ConnectionFactory.getNowPlayingPoller(mContext.getApplicationContext()) + .unSubscribe(mNowPlayingHandler); + } + + private void refresh() { + mLayout.measure(mWidth, mHeight); + mLayout.layout(0, 0, mLayout.getMeasuredWidth(), + mLayout.getMeasuredHeight()); + mBackground.eraseColor(0); + mLayout.draw(mCanvas); + + showBitmap(mBackground); + } + + @Override + public void onTouch(ControlTouchEvent event) { + switch (event.getAction()) { + case Control.Intents.TOUCH_ACTION_RELEASE: + // Play/Pause + switch (mPlayStatus) { + case PlayStatus.PLAYING: + mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_PAUSE, + false, true, true, (short) 0, (byte) 0); + break; + case PlayStatus.PAUSED: + mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_PLAY, + false, true, true, (short) 0, (byte) 0); + break; + case PlayStatus.STOPPED: + final DataResponse doNothing = new DataResponse(); + mControlManager.setPlaylistId(doNothing, mPlayListId < 0 ? 0 + : mPlayListId, mContext.getApplicationContext()); + mControlManager.setPlaylistPos(doNothing, mLastPosition < 0 ? 0 + : mLastPosition, mContext.getApplicationContext()); + break; + } + break; + case Control.Intents.TOUCH_ACTION_LONGPRESS: + // Stop + mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_STOP, false, true, true, + (short) 0, (byte) 0); + setScreenState(Control.Intents.SCREEN_STATE_AUTO); + break; + } + } + + @Override + public void onSwipe(int direction) { + switch (direction) { + case Control.Intents.SWIPE_DIRECTION_RIGHT: + // forward + mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_RIGHT, false, true, true, + (short) 0, (byte) 0); + break; + + case Control.Intents.SWIPE_DIRECTION_LEFT: + // backward + mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_LEFT, false, true, true, + (short) 0, (byte) 0); + break; + + case Control.Intents.SWIPE_DIRECTION_UP: + // Previous element in playlist + mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_SKIP_MINUS, false, true, true, + (short) 0, (byte) 0); + break; + + case Control.Intents.SWIPE_DIRECTION_DOWN: + // Next element in playlist + mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_SKIP_PLUS, false, true, true, + (short) 0, (byte) 0); + break; + } + } + + public boolean handleMessage(Message msg) { + + final Bundle data = msg.getData(); + final ICurrentlyPlaying currentlyPlaying = (ICurrentlyPlaying) data + .getSerializable(NowPlayingPollerThread.BUNDLE_CURRENTLY_PLAYING); + + Log.d(LOG_TAG, "handleMessage: " + msg.what); + + switch (msg.what) { + + case NowPlayingPollerThread.MESSAGE_PROGRESS_CHANGED: + mPlayStatus = currentlyPlaying.getPlayStatus(); + //mProgressPosition = Math.round(currentlyPlaying.getPercentage()); + if (currentlyPlaying.isPlaying()) { + Log.d(LOG_TAG, "PROGRESS_CHANGED => play"); + } else { + Log.d(LOG_TAG, "PROGRESS_CHANGED => stop/pause"); + } + refresh(); + return true; + + case NowPlayingPollerThread.MESSAGE_PLAYLIST_ITEM_CHANGED: + //mTitle = currentlyPlaying.getTitle(); + //mArtist = currentlyPlaying.getArtist(); + //mAlbum = currentlyPlaying.getAlbum(); + mLastPosition = data + .getInt(NowPlayingPollerThread.BUNDLE_LAST_PLAYPOSITION); + refresh(); + return true; + + case NowPlayingPollerThread.MESSAGE_PLAYSTATE_CHANGED: + mPlayListId = data + .getInt(NowPlayingPollerThread.BUNDLE_LAST_PLAYLIST); + refresh(); + return true; + + case NowPlayingPollerThread.MESSAGE_COVER_CHANGED: + Bitmap b = ConnectionFactory.getNowPlayingPoller( + mContext.getApplicationContext()).getNowPlayingCover(); + if (b != null) { + mCoverView.setImageBitmap(b); + } else { + mCoverView.setImageResource(R.drawable.coverbox_back); + } + refresh(); + return true; + + case NowPlayingPollerThread.MESSAGE_CONNECTION_ERROR: + mPlayStatus = PlayStatus.UNKNOWN; + Log.w(LOG_TAG, "Received connection error from poller!"); + refresh(); + return true; + + case NowPlayingPollerThread.MESSAGE_RECONFIGURE: + mPlayStatus = PlayStatus.UNKNOWN; + new Thread() { + public void run() { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + Log.e(LOG_TAG, Log.getStackTraceString(e)); + } + ConnectionFactory.getNowPlayingPoller( + mContext.getApplicationContext()).subscribe( + mNowPlayingHandler); + } + }.start(); + return true; + + default: + return false; + } + } + +} From 8995c7339dbc6cb65fa483e7f8b05b6e0b307bc8 Mon Sep 17 00:00:00 2001 From: Cedric Priscal Date: Sun, 23 Dec 2012 10:46:56 -0800 Subject: [PATCH 2/2] Added support for Sony SmartWatch Fixed some imports for resources. --- .../XbmcExtensionRegistrationInformation.java | 6 +++--- .../smartextension/XbmcSmartWatchControlExtension.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/org/xbmc/android/smartextension/XbmcExtensionRegistrationInformation.java b/src/org/xbmc/android/smartextension/XbmcExtensionRegistrationInformation.java index a5efb841..6475989f 100644 --- a/src/org/xbmc/android/smartextension/XbmcExtensionRegistrationInformation.java +++ b/src/org/xbmc/android/smartextension/XbmcExtensionRegistrationInformation.java @@ -66,12 +66,12 @@ public ContentValues getExtensionRegistrationConfiguration() { values.put(Registration.ExtensionColumns.EXTENSION_KEY, XbmcExtensionService.EXTENSION_KEY); values.put(Registration.ExtensionColumns.HOST_APP_ICON_URI, - ExtensionUtils.getUriString(mContext, R.drawable.icon)); + ExtensionUtils.getUriString(mContext, org.xbmc.android.remote.R.drawable.icon)); values.put(Registration.ExtensionColumns.EXTENSION_ICON_URI, - ExtensionUtils.getUriString(mContext, R.drawable.ext_icon)); + ExtensionUtils.getUriString(mContext, org.xbmc.android.remote.R.drawable.ext_icon)); values.put( Registration.ExtensionColumns.EXTENSION_ICON_URI_BLACK_WHITE, - ExtensionUtils.getUriString(mContext, R.drawable.ext_icon_bw)); + ExtensionUtils.getUriString(mContext, org.xbmc.android.remote.R.drawable.ext_icon_bw)); values.put(Registration.ExtensionColumns.NOTIFICATION_API_VERSION, getRequiredNotificationApiVersion()); values.put(Registration.ExtensionColumns.PACKAGE_NAME, diff --git a/src/org/xbmc/android/smartextension/XbmcSmartWatchControlExtension.java b/src/org/xbmc/android/smartextension/XbmcSmartWatchControlExtension.java index a138abff..7fb7279a 100644 --- a/src/org/xbmc/android/smartextension/XbmcSmartWatchControlExtension.java +++ b/src/org/xbmc/android/smartextension/XbmcSmartWatchControlExtension.java @@ -20,6 +20,7 @@ package org.xbmc.android.smartextension; +import org.xbmc.android.remote.R; import org.xbmc.android.remote.business.ManagerFactory; import org.xbmc.android.remote.business.NowPlayingPollerThread; import org.xbmc.android.util.ConnectionFactory; @@ -46,7 +47,6 @@ import com.sonyericsson.extras.liveware.aef.control.Control; import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension; import com.sonyericsson.extras.liveware.extension.util.control.ControlTouchEvent; -import com.sonyericsson.extras.liveware.sdk.R; public class XbmcSmartWatchControlExtension extends ControlExtension implements Callback { @@ -82,9 +82,9 @@ public XbmcSmartWatchControlExtension(Context context, mControlManager = ManagerFactory.getControlManager(null); mEventClientManager = ManagerFactory.getEventClientManager(null); mWidth = context.getResources().getDimensionPixelSize( - R.dimen.smart_watch_control_width); + com.sonyericsson.extras.liveware.extension.util.R.dimen.smart_watch_control_width); mHeight = context.getResources().getDimensionPixelSize( - R.dimen.smart_watch_control_height); + com.sonyericsson.extras.liveware.extension.util.R.dimen.smart_watch_control_height); mLayoutParams = new LayoutParams(mWidth, mHeight); // Create background bitmap for drawing.