Is there any way to detect if the clock is round?

Update for API 23: To determine if the screen is round you can use context.getResources().getConfiguration().isScreenRound() Android reference Or you can use the round and notround resource qualifiers and let the system apply the proper resources but beware that this will not work on devices running API 22 or lower Source Thanks to people who pointed … Read more

Gradle error: configuration declares dependency which is not declared

In Android Studio 3.0 the documentation for Migrate to the New Plugin says: dependencies { // This is the old method and no longer works for local // library modules: // debugCompile project(path: ‘:foo’, configuration: ‘debug’) // releaseCompile project(path: ‘:foo’, configuration: ‘release’) // Instead, simply use the following to take advantage of // variant-aware dependency … Read more

Get Heart Rate from “Sensor” Samsung Gear Live

Here is a gist that shows how to read the heart rate sensor. The meat of it is: SensorManager mSensorManager = ((SensorManager)getSystemService(SENSOR_SERVICE)); Sensor mHeartRateSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE); Sensor mStepCountSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER); Sensor mStepDetectSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_STEP_DETECTOR); mSensorManager.registerListener(this, mHeartRateSensor, SensorManager.SENSOR_DELAY_NORMAL); mSensorManager.registerListener(this, mStepCountSensor, SensorManager.SENSOR_DELAY_NORMAL); mSensorManager.registerListener(this, mStepDetectSensor, SensorManager.SENSOR_DELAY_NORMAL); You will also need the following entry in the AndroidManifest.xml <uses-permission android:name=”android.permission.BODY_SENSORS” … Read more

Android Wear app not installing through handset

To Answer @odiggity specifically, in build.gradle file of your phone app, you should mention the exact name of the wear app folder. If you created the project in Android Studio, then your build.gradle should look like this: wearApp project(‘:wear’) This can happen because of the following reasons: Wear & Mobile app’s “permissions” are not same … Read more