Hello,
Both forms currently work exactly the same in MAUI.
According to explain the difference between #if __ANDROID__vs #if ANDROID #501, using #if ANDROID
is a better option.
In the earlier .NET MAUI releases
#if ANDROID
didn't work but#if __ANDROID__
did work. However, since then#if ANDROID
works. They've since been equivalent. The preferred and recommended approach from the product team is to use#if ANDROID
. There's no guarantee that#if __ANDROID__
support will remain forever.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.