wear-os

Running Android Text to Speech on android wear?

你。 提交于 2019-12-24 11:14:47
问题 Is it possible to run Text to Speech API on android wear devices? I am trying to do that but it is not working. The watch will display list of cards containing words and and there will be a button when clicked the user can hear the word in the current card. I got it working on a mobile phone but my objective is to make it work on android watch. Any help is appreciated. Thanks. 回答1: If you wanna to use Voice commands for your wearable device you can use this implementation: private static

Running Android Text to Speech on android wear?

江枫思渺然 提交于 2019-12-24 11:11:10
问题 Is it possible to run Text to Speech API on android wear devices? I am trying to do that but it is not working. The watch will display list of cards containing words and and there will be a button when clicked the user can hear the word in the current card. I got it working on a mobile phone but my objective is to make it work on android watch. Any help is appreciated. Thanks. 回答1: If you wanna to use Voice commands for your wearable device you can use this implementation: private static

Rotating a bitmap around a pivot on a canvas

喜你入骨 提交于 2019-12-24 10:59:09
问题 I am trying to implement a watch face where a bitmap image of a hand rotates about the center of the face on a canvas. Basically in the onDraw() method, I want to be able to put an image resource onto the canvas then rotate it rotate it every second. I have logic in place to trigger the rotation every second, I am not sure how to obtain the image resource and then rotate it. Any help would be appriciated! 回答1: Basic steps: Decode your bitmap from, for example, Resources, but there are other

WearableCalendarContract returns some null fields

青春壹個敷衍的年華 提交于 2019-12-24 09:39:05
问题 I have made an Android Wear watch face which has a function that retrieves calendar events using WearableCalendarContract. Starting a few days ago it now returns null data in fields concerning start/stop minutes and start/stop days and I cannot make it work again. The code looks like this: private final String[] PROJECTION = { CalendarContract.Calendars._ID, // 0 CalendarContract.Instances.TITLE, // 1 CalendarContract.Instances.START_MINUTE,// 2 CalendarContract.Instances.END_MINUTE, // 3

Get heart rate from Android Wear

点点圈 提交于 2019-12-24 09:27:10
问题 I know this can be quite simple a question and many people have asked the same question but still I have problem in getting the heart rate. Of course I have done so much research for the solution. Generally, for using a heart rate sensor, we need get the permission and use sensormanager and need registerListener for the sensor in mainActivity. Some have said here for SDK 23 or higher, we need declare the permission separately but till present I develop only the part of Android Wear and there

Android handheld and wearable not receiving messages

℡╲_俬逩灬. 提交于 2019-12-24 08:56:02
问题 I'm trying to send a message from a wearable to a handheld and then a response from the handheld to the wearable (both modules use the same code and logic). Gradle : compile 'com.google.android.support:wearable:2.0.0-alpha2' compile 'com.google.android.gms:play-services-wearable:9.6.1' ... classpath 'com.android.tools.build:gradle:2.2.1' classpath 'com.google.gms:google-services:3.0.0' AndroidManifest : <application> ... <service android:name=".ReceiverService" android:enabled="true" android

Android Wear: Timer like notification card on wear device

坚强是说给别人听的谎言 提交于 2019-12-24 04:52:13
问题 I'm working on implementation of Pomodoro app for Android Wear. I want to make similar to standard timer UI/UX, I guess it's implemented using displaying/updating notification with timer as title, so I'm showing notification and updating it periodically from Service: private void updateNotification() { Intent stopActionIntent = new Intent(this, PomodoroActivity.class); stopActionIntent.setAction(PomodoroActivity.ACTION_STOP); PendingIntent stopActionPendingIntent = PendingIntent.getActivity

Android Wear: Timer like notification card on wear device

心已入冬 提交于 2019-12-24 04:52:00
问题 I'm working on implementation of Pomodoro app for Android Wear. I want to make similar to standard timer UI/UX, I guess it's implemented using displaying/updating notification with timer as title, so I'm showing notification and updating it periodically from Service: private void updateNotification() { Intent stopActionIntent = new Intent(this, PomodoroActivity.class); stopActionIntent.setAction(PomodoroActivity.ACTION_STOP); PendingIntent stopActionPendingIntent = PendingIntent.getActivity

Draw an Image based texture in openGl android(Wear)

馋奶兔 提交于 2019-12-24 01:36:09
问题 I am drawing an image based texture using opengl in android, But the image is drawn partially only shown below my coding @Override public void onGlContextCreated() { super.onGlContextCreated(); shaders = new ShadersDla(); float[] vts = { // x, y, s, t. -1, 1, 1, 1, -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0 }; // AllocateDirect prevents the GC moving this memory. vtBuffer = ByteBuffer.allocateDirect(vts.length * 4) .order(ByteOrder.nativeOrder()) .asFloatBuffer(); vtBuffer.put(vts); } @Override

Android wear - Notification - Image Span is not working

梦想的初衷 提交于 2019-12-24 00:23:13
问题 I am using ImageSpan in Android wear notification for styling in notification, but it's not working. Please tell me the procedure how to use ImageSpan in notifications any help is Appreciated. Following sample code i'm using. SpannableStringBuilder title = new SpannableStringBuilder(); title.setSpan(new ImageSpan(context, bmp, ImageSpan.ALIGN_BASELINE),title.length()+2,title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); Thanks in advance. 回答1: You can not use ImageSpan in Notification. If