wear-os

Always on without ambient mode? OR do not dim when enter ambient?

我的梦境 提交于 2019-12-20 04:16:36
问题 For experiment/user study purpose, I need to keep my screen on for few minutes. I have follow the guide from http://developer.android.com/training/wearables/apps/always-on.html and it works partially for my purpose. The code allows my screen always on BUT it will enter ambient mode after few seconds. I DO NOT want ambient mode. My trick is I commented out onEnterAmbient(), onUpdateAmbient() and onExitAmbient(). So that my screen drawing is still the same color (not changing to black & white).

Android Wear: Listen to incoming notifications

青春壹個敷衍的年華 提交于 2019-12-20 03:14:00
问题 Is it possible to listen for incoming notifications in an Wearable Android App? I have tried to implement a NotificationListenerService , but the service's onNotificationPosted() is never called: public class MyListenerService extends NotificationListenerService { @Override public void onCreate() { super.onCreate(); Log.d("NotificationListener", "This works...."); } @Override public void onNotificationPosted(StatusBarNotification sbn) { Log.i("NotificationListener", "... but this method won't

Android Studio “mobile” and “wear” project modules, shared components location

若如初见. 提交于 2019-12-19 07:34:46
问题 In my Android Studio project there are two android modules "mobile" and "wear", these seem to be the views and controllers for the types of android devices that will be able to run this application I expect them to share some logic, such as the model files and POJOs so where should that be stored? I expect the "mobile" module to do a lot more heavy lifting than the "wear" module, but should I put the model objects in that module, or should I make a new third module that they can both use? (or

Android Studio “mobile” and “wear” project modules, shared components location

两盒软妹~` 提交于 2019-12-19 07:34:33
问题 In my Android Studio project there are two android modules "mobile" and "wear", these seem to be the views and controllers for the types of android devices that will be able to run this application I expect them to share some logic, such as the model files and POJOs so where should that be stored? I expect the "mobile" module to do a lot more heavy lifting than the "wear" module, but should I put the model objects in that module, or should I make a new third module that they can both use? (or

Compiling simple wearable app in Android Studio - WatchActivity not found

人盡茶涼 提交于 2019-12-19 07:27:14
问题 I followed the instructions at this link to create a simple mobile/wearable app in Android Studio. However, it won't recognize any of the classes specific to the wearable SDK, giving the error "cannot resolve symbol ______ ". The screenshot at this link is what I am seeing. The following is my build.gradle file: apply plugin: 'com.android.application' android { compileSdkVersion 20 buildToolsVersion '20.0.0' defaultConfig { applicationId 'com.example.lsykora.androidwearwidget' minSdkVersion

Syncing mobile App to Android Wear

有些话、适合烂在心里 提交于 2019-12-19 02:06:23
问题 According to the doc: Packing wearable Apps I am using the following code: dependencies { compile 'com.google.android.gms:play-services:5.0.+@aar' compile 'com.android.support:support-v4:20.0.+'' wearApp project(':wearable') } I have generated the release version using the Generate Signed APK. The first time when I install the apk the android wear app is installed properly things are working as required. I uninstall the app from my mobile. The android wear app also gets uninstalled without

What is the correct way to implement a GridViewPager on Android Wear?

醉酒当歌 提交于 2019-12-18 16:39:50
问题 I'm trying to implement a GridViewPager so I can switch between 2 unique views. So far I haven't been able to add any views at all. Below is my code public class Gridder extends Activity { private TextView mTextView; GridViewPager gridViewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_gridder); final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub); final LayoutInflater inflater

Does Android Wear support HttpURLConnection - getting EOFException

六眼飞鱼酱① 提交于 2019-12-18 13:28:10
问题 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 =

“Failed to resolve: com.android.support:support-v4:26.0.0” and other similar errors on Gradle sync [duplicate]

不羁的心 提交于 2019-12-18 12:10:10
问题 This question already has answers here : Failed to resolve: com.android.support:cardview-v7:26.0.0 android (24 answers) Closed 2 years ago . I have just created a new Android Studio project for both Android Mobile and wear. The initial gradle build failed because I am getting several errors- Error: Failed to resolve: com.android.support:support-v4:26.0.0 Error: Failed to resolve: com.android.support:percent:26.0.0 Error: Failed to resolve: com.android.support:recyclerview-v7:26.0.0 Error:

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

为君一笑 提交于 2019-12-18 10:10:10
问题 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