0

I am supposed to build iPhone and android app. The part of application should determine a tilt and orientation of the phone itself.

What stack of technologies should I use in order to build best experience. Is it possible to go with something similar to Ionic with Angular?

Valera Tumash
  • 628
  • 7
  • 16

1 Answers1

0

To get the Screen orientation on a Android phone you can use :

int screenOrientation = getResources().getConfiguration().orientation;

    if (screenOrientation == Configuration.ORIENTATION_PORTRAIT){

          // Portrait - Do Something
    } else {

          // Landscape - Do Something
    }

As for the tilt on a Android phone SensorManager could help you out - see: get tilt angle Android

Community
  • 1
  • 1
Mark
  • 9,604
  • 5
  • 36
  • 64