wear-os

Sending data from an Activity to WearableListenerService

橙三吉。 提交于 2019-11-30 09:42:14
When I read about communication between an Activity and Service , I found that we can use either IBinder Messenger AIDL I am interested in the first two. So when I tried implementing this to communicate between an Activity and WearableListenerService , I needed to override the onBind function. But then, I am getting a compiler error saying it cannot override final method "onBind" I dont get such an error when I use a normal Service . So, 1. Does that mean we cannot use IBinder or Messenger approach to communicate with the WearableListenerService from an Activity ? 2. If so, what is the next

Does Android Wear support HttpURLConnection - getting EOFException

只愿长相守 提交于 2019-11-30 09:21:42
I am wondering if we can access the network through HttpURLConnection from Android Wear ? I tried using HttpURLConnection inside Wear code, I am getting EOFException . The same code works from regular Android phone. It only has problem when it is on Android Wear. If HttpURLConnection is not supported on Wear, should we use Apache Http client or something else? Or perhaps the way I am launching the app for development is incorrect? URL url = new URL(myurl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(10000 /* milliseconds */); conn.setConnectTimeout

Round Android Wear Emulator is Square

≡放荡痞女 提交于 2019-11-30 08:19:40
The title and picture say it all--my round android wear emulator shows the rect layout. I'd appreciate any tips that help me get the round emulator to show the correct interface. Created AVD using instructions from: Android Documentation Android Studio 0.8.1 Beta, SDK Tools 23.0.2, Wear target is 4.4W(API 20) Creating the AVD using Wayne's Command Line method created an AVD that shows the correct UI Make sure when you create you AVD that you select the following options for a round emulator: Device: Android Wear Round (320 x 320: hdpi) Target: Android 4.4W - API Level 20 CPU/ABI: Android Wear

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

烂漫一生 提交于 2019-11-30 07:26:04
问题 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:

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

断了今生、忘了曾经 提交于 2019-11-30 04:09:53
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. I'm running Windows 8.1 and this method worked perfectly fine: Open your device manager and select "Update Driver Software..." on your Gear Live: Select "Browse My Computer for

How to simulate a service killed by the Android system

我只是一个虾纸丫 提交于 2019-11-30 03:43:55
问题 While developing I wanted to test the situation where the system kills a service. This is because I'm loosing connection when communicating between the Android Wear and the handheld. And I think that it is related with the system killing some services. Does anyone have a suggestion on how to approach this? 回答1: if you're developing in Android Studio while you are running your application in android wear side try to hit the kill button displayed in the console. When you hit this button all the

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

99封情书 提交于 2019-11-30 00:12:02
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? You can create a new "Android Library" Module in the project, and place your common classes there. Then you simply add it as a dependency of

Android Wear 2.0 styled switches

淺唱寂寞╮ 提交于 2019-11-29 23:54:07
问题 I'm making a watch face for my android wear watch and in the config activity I want a switch. The switch looks like a usual android switch (picture 1) but I want it to look like the new switchs in android wear 2.0 (picture 2). How did google do them? 回答1: The switch in picture 2 is a SwitchPreference which is (at least currently) only supported in a PreferenceFragment. 回答2: In the latest update we added a RoundSwitch style which should do exactly what you need. See here: Support Library Wear

Android Wear Project Gradle Sync Fails

£可爱£侵袭症+ 提交于 2019-11-29 21:22:04
I created a new project in Android Studio 0.8 in order to start integrating Android Wear into one of my apps. I create a new project and include the Wear form factor, but when I try to sync I get: Error:Could not find any version that matches com.google.android.support:wearable:+. Required by: win_control:wear:unspecified EDIT: I played around with Gradle a bit, and now I get these errors: Error:Failed to find: com.google.android.gms:play-services-wearable:+ Open in Project Structure dialog Open File Error:Failed to find: com.google.android.support:wearable:+ Open in Project Structure dialog

How to send notification from handheld to wear to open Activity on wear device

放肆的年华 提交于 2019-11-29 19:44:35
I'm wondering if it is possible to send notification from handheld (android phone) to wear device to open Activity on wear device? What I want to do is as following. So far, I checked the following documents, but it's different from what I want to do. Adding Wearable Features to Notifications What is described here is sending notification from phone to wear, then open activity on the phone (I want to open activity on the wear) Create Custom Notifications What is described here is sending notification from wear to wear, then open activity on the wear (I want to send notification from phone to