wear-os

OnDataChanged is never called

被刻印的时光 ゝ 提交于 2019-12-01 22:54:47
I am trying the dataitem APi and here is my code mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() { @Override public void onConnected(Bundle connectionHint) { Log.d("Inside", "onConnected: " + connectionHint); Toast.makeText(getApplicationContext(),"Inside On connected",Toast.LENGTH_SHORT).show(); // Now you can use the Data Layer API //Creating Dataitem PutDataMapRequest dataMapRequest = PutDataMapRequest.create("/count"); dataMapRequest.setUrgent(); DataMap datamap=dataMapRequest.getDataMap(); PutDataRequest putDataRequest

Can Android Wearable apps detect the power button as a KeyEvent?

↘锁芯ラ 提交于 2019-12-01 21:56:26
Can Android Wearable apps detect the power button as a KeyEvent or by other means? I would like to run a listener service to detect the wearable power button. I tried this but no log corresponding to a KeyEvent occurred. @Override public boolean onKeyDown(int keyCode, KeyEvent event) { Log.e(">>>>>>", "FindPhoneActivity event "+event); if (keyCode == KeyEvent.KEYCODE_POWER) { // Do something here... Log.e(">>>>>>", "FindPhoneActivity onKeyDown"); //event.startTracking(); // Needed to track long presses return true; } return super.onKeyDown(keyCode, event); } I have also experimented with two

Crash loading WearableActivity

懵懂的女人 提交于 2019-12-01 21:32:00
I am receiving a crash with the following message while migrating an AppCompatActivity to a WearableActivity. Caused by: java.lang.IllegalStateException: Could not find wearable shared library classes. Please add uses-library android:name="com.google.android.wearable" android:required="false" /> to the application manifest I was following this link for enabling ambient mode in my application: Keeping Your App Visible I have the following in my manifest and gradle respectively: <uses-library android:name="com.google.android.wearable" android:required="false" /> … minSdkVersion 22

GooglePlayServicesUtil: Google Play services out of date. Requires 5089000 but found 5077534

随声附和 提交于 2019-12-01 21:12:10
I have a problem with an update to the google-play-services SDK. My app builds and runs (as it did before) - but on the Android wear watch, this message is in the logs: GooglePlayServicesUtil﹕ Google Play services out of date. Requires 5089000 but found 5077534 So the app is compiling with 5.0.89 but the watch only has version 5.0.77. The communication between the watch and the phone now fails (it had worked previously). How would I make the app backwards compatible with earlier versions of google-play-services given that Android Studio doesn't provide a way to go back to earlier versions of

Android Wear Error ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null}

允我心安 提交于 2019-12-01 16:46:21
问题 I've wanted to make an easy wearable app and connect through the data layer. Everything works fine with the handheld module (using: S5), but the wearable (using: Moto 360) always throw the error: onConnectionFailed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null} The play services at the handheld are up-to-date I've added compile 'com.google.android.gms:play-services:7.3.0' to both, the handheld, as the wear build.gradle. The wearable Activity: @Override

Android wear app can't connect to google api services

℡╲_俬逩灬. 提交于 2019-12-01 14:46:59
I'm trying to set up a connection between Android Wear and an Android phone. The googleApiClient fails to connect, and returns a SERVICE_VERSION_UPDATE_REQUIRED status code. What am I doing wrong? Here's my Activity's code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); int conResult = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context); if(conResult!=ConnectionResult.SUCCESS){ Log.e(LOG_TAG,"Google play services are not available on this device"); } googleApiClient = new GoogleApiClient.Builder

Connection Failed=>ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null} Android Wear

扶醉桌前 提交于 2019-12-01 14:46:14
I am trying to get GPS coordinates from Android wear watch (moto 360 sport). As a first step towards it, I need to connect to GoogleApiClient. Below is the code for the same. But the connection to GoogleApiClient is always failing with the error message. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); setAmbientEnabled(); mContainerView = (BoxInsetLayout) findViewById(R.id.container); mTextView = (TextView) findViewById(R.id.text); mClockView = (TextView) findViewById(R.id.clock); mGoogleApiClient = new

Trying to send data from Android Tablet to Android Wear device and losing

冷暖自知 提交于 2019-12-01 14:03:20
I could really use some help. I'm having trouble getting my Android Wear device to recognize data changes made by my activity that runs on my Android tablet. I'm relatively new to Android and very new to the Wear APIs so I might be missing something completely obvious or trivial without realizing. I've pieced together a project from a couple of examples from the Android Wear doc pages and from the TwoToasters example on github. I just want to get data communication set up between the devices so that I can then edit the code in order to display images from my tablet on my Wear device.

Android wear app can't connect to google api services

て烟熏妆下的殇ゞ 提交于 2019-12-01 12:54:52
问题 I'm trying to set up a connection between Android Wear and an Android phone. The googleApiClient fails to connect, and returns a SERVICE_VERSION_UPDATE_REQUIRED status code. What am I doing wrong? Here's my Activity's code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); int conResult = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context); if(conResult!=ConnectionResult.SUCCESS){ Log.e(LOG_TAG,

Connection Failed=>ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null} Android Wear

喜你入骨 提交于 2019-12-01 12:06:43
问题 I am trying to get GPS coordinates from Android wear watch (moto 360 sport). As a first step towards it, I need to connect to GoogleApiClient. Below is the code for the same. But the connection to GoogleApiClient is always failing with the error message. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); setAmbientEnabled(); mContainerView = (BoxInsetLayout) findViewById(R.id.container); mTextView =