0

I have a pair of Google glass and I would like to install an App for Tablet and smartphone I developed myself.

The App use the API 19 as well as the the Glass.

In this app I have a button and the view is to long for the glass, so we are only able to see the above of the page.

For now i am not able to scroll down the page nor to click on the button in order to go to the next activity. (it works fine on tablet and smartphone)

Do you know if there is a way to make this work without having to use CardViews ?

Thank you

pt2121
  • 11,720
  • 8
  • 52
  • 69

1 Answers1

2

Usually, it's hard to directly port a phone app to glassware. User interaction is totally different. I don't think you can literally click on the button using the touchpad so button's OnClickListener doesn't work.

Anyway, GDK has its own gesture listener API. You can check it here.

You can try detecting a scroll with ScrollListener:

gestureDetector.setScrollListener(new GestureDetector.ScrollListener() {
        @Override
        public boolean onScroll(float displacement, float delta, float velocity) {
            // do something on scrolling
        }
    });
pt2121
  • 11,720
  • 8
  • 52
  • 69
  • Thank you for your quick answer. I try to use the "Detecting activity-level gestures" piece of code from the Google API but then my app doesn't launch anymore at all and i don't know why... Can we use the google glass API on a activity from a "normal" app ? – user3797119 Jul 30 '14 at 16:04
  • I don't remember, i will copy them on tomorrow because i don't have the glass tonight. but i am not sur if i can apply those methods on an app that does not use cardview, what do you think ? – user3797119 Jul 30 '14 at 16:10
  • I used it before. You don't need CardViews to get touch gestures. – pt2121 Jul 30 '14 at 16:12
  • Okay i succeed in using the TAP gesture, however i really don't know what to type in the method onScroll... I just want to be able to scroll down in order to scroll to the bottom of the page. Do you Have any idea on what it could look like ? – user3797119 Jul 31 '14 at 08:09
  • cardScrollView serve that purpose very well. whats the problem using that in your app ? – Shailendra Singh Rajawat Jul 31 '14 at 08:15
  • I thought that carScrollView could be apply on card object, i am going to try but since i don't use card to define activities i am not sure this will work – user3797119 Jul 31 '14 at 08:43