본문 바로가기

프로그래밍88

[React-Native] 특정 버전으로 프로젝트 시작하기 명령0.73.3 버전으로 프로젝트를 시작하고 싶다면npx react-native init ProjectName --version 0.73.3 참고 자료  npx react-native init AwesomeProject --version X.XX.X always init latest-version project · Issue #34132 · facebook/react-nativDescription I want to init an app with custom version of react-native, I run npx react-native init AwesomeProject --version X.XX.X but it inits a project with: "dependencies": { "react":.. 2024. 9. 18.
[Flutter] Incorrect use of ParentDataWidget 에러 해결 개요 ======== Exception caught by widgets library =======================================================The following assertion was thrown while applying parent data.:Incorrect use of ParentDataWidget.The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept ParentData of incompatible type ParentData.Usually, this me.. 2024. 9. 18.
[Flutter] flutter_inappwebview iOS 18 Ambiguous use of 'evaluateJavaScript(_:completionHandler)' 에러 해결 개요 flutter_inappwebview 플러그인을 사용하면서 iOS 18 을 타켓하는 프로젝트 빌드 시 발생할 수 있습니다. iOS 18 와 플러그인 간 호환성 문제입니다. 이를 해결해 보겠습니다. 해결위 에러 발생한 상태에서 문제를 해결해 보겠습니다. 함수명 evaluateJavaScript에 마우스를 올린 후 우클릭합니다. Jump to Definition 을 선택해 주세요. InAppWebView 를 선택해 주세요. InAppWebView 선택 시 아래와 같이 evaluateJavaScript 함수 원형으로 이동합니다.  아래와 같이 completionHandler 속성에 @MainActor 를 추가해 주세요.  저장 후 다시 빌드 시도해 보세요. flutter_inappwebview는 23년을.. 2024. 9. 18.
[Flutter] iOS 18 Type 'UIApplication' does not conform to protocol 'Launcher' 에러 해결 개요 XCode16을 사용하여 iOS 18 타겟하는 앱 빌드 시 발생할 수 있는 에러입니다.  Type 'UIApplication' does not conform to protocol 'Launcher'Candidate has non-matching type '(URL, [UIApplication.OpenExternalURLOptionsKey : Any], (@MainActor @Sendable (Bool) -> Void)?) -> Void' (UIKit.UIApplication) 해결 방법 이 문제는 6.3.0 이하 버전 url_launcher_ios 플러그인과 iOS 18이 호환되지 않아 발생하는 문제입니다. 아래 명령어를 통해 url_launcher_ios 플러그인을 6.3.1 버전 이상으로 업그레.. 2024. 9. 18.
[Android] 안드로이드 android:tag android:name android:id 차이 개요 안드로이드 개발 시 사용할 수 있는 속성 android:tag android:name android:id 세 가지의 차이를 알아보겠습니다. 속성 별 사용 권장되는 상황이 다릅니다.  android:id액티비티 메소드에서 활용합니다.  Button myButton = (Button) findViewById(R.id.my_button); android:tagid를 보조하거나, 가변적인 객체 리스트에서 활용합니다. 일반적인 상황에선 id사용을 권장합니다.  android:name Fragment의 고유 명으로 사용합니다. 아래와 같이 Fragment 교체 및 트랜잭션 시 활용합니다. // Replace whatever is in the fragment_container view with this frag.. 2024. 9. 14.
[Flutter] 자주 사용하는 SnackBar Flutter 코드 템플릿 개요Flutter SnackBar 위젯을 사용할 때 작성하는 코드 템플릿입니다. 이전에 다른 SnackBar 가 있다면 지우고 팝업됩니다.  코드 템플릿 ScaffoldMessenger.of(context) ..removeCurrentSnackBar() ..showSnackBar(SnackBar( content: Text("새로운 비밀번호를 입력하세요."), )); 참고 자료  Display a snackbarHow to implement a snackbar to display messages.docs.flutter.dev 2024. 8. 20.
[Flutter] Flutter에서 "000-0000-0000" 형식으로 자동 하이픈(-) 추가되는 TextFormField 만들기 개요 플러터 앱에서 전화번호 입력 시 하이픈이 자동으로 추가되는 Formatter를 적용해 보겠습니다.  Formatter 생성 class HyphenFormatter extends TextInputFormatter { @override TextEditingValue formatEditUpdate( TextEditingValue oldValue, TextEditingValue newValue, ) { if (newValue.text.length > 12) { return oldValue; } final newText = StringBuffer(); for (int i = 0; i  Controller 선언 final TextEditingControll.. 2024. 8. 19.
[Python] nohup을 활용한 백그라운드 실행하기 개요 파이썬 프로그램을 백그라운드에서 실행, 중지하는 방법을 안내합니다. 백그라운드 실행 python nohup 파이썬파일.py 백그라운드 실행 중지 실행한 파이썬 프로그램의 PID를 확인ps -ef | grep python [ 참고 ] 현재 user가 실행한 프로세스에 한해서 PID 확인ps -ef | grep python | grep 사용자명 프로세스 종료kill 파이썬PID 참고 자료  nohup(1) - Linux manual page man7.org How to get the process ID to kill a nohup process?I'm running a nohup process on the server. When I try to kill it my putty console closes .. 2024. 8. 9.
[android/java] firesbase SDK java.util.long cannot be cast to class java.lang.integer 문제 해결 개요 이 글은 안드로이드 firebase SDK 사용하여 데이터베이스 I/O를 할때, firebase 데이터를 자바 Integer에 저장 시도하는 경우 에 한해 올바른 해결 방안을 안내합니다. int count = data.get("count"); 해결 방법 안드로이드에서 데이터베이스 I/O에 사용되는 모든 숫자 변수는 long을 사용해 주세요. 또한 long으로 캐스팅해주세요. long count = (long) data.get("count"); 이유 firebase 데이터베이스의 숫자는 모두 Long 자료형으로 받습니다. 따라서 캐스팅 가능한 long으로 캐스팅해주어야 합니다. 참고 자료 https://firebase.google.com/docs/database/android/read-and-writ.. 2024. 1. 19.
[android/java] recyclerview onClickListener에서 fragment transaction 및 startActivity 구현하기 가정 custom recyclerView를 이미 구현했다고 가정합니다. 아래와 같이 생성자 내부에 onClick 리스너가 작성된 상태에서 시작합니다. public class TestAdapter extends RecyclerView.Adapter { ... public static class ViewHolder extends RecyclerView.ViewHolder { ... private AppCompatActivity activity; public ViewHolder(View view) { super(view); ... view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); Fr.. 2024. 1. 15.
[flutter] linearGradient opacity 조절하여 일부 투명하게 만들기 개요 플러터 개발 시 LinearGradient 위젯을 사용하는 예제, 반투명하게 사용하는 예제 코드입니다. 소스 코드 Container( height: 200, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ ColorStyle.black, ColorStyle.white, ])), ), 아래와 같이 일부를 투명하게 만들 수도 있습니다. Container( height: 200, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Align.. 2024. 1. 15.
[android/java] 메소드 오버라이딩 시 super 메소드 호출의 필요성 개요 안드로이드 프로그래밍할때, 우리는 굉장히 많은 메소드를 오버라이딩합니다. 그런데 오버라이딩 시 super 문법을 통해 부모 클래스의 메소드를 호출하는 것 super.onSaveInstanceState(outState); 을 매우 자주 보았을 겁니다. 왜 사용할까요? 메소드 오버라이딩은 일반적으로 부모 클래스 메소드를 사용하지 않고 재정의한 메소드를 사용하기 위함인데, 굳이 부모 클래스의 메소드를 호출하면 오버라이딩한 의미가 별로 없지 않나요? @Override public void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); ... } super 먼저 이 상황을 이해하기 위해선 super 문법.. 2024. 1. 13.