I am currently developing a simple application in which i needed to send data from mobile to watch which is working perfectly ... i have done this by using shared preference way..but problem is when device is in not sleep condition then it will show previous data so i have to make some move and have to call onresume method then it will perfectly .... so what i want basically is triggering smart watch (forcefully show screen) when i click on the button of android app and also what i want is quit from app when i leave app from the mobile .... here is code which is working for me on resume event
@Override
public void onResume()
{
Log.d("watch on ", "onResume");
setScreenState(Control.Intents.SCREEN_STATE_ON);
SharedPreferences pref = mContext.getSharedPreferences("text", Context.MODE_PRIVATE);
String text = pref.getString("textToDisplay", "test");
Bundle bundle1 = new Bundle();
bundle1.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.txtvSWText);
bundle1.putString(Control.Intents.EXTRA_TEXT, text);
Bundle[] bundleData = new Bundle[1];
bundleData[0] = bundle1;
showLayout(R.layout.sample_control_2, bundleData);
}
if u still have doubts let me know...i will try to explain more... any help on this will be appreciated
Thanks