Android WearOS app

#1

Hello,
first timer here and new to Ionic :slight_smile:

I’m trying to develop a small app for Android WearOS, what I am trying to accomplish is to have a slider (sliding horizontally) taking up the whole screen, and just under it (invinsible at first) a list of entries. When the user slides horizontally, the slider should slide to the next slide, but when the user flicks the finger on the vertical axis, I want the slider to slide completely off the top of the screen and the list to appear in full screen and start being scrollable.

I tried the below but it’s not what I’m trying to do. Firstly the first row containing the slider does not take the full screen and the grid is visible just below it.

<ion-content padding no-bounce>  
    <ion-grid>
        <ion-row item-height="100%">
          <ion-col>
            <ion-slides>
              <ion-slide *ngFor="let x of xxx">
                  <ion-card>
                      <ion-card-content>
                        <img [src]="x.image"/>
                        <ion-card-title>{{ x.name }}</ion-card-title>
                      </ion-card-content>
                    </ion-card>        
              </ion-slide>
            </ion-slides>
          </ion-col>
        </ion-row>
        <ion-row>
          <ion-col>
            <ion-list>
              <ion-item *ngFor="let y of yyy">
                <ion-avatar item-start>
                  <img [src]="y.image"/>
                </ion-avatar>
                <h2>{{ y.name }}</h2>
              </ion-item>
            </ion-list>
          </ion-col>
        </ion-row>
    </ion-grid>
</ion-content>

Any ideas what I can do to have the design i’m after ?

Thanks
Chris

#2

Offtopic: Can Cordova actually build apps for WearOS?

#3

I assumed it can… Can’t it ? (I’m talking about standalone apps not requiring connected phone device)

#4

I am note sure - that’s why I asked. Often those “related” OS on watches or phone home screens (iOS today widgets, Apple Watch, tvOS) are limited in what they can do - for example no webview.

A quick Google search returns https://stackoverflow.com/questions/39697882/standalone-smartwatch-app-with-cordova and https://github.com/tgardner/cordova-androidwear, which means there is something - but it is not 100% clear to me if this all really works. If I were you, I would confirm that first before fussing about the UI :wink:

1 Like
#5

Google: Webview Android WearOS

Note: The WebView.getCurrentWebViewPackage() method can return null if the device hasn’t been set up correctly. It also returns null if you’re running your app on a device that doesn’t support WebView , such as a Wear OS device.

So web app for Wear OS seems a dead end street to me.

Easy test: build the app and try to run it in Android Emulator.

I tried it before a long time ago - no fly zone…

1 Like