■ UsesFeatureAttribute 클래스를 사용해 구글 플레이에서 특정 하드웨어가 없는 기기 필터링을 방지하는 방법을 보여준다.
▶ Platforms/Android/MainApplication.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
using Android.App; using Android.Runtime; [assembly: UsesFeature("android.hardware.camera" , Required = false)] [assembly: UsesFeature("android.hardware.camera.autofocus", Required = false)] namespace TestProject; /// <summary> /// 메인 애플리케이션 /// </summary> [Application] public class MainApplication : MauiApplication { //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor ////////////////////////////////////////////////////////////////////////////////////////// Public #region 생성자 - MainApplication(handle, ownership) /// <summary> /// 생성자 /// </summary> /// <param name="handle">핸들</param> /// <param name="ownership">소유권</param> public MainApplication(IntPtr handle, JniHandleOwnership ownership) : base(handle, ownership) { } #endregion //////////////////////////////////////////////////////////////////////////////////////////////////// Method ////////////////////////////////////////////////////////////////////////////////////////// Protected #region MAUI 앱 생성하기 - CreateMauiApp() /// <summary> /// MAUI 앱 생성하기 /// </summary> /// <returns>MAUI 앱</returns> protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); #endregion } |
※ 상기 코드는 카메라를 예시한 것이다.