wear-os

Android Wear: measuring sensors and preventing ambient mode / sleep

假装没事ソ 提交于 2019-12-25 09:50:38
问题 I have built an app for Android Wear that needs to measure the motion (accelerometer) sensors continuously for an hour or so for data collection purposes. During operation, I have had problems with the device going into ambient mode (or sleep) and slowing down (or shutting off) the sensors. As a result, I am using the following command to lock the screen on and it seems to work. But it also seems wasteful, since I dont actually need the screen on, just the sensors running. getWindow()

Sending String from watch to phone

倾然丶 夕夏残阳落幕 提交于 2019-12-25 08:20:07
问题 I'm attempting to send a string from wearable to mobile device using code below. This implementation is based on https://github.com/twotoasters/Wear-MessageApiDemo/ Case there is an issue with the time delay in connecting to the device I've increased CONNECTION_TIME_OUT_MS from 100 to 2000 (milliseconds). To the mobile manifest I add : <service android:name=".ListenerService" > <intent-filter> <action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" /> </intent-filter> <

DelayedConfirmationView is blank on Android Wear

北城余情 提交于 2019-12-25 07:36:09
问题 I'm attempting to use Andoird Wear's DelayedConfirmationView from the support library, by starting an activity. The activity has this in OnCreate: setContentView(R.layout.delayed_main); mDelayed = (DelayedConfirmationView) findViewById(R.id.delay); mDelayed.setTotalTimeMs(4000); //mDelayed.setImageDrawable(getResources().getDrawable(R.drawable.close_button)); mDelayed.setListener(new DelayedConfirmationView.DelayedConfirmationListener() { ... My delayed_main has this: <?xml version="1.0"

Using CircledImageView in android wear

馋奶兔 提交于 2019-12-25 06:25:12
问题 I am using the CircledImageView to display the image in the ListView , but I am not getting the image view as circular. Can anyone tell me how to achieve this? 回答1: ok got it woking by setting the height and width as wrap content and also providig the radius of the cirlce. Here is the code working for me. <android.support.wearable.view.CircledImageView android:id="@+id/im_action_icons" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" app

Android Wear Message Listener

霸气de小男生 提交于 2019-12-25 03:14:08
问题 I need some help I have Android Wear with message api working but I'm stuck sending some commands this is my listener. import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.hardware.Camera; import android.widget.ImageButton; import android.widget.Toast; import com.google.android.gms.wearable.MessageEvent; import com.google.android.gms.wearable

Direct communication between Wear OS and iOS companion app

谁都会走 提交于 2019-12-25 01:34:34
问题 I currently have an app for Android & iOS smartphones which I want to bring to Wear OS & Watch OS. As Wear OS smartwatches are also compatible with iOS devices, I'm looking for a way to communicate between the Watch OS app and the iOS app. I wasn't able to find anything about this yet, so any help would be appreciated. 回答1: As far as I know there is no simple way to communicate between WearOS device and Iphones. On one hand you can try to use regular bluetooth or BLE, on the other hand the

Show Single Item at a time in Recycler view

▼魔方 西西 提交于 2019-12-24 21:05:55
问题 I'm showing list of items in WearableRecyclerView. As of now I am getting like this But I need to show Single Row(Single Item) in a Page ,Scroll down,then show next Item. Any Help to do this in android app? 回答1: You can do it by two way. option 1: putting recycler view item width and height both to match_parent.which will cover the screen with with one item at a time and need to scroll for see the next item. option 2: use this library which will do the exact thing that you are looking for. 来源

Send message to android device, which sends message back to android wear, but on received is never triggered on wear

牧云@^-^@ 提交于 2019-12-24 17:50:00
问题 I am writing an app for android which communicates to the device and back to the wear. This is the code of onclick on wear. message1Button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Wearable.MessageApi.sendMessage(apiClient, remoteNodeId, MESSAGE1_PATH, null).setResultCallback(new ResultCallback<MessageApi.SendMessageResult>() { @Override public void onResult(MessageApi.SendMessageResult sendMessageResult) { Intent intent = new Intent

Is DataApi Reliable and Practically Real Time? Extremely Delayed [duplicate]

可紊 提交于 2019-12-24 17:03:35
问题 This question already has an answer here : WearListenerService onDataChanged strange behavior (1 answer) Closed 4 years ago . I have had an Android Wear app on the market for about 10 months now and it's stopped working (Not sure when it stopped working). I'm trying to update my wearable application with some statistics that I record in my mobile app. As I say, this used to work fine and reliably. I even added the timestamp to this so it was unique as the onDataChanged is only called if data

Android wearables: How to handle the event of a connected device?

久未见 提交于 2019-12-24 14:41:05
问题 From the smartwatch I'd like to intercept the event of the connection to a smartphone. This is automatically managed by Android and Android Wear so I need to get this event from my app running on the watch. I found out this on WearableAPI to be notified without polling Wearable.NodeApi.getConnectedNodes public class MyService extends WearableListenerService { @Override public void onPeerConnected(Node peer) { Log.i("my wear service", "connected"); super.onPeerConnected(peer); // here I would