wear-os

Huawei Watch 2 NFC FEATURE not available?. Android Wear 2.0

好久不见. 提交于 2019-11-29 07:58:30
In short: On the Huawei Watch 2 it seems like NFC is available and enabled but NFC_FEAUTURE is not, hence nfc is not working properly. Trying to develop the ability to simply read and display NFC tags on the Huawei Watch 2 raises some difficulties: mNfcAdapter.enableForegroundDispatch(this,nfcPendingIntent, nfcIntentFilter, null); raises the error java.lang.UnsupportedOperationException That implies the FEATURE_NFC is not available. In MainActivity onCreate(): mNfcAdapter = NfcAdapter.getDefaultAdapter(this); //NfcAdapter mNfcAdapter if (mNfcAdapter != null) { // Check if device supports NFC

How to display clear background image on Android Wear notification?

谁说胖子不能爱 提交于 2019-11-29 07:07:44
As far as I can work out, there are two ways to set the background image for a notification in Android Wear. For the record, both start with: Bitmap bitmap; Notification.Builder bob = new Notification.Builder(this) .setContentTitle(title) ...and so on to set up the notification. Also assume that bitmap has been initialized to an appropriately-sized image (though that's another issue). Method 1: bob.setLargeIcon(bitmap); This works, but AFAICT bitmap is always blurred-out in the background of the notification, regardless of its size. Method 2: bob.setStyle(new Notification.BigPictureStyle()

Android Wear Custom Voice Actions

我与影子孤独终老i 提交于 2019-11-29 06:31:09
I'm making an app that will work with Android Wear, And I wanted to implement a command into Google's "Ok Google" option. I saw this page: http://developer.android.com/training/wearables/apps/voice.html But it's related only to apps that include Activities in the Android Wear. I wanted to ask: Can I add custom commands? I mean, those who does not start with the word "Start"? Can I add commands that will do another thing than just opening the app? Like running a method? If it's not the place to ask this, can you give me an email/link to Google Developers help/support? thanks. For apps that run

Error: more than one library with package name 'com.google.android.gms'

两盒软妹~` 提交于 2019-11-29 03:48:10
I'm using Android Studio 0.8.2, and created a project with Android 4.1 and Android Wear 4.4. I need to integrate it with Google Play Services. I'm trying to follow the Google Play Services setup page for Android Studio here: https://developer.android.com/google/play-services/setup.html In Step 2, it says to add this dependency: compile 'com.google.android.gms:play-services:5.0.77' However, upon Sync, I get this message: Error:Execution failed for task ':mobile:processDebugResources'. > Error: more than one library with package name 'com.google.android.gms' You can temporarily disable this

GoogleApiClient onConnected never called on Wearable device

好久不见. 提交于 2019-11-29 02:48:51
I have a wearable device that I'm trying to connect to the GoogleApiClient but the callbacks are never called (onConnected, onConnectionSuspended or onConnectionFailed). Everything else is working fine, the DataLayerListenerService is able to receive messages from the handheld and the onPeerConnected is being called when it connects. I've tried in on both the emulator and a Samsung Gear Live device. This is the code that I have in the Activity where I'm trying to connect to the GoogleApiClient. public class WearReaderActivity extends Activity implements GoogleApiClient.ConnectionCallbacks,

adb doesn't recognize samsung gear live or lg g watch

浪子不回头ぞ 提交于 2019-11-29 01:34:20
问题 I am trying to execute adb on samsung gear live watch on windows 7. I don't seem to find device drivers to get it recognized by adb. This is what I already have - I have enabled adb debugging in gear live already I went to device manager and pointed device driver location for gear live to sdk\extras\google\usb_driver No luck. adb devices yields no results. I don't seem to find device driver elsewhere for windows 7. 回答1: I'm running Windows 8.1 and this method worked perfectly fine: Open your

How to disable the android wear back swipe?

家住魔仙堡 提交于 2019-11-28 23:19:20
I am creating a Android Wear app that has an touch area. The user is suppose to be able to move it's finger in all directions over the screen (Think touchpad on your laptop). However the back swipe makes this a bit problematic. Any help with getting around this issue would be a great help. How to disable the android wear back swipe? /Jakob Maciej Ciemięga There is an attribute in window style to disable this behavior: <style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light"> <item name="android:windowSwipeToDismiss">false</item> </style> Once you disable it you have to provide

Wear App and with custom build type with applicationIdSuffix

这一生的挚爱 提交于 2019-11-28 23:04:01
I have an app where I'd like to add an Android Wear app extension. The main app has three build types (debug, beta and release). Beta builds have an applicationIdSuffix which allows me to install the play-store version and the current development version in parallel on the same device. This all worked fine until I added the wear app. The main app`s build.gradle looks like this: apply plugin: 'com.android.application' android { ... defaultConfig { ... applicationId "com.example.mainApp" ... } buildTypes { debug { applicationIdSuffix '.debug' } beta { applicationIdSuffix '.beta' } release { } }

What's the best practice for sharing classes between a Wear and Android app?

北城余情 提交于 2019-11-28 21:11:01
问题 I'm using a class that I serialize in my Android Phone app, and deserialize in my Android Wear app. They are both in the same Android Studio Project, and are deployed as one. How can I share the class between the two without having a copy of the class in each package? Right now I'm copy/pasting it, but is there any way for me to include it in both apps? The directory structure being: ./ mobile/ ...src/etc wear/ ...src/etc How do I handle common classes? 回答1: You can create a new "Android

Android Wear Data Items

半世苍凉 提交于 2019-11-28 20:58:12
I'm trying to figure out how to sync some data from the phone to the Android Wear device and I've read the article on developer.android.com on Data Items however I'm still not clear on exactly how to use them. Specifically where each code segment (the GoogleApiClient, the Sync, and the Listen) should be implemented both where in the flow of the app code and on which device, phone or wear, or both. Link to developer.android.com page Maciej Ciemięga Have you looked at the samples for API 20? There is a nice demonstration of DataApi usage in DataLayer sample located here: {android-sdk-root}