wear-os

Getting data from calendar on Android Wear

谁都会走 提交于 2019-12-07 16:53:57
问题 I'm querying the calendar data like this: // Constructor of the class mCursor = context.getContentResolver().query(CalendarContract.Events.CONTENT_URI, mColumns, null, null, null); updateEvents(); //contents of updateEvents: events.clear(); mCursor.moveToFirst(); mLastUpdate = System.currentTimeMillis(); while (!mCursor.isAfterLast()) { long end = mCursor.getLong(2); if (end > mLastUpdate) events.add(new Event(mCursor)); mCursor.moveToNext(); } The code manages works on mobile device, however

Why does Wearable.DataApi.getFdForAsset produce a result with status 4005 (Asset Unavailable)?

蹲街弑〆低调 提交于 2019-12-07 13:36:44
问题 I've written an Android Wear application which receives an image wrapped in an Asset from a phone app using the Data API. The app used to work fine and has not been changed in ages but recently I started to find the image passed from the phone app was failing to be rendered on the screen of the wearable. On investigation I found that one of the methods, getFdForAsset was failing with a wearable status code of 4005 which means Asset Unavailable. See https://developers.google.com/android

Security of data transmission between Android wear and smartphone

£可爱£侵袭症+ 提交于 2019-12-07 12:06:42
问题 I have an application for Android wear. I use GoogleApiClient to send message between Android wear and smartphone. Is this communication safe? Is it safe to send sensitive data between devices, like password? Maybe I have to protect the data in some way? Send message looks like this: Wearable.MessageApi.sendMessage(googleApiClient, nodeId, path, message.getBytes()).await(); 回答1: According to the documentation: A message is private to the application that created it and accessible only by that

Permissions for a WearableListenerService

此生再无相见时 提交于 2019-12-07 07:39:14
问题 I've implemented a WearableListenerService in both my main app and the companion Wear app. In the manifests, the service needs to be declared as android:exported="true" (or not declared at all and left to default to true ) since it's started by Google Play Services. An exported service with no permissions can be called by any app on the system, but I can't find the correct permission to add to the service declaration to secure it. I've looked through the permissions on both the phone and the

Android Wear Preview not connecting to Wear Emulator

本秂侑毒 提交于 2019-12-07 06:35:09
问题 I am trying to setup my development environment for Google Wear and have followed Google's instructions but as soon as I setup the port forwarding ( adb -d forward tcp:5601 tcp:5601 ) I am getting an error on the device; Connection closed, waiting before trying again I have the emulator running on the PC and Android device is a Nexus 4, 4.4.4. 回答1: If you've updated everything, and have the new emulator, you might need Android Wear (not Android Wear Preview). Follow these steps: http:/

Android Wear How Long do DataMap entries Stay Valid

杀马特。学长 韩版系。学妹 提交于 2019-12-07 05:20:58
问题 I'm extending one of my apps to work with Android Wear, and I need to send 4 bitmaps to Wear. I'm using the DataApi and DataMap to do this and it is currently working fine. My question is, how long does data stay synced in the DataApi ? Would I still be able to access them a week later? Is it something I have to manually manage. For instance, if some state would change on the handset, I would need to send different bitmaps. Do I need to remove the ones that are currently there? 回答1: The

Background image for android wear notification

僤鯓⒐⒋嵵緔 提交于 2019-12-07 04:10:40
问题 I want to set background image for Android Wear notification. What should be the size of the image? 回答1: The resolution for square watch faces as of right now is 280x280, whereas the circular watch face has a resolution of 320x320 (although some of this will be cut off, obviously). However, Android Wear implements a sort of parallax scrolling by default for larger images, so it can handle larger images with great ease, and it is even recommended that you do so (see this previous answer). So

Unable to execute initial Android Wear Hello World App in eclipse

风格不统一 提交于 2019-12-07 04:03:58
问题 After intial Eclipse Luna setup when I try to run the intial Hello World app in the Android Wear emulator, its getting stopped showing "You cannot combine swipe dismissal and the action bar" error in logcat.Please help me to solve this issue. 回答1: I had the same problem yesterday. I solved it by running the application in full screen mode, I do not think this is the best solution, but it worked, although this does not have the action bar. In you onCreate method add this before the

Round Android Wear Emulator is using rect layouts

早过忘川 提交于 2019-12-07 02:41:15
问题 Unfortunately Moto360 is not avail to Europe yet... I'm running a Round Android Wear Emulator and this is working fine. However when I run my Android Wear Activity (which uses a WatchViewStub) the layout being used is the rect_activy_layout and not the round layout Anyone else have this issue or resolved when running Round Emulator? Thanks 回答1: There are many problems with inflating layouts that are caused by not correctly using WatchViewStub. I don't see any code to know exactly, but one

Android Wear new (unwanted) permissions

巧了我就是萌 提交于 2019-12-06 20:57:26
I recently switched from API 21 to 23 to create Android Wear watch faces. In the interest of brevity I will not comment on the excruciating process. (1) As I was uploading to Google Play I noticed that the new API has added, without my consent, 4 new rights: Required permissions 6 permissions (4 added) => android.permission.ACCESS_NETWORK_STATE => android.permission.INTERNET android.permission.WAKE_LOCK => com.google.android.c2dm.permission.RECEIVE com.google.android.permission.PROVIDE_BACKGROUND => com.mycompany.mypackage.permission.C2D_MESSAGE I double checked the manifest which contain my