1) You can check if Activity.Height > Activity.Width then it is in portrait mode. But if your concern is what layout the system should use you don't need it the OS does it, see below.
2) You can define two layout variants in a same layout file, one for portrait and one for landscape. You'll find an exampe in chapter 8.6 Layout variants in the
Beginner's Guide.
3) Don't worry about that, the OS does it for you. It takes the layout that best fits the current conditions. If you have a layout file with two layout variants, portrait and landscape, the OS will take the right one.
Best regards.