wear-os

MediaRecorder throw “java.lang.RuntimeException: start failed: -2147483648” when trying to record audio on LG G Watch

让人想犯罪 __ 提交于 2019-12-06 06:06:46
I am trying to record audio in my app on a LG G Watch. The following code throws RuntimeException with message "start failed: -2147483648" at the statement "recorder.start();". Wondering what I'm doing wrong here. I have tried a lot of different set of parameters, for example for AudioSource: recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); //-and- recorder.setAudioSource(MediaRecorder.AudioSource.MIC); Also for OutputFormat I have tried recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); //-and- recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); //-and- recorder

Android Wear Notification with MediaSession

断了今生、忘了曾经 提交于 2019-12-06 05:21:09
I would like to make an android wear notification using MediaSession that has several buttons on one page and some other buttons on a different page. It would look like Google Play Now App notification on an android wear. I followed this github tutorial at https://github.com/PaulTR/AndroidDemoProjects/blob/master/MediaSessionwithMediaStyleNotification/app/src/main/java/com/ptrprograms/mediasessionwithmediastylenotification/MediaPlayerService.java However, each action was added to a separate page on the android wear. I want to group some of them into one page. For instance, the play/pause, pre

syncing accelerometer data of android wear to phone or computer

孤者浪人 提交于 2019-12-06 03:57:53
Is it possible to sync real time data generated by sensors such as accelerometer, gyroscope etc. which are fitted on the smart watch (running on android wear) to any phone instantly. Is yes, how to do so ? Yes it is possible. Use the SensorsApi to collect the data. Use the MessageApi to send the data from the watch to the phone. 来源: https://stackoverflow.com/questions/28189733/syncing-accelerometer-data-of-android-wear-to-phone-or-computer

How to set layout for topEmptyRegion in WearablListView?

懵懂的女人 提交于 2019-12-06 03:47:18
问题 The "Disconnected" region is the top empty region thats scrolls up when this listview is scrolled. How do I set layout for that? Thanks. 回答1: Looking at your example using the hierarchyviewer it is implemented like this: A RelativeLayout holds the WearableListView <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/llist" android:orientation="vertical"> <android.support.wearable.view

detect whether wear app started with voice command or touch input

南楼画角 提交于 2019-12-06 03:37:38
问题 In my wear app I would like to show different layout options based on whether app is started via a voice command or via a touch input. But I could not find any way to do this in docs. The only possible way I can think of is to have two launchers. But I am looking for rather direct solution than creating multiple launchers. 回答1: After checking the activity log a bit, I found this: When you click on an app in the Android Wear, this is logged: I/ActivityManager(446): START u0 {act=android.intent

Android Activity Recognition on Wearables

旧街凉风 提交于 2019-12-06 03:06:08
问题 I'm researching ways on how to do activity recognition using an android smartwatch. Currently, I'm focusing on detecting whether the user is walking or standing still. My first idea was to use the built in step counter, but then I came across the Android Activity Recognition API (I'm relatively new to Android^^) which seems to be used in mobile apps only. I'm now stucking at answering the following questions: Is the current API already making use of a connected wearable device? (e.g.

Using GoogleApiClient from Push Notification IntentService to Send Data to Android Wear

萝らか妹 提交于 2019-12-06 02:30:18
问题 This is a follow up question to... Android Wear Bundled Notifications and Background Images I'd like to create a Android Wear GridViewPager layout that get's created when a new push notification comes in. Below is my code that initializes a GoogleApiClient connection when a new message comes in so I can then send data to the wear app which then creates the GridView Pager. My problem is that the GoogleApiClient never gets a connection. I've successfully run the SynchonizedNotifications sample

How to open the main app from the wearable?

☆樱花仙子☆ 提交于 2019-12-06 02:00:00
问题 I'm playing a little with wearables, I already created notifications from my micro app (which runs on the wearable ) with some little restrictions and I'm wondering how I can create a pending intent for an action to open the main app on the phone. 回答1: My solution that I've just tested and it works is add a message listener on the Android application and simply send from the wearable the details of what I want it to do. public class WearMessagesAPI_Service extends WearableListenerService {

How to Create a curved scrollbar in android wear 2.0?

与世无争的帅哥 提交于 2019-12-06 01:45:51
问题 I am using WearableRecyclerView to create a curved layout,but the default scrollbar is still vertical.Is there a way to create a curved scrollbar like android wear 2.0 launcher? 回答1: The API was renamed to CurvedChildLayoutManager So use val layoutManager = CurvedChildLayoutManager(this) recyclerView.layoutManager = layoutManager PS: as for topic question, you dont need app:layout_box just use android:scrollbars="vertical" on your WearableRecyclerView https://developer.android.com/reference

Security of data transmission between Android wear and smartphone

血红的双手。 提交于 2019-12-06 01:33:30
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(); According to the documentation : A message is private to the application that created it and accessible only by that application on other nodes. Although the underlying Bluetooth connection is encrypted it is considered to