전체 글 889

[Flutter/플러터] show snackbar in flutter 플러터 스낵바(SnackBar) 만들기

2.x 버전 Scaffold.of(context).showSnackBar(SnackBar(content: Text("msg"))); 3.x 버전 ScaffoldMessenger.of(context) ..showSnackBar(SnackBar(content: Text("$result"))); 기존에 표시된 스낵바를 지우고 다시 표시하려면 ScaffoldMessenger.of(context) ..removeCurrentSnackBar() ..showSnackBar(SnackBar(content: Text("$result"))); 스낵바 형태 커스텀 SnackBar( content: Text('$result'), backgroundColor: Colors.blue, // 스낵바 배경색 duration: Dur..

Flutter(플러터) 2023.01.18

[Flutter/플러터] 이미지파일 호출 방법

플러터로 개발할 때는 선택한 모든 환경에서 동작해야하기에 별도 작업이 필요합니다. 1. 프로젝트 최상위 폴더에 images 폴더를 생성합니다. 2. 사용하고자하는 이미지 파일을 생성한 images 폴더에 저장합니다. 3. pubspec.yaml 파일을 엽니다. use-material-design: true 를 찾고 그 아래에 첨부 이미지 처럼 작성합니다. 4. 사용합니다. Image.asset( 'images/lake.jpg', width: 600, height: 240, fit: BoxFit.cover, )

Flutter(플러터) 2023.01.18

[Flutter/플러터] remove debug banner 디버그 배너 안보이게 하기

플러터로 앱을 개발할 때 에뮬레이터를 돌리거나 앱에 직접 실행할 때 debug mode 인 경우 아래 이미지처럼 우 상단에 DEBUG 배너가 붙게됩니다. 저는 개발할 때 보기 싫어서 항상 DEBUG 배너를 지우고 개발하는데요. 방법은 간단합니다. class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, //

Flutter(플러터) 2023.01.18

[UnityAndroid] NativeCamera API 사진 촬영하고 내부저장소에 저장하기

Native Camera for Android & iOS | Integration | Unity Asset Store Native Camera for Android & iOS | 기능 통합 | Unity Asset Store Use the Native Camera for Android & iOS from yasirkula on your next project. Find this integration tool & more on the Unity Asset Store. assetstore.unity.com 유니티에는 위처럼 Android, iOS 진영의 네이티브 카메라를 쉽게 호출하고 사진촬영하고, 영상촬영할 수 있는 무료 에셋이 존재합니다. 위 에셋을 사용해 UnityAndroid 에서 카메라를 열고, 사..

Unity(유니티) 2023.01.11

"./il2cpp.exe'' finished with non-zero exit value 126 in mac

안드로이드에 유니티 라이브러리를 추가하여 사용할 때 맥에서 제목처럼 il2cpp.exe'' finished with non-zero exit value 126 에러가 발생한다면 유니티 라이브러리가 윈도우 운영체제에서 개발된 파일이라 그럴 수 있습니다. 맥에서 안드로이드 개발 시 유니티 라이브러리를 사용해야한다면 맥에서 Export한 유니티 라이브러리를 사용해야 합니다. 윈도우에서 Export 할 경우 .exe 실행파일들이 생기는데, 맥에서 이 실행파일들을 실행할 수 없어서 발생하는 에러로 예상됩니다. 저는 이 문제로 며칠을 고생했는데, 저같은 실수를 하는 분이 없기를... 끝.

안드로이드 2022.11.03

[Kotest] Android Unit Test 한글 깨짐 해결

안드로이드 스튜디오에서 Help -> Edit Custom VM options 를 클릭하면 studio64.exe.vmoptions 라는 파일이 열립니다. # custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html -Xmx8192m 이런 식으로 되어 있을텐데 가장 아래에 -Dfile.encoding=UTF-8 요 코드를 추가해서 # custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html -Xmx8192m -Dfile.encoding=UTF-8 위 처럼 만들어주고..

안드로이드 2022.10.26

[안드로이드/Android] resources.getIdentifier 사용법

안드로이드에서 문자열을 사용해 리소스를 불러와야하는 경우가 있습니다. 이런 경우, R.string.aaa, R.raw.aaa, R.drawable.aaa 처럼 사용할 수 없습니다. 대신해서 resources.getIdentifier(String name, String defType, String defPackage) 위 같은 함수를 제공합니다. 1. 문자열 불러올 때 resources.getIdentifier(string_resource_name, "string", mActivity.packageName) 2. 이미지 불러올 때 resources.getIdentifier(drawable_resource_name_without_extension, "drawable", mActivity.packageName..

안드로이드 2022.08.17

안드로이드 hilt 적용 시 발생 오류 dagger.hilt.android.plugin.task.AggregateDepsTask$WorkerAction, Execution failed for task ':app:kaptDebugKotlin 해결 방법

프로젝트 수준 build.gradle 에 plugins { id 'com.android.application' version '7.2.1' apply false id 'com.android.library' version '7.2.1' apply false id 'org.jetbrains.kotlin.android' version '1.7.0' apply false id 'org.jetbrains.kotlin.jvm' version '1.7.0' apply false id 'dagger.hilt.android.plugin' version '2.42' apply false } 가장 아래 줄처럼 힐트 를 추가해주면 된다. 끝.

안드로이드 2022.07.07

안드로이드 - 텍스트뷰 텍스트 사이즈 자동 조절 Autoscaleable textview

텍스트크기가 자동으로 조절되는 코드입니다. if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration( txtView, minTextSize, maxTextSize, autoSizeStepGranularity, TypedValue.COMPLEX_UNIT_SP ) } else { txtView.setAutoSizeTextTypeUniformWithConfiguration( minTextSize, maxTextSize, autoSizeStepGranularity, TypedValue.COMPLEX_UNIT_SP ) } 감사합니다.

안드로이드 2022.07.04