본문 바로가기

전체 글298

안드로이드 스튜디오 빨간 줄 나올 때 안드로이드 스튜디오에서 빨간 줄이 엄청나게 나올 때 문제를 해결한 방법을 기록합니다. 1. File - Invalid Caches / Restart 2. File - Sync Project with Gradle Files 3. Build - Clean Project / Rebuild 4. 프로젝트 폴더의 .gradle .idea 파일 삭제 5. Android Studio 버전 업데이트 혹은 재설치 6. 프로젝트 하나를 다시 파서 코드 옮기기 다 안 되다가 5번으로 해결 했습니다;; ㅎㅎ 2022. 4. 11.
3. gRPC 코어 컨셉과 설계, 라이프 사이클 Core concepts, architecture and lifecycle An introduction to key gRPC concepts, with an overview of gRPC architecture and RPC life cycle. grpc.io 서비스 정의 많은 RPC 시스템처럼, gRPC는 서비스를 정의하는데 기반을 둔다. 원격으로 부를 수 있는 메소드에 대한 정의를 구체화할 수 있습니다. 기본적으로 서비스 인터페이스와 페이로드 메시지 구조를 처리하기 위해 Protocol buffers를 (Interface Definition Language, IDL)을 사용합니다. 다른 대안을 사용할 수 있습니다. service HelloService { rpc SayHello (HelloReques.. 2022. 4. 10.
2. gRPC Dart 샘플 프로젝트 설치 https://grpc.io/docs/languages/dart/quickstart/ 기본적으로 Flutter와 Dart는 연결된 상태라고 가정하고 시작합니다. GitHub - grpc/grpc-dart: The Dart language implementation of gRPC. The Dart language implementation of gRPC. Contribute to grpc/grpc-dart development by creating an account on GitHub. github.com 다트 언어로 작성된 예제 파일을 다운 받아 줍니다. helloworld 프로젝트를 열어고 Dart SDK 경로가 연결되지 않은 경우, Settings에서 작업을 해줍니다. // Run the Exampl.. 2022. 4. 10.
1. gRPC란 무엇인가? gRPC는 구글이 최초로 개발한 오픈 소스 원격 프로시저 호출 시스템이다. 전송을 위해 HTTP/2를, 인터페이스 정의 언어로 프로토콜 버퍼를 사용하며 인증, 양방향 스트리밍 및 흐름 제어, 차단 및 비차단 바인딩, 취소 및 타임아웃 등의 기능을 제공한다. 위키백과 최초 출시일: 2016년 8월 Introduction to gRPC An introduction to gRPC and protocol buffers. grpc.io gRPC는 포로토콜 버퍼를 사용하며 Interface Definition Language(IDL)을 메시지 교환 포맷으로 쓴다. 클라이언트에서는 직접적으로 서버 메소드를 호출할 수 있다. 분산 어플리케이션과 서비스를 만드는데 쉽다. gRPC는 서비스의 정의를 기반으로 하는데, 서버.. 2022. 4. 10.
[Flutter] Dialog insetPadding /// Defaults to `EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0)`. /// {@endtemplate} final EdgeInsets? insetPadding; Dialog insetPadding 속성을 통해 숨겨진(?) 패딩값을 조절할 수 있다. 예전에 안드로이드에서 테블릿에서만 Padding 잡혀 있던 거 생각나네 ㅋㅋ 2022. 4. 10.
[Flutter] 카드에 반투명한 이미지 만들기 1. 카드에 이미지를 뛰운다. 꽉 채워서 2. 해당 카드를 반 투명하게 만든다. 3. 중간에 텍스트를 뿌린다. Container( padding: const EdgeInsets.only(left: 8, right: 8), width: double.infinity, height: 250, child: Card( child: Image.network( 'https://storep-phinf.pstatic.net/linesoft_01/original_13.gif?type=pa50_50', fit: BoxFit.fill, ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(15), ), ), ), Image쪽에 0.5 alpha, colo.. 2022. 4. 9.
[Flutter] ScrollView Scroll Glow 효과 없애기 class MyBehavior extends ScrollBehavior { @override Widget buildOverscrollIndicator( BuildContext context, Widget child, ScrollableDetails details) { return child; } } MaterialApp의 속성으로 scrollBehavior가 있는데 여기에 넣어주자. https://stackoverflow.com/a/51119796/17141266 2022. 4. 9.
[Flutter] BottomSheet 확장하기 showModalBottomSheet( isScrollControlled: true, context: context, builder: (BuildContext bc) { return Wrap( children: [...] ) } ) isScrollControlled가 중요하다. 해당 속성을 주지 않으면 마진이 먹지 않는 경우가 있음. 2022. 4. 8.
[Flutter] Navigator.push() in Dialog 예를 들어 버튼을 하나 가진 Dialog가 있을 때 OK버튼을 누르면 다른 화면으로 이동하도록 처리를 해야 한다. 이런 상황에서 보통 람다함수를 받을 수 있도록 Dialog를 설계하여 버튼을 누르는 상황에서 함수를 실행할 것이다. 비슷한 처리를 하던 다른 부분에서 왜 동작이 정상적으로 이루어 졌는지 확인을 해보니 Delayed 처리가 되어 있었다. Future.delayed(const Duration(milliseconds: 1500, ), () { Navigator.of(context, rootNavigator: true).pop('dialog'); ... 중략 Navigator.push(context, MaterialPageRoute(builder: (context) => const newScreen.. 2022. 4. 7.
[Flutter] TextFormField 정리 final GlobalKey _formKey = GlobalKey(); FormKey를 선언하여 사용 영역 widget에 Form을 감싸고 key 속성으로 추가를 해둔다. 이러한 처리를 하는 이유는 나중에 전체 텍스트 필드에 대하여 error가 있는지 판단하기 위함이다. formKey쪽에서 이를 인식해서 쉽게 이용할 수 있다. 입력할 때 커서 색상, HighLight 색상을 바꾸려면 MaterialApp의 테마에서 해당 속성을 처리하면 된다. textSelectionTheme: const TextSelectionThemeData( cursorColor: Color.fromARGB(255, 255, 0, 255), selectionColor: Color.fromARGB(255, 185, 185, 185),.. 2022. 4. 6.
[Flutter] 스크린 하단에 Widget 배치 찾아보면 Column 안에 넣어서 정렬을 해가지고 .. 밑에 배치를 시키는 그런 방법이 많이 나오는데 내가 발견한 쉬운 방법은 Expanded 위젯을 사용하는 방법이다. Column( children: [ const Expanded( child: Center(child: null), ), // 위젯 자리 const Padding(padding: EdgeInsets.only(bottom: 32),), ], ) Column의 children에 하나씩 배치를 하는데 가장 하단까지 margin을 주기에는 무리가 있다. (기기마다 스크린 크기가 달라서 하드코딩으로는 문제가 생길 것이다.) 방법을 찾아보니 Expanded를 이용하여 자리를 차지하도록 하고 맨 밑에 원하는 만큼의 Padding을 주는 방법이 있어서 .. 2022. 4. 3.
[Flutter] 둥근 버튼 만들기 SizedBox( width: 80, height: 80, child: Container( decoration: BoxDecoration( border: Border.all( color: Colors.grey, width: 4), shape: BoxShape.circle, ), child: MaterialButton( onPressed: () { }, color: Colors.grey, child: Text("토익", style: const TextStyle(color: Colors.black, fontSize: 18), ), padding: const EdgeInsets.all(8), shape: const CircleBorder(), ) )​ Border 효과를 주고 싶다면 Container를 사용하.. 2022. 4. 3.
[Flutter] List<TextSpan> in ChangeNotifier ChangeNotifier 내부에서 데이터를 로드하고 List에 데이터를 채우는 형태를 가지고 있었는데 해당 데이터를 채우고 NotifyListeners()를 호출해줘도 갱신이 안 되었다. 값은 이미 바뀌어 있는 상태 RichText( text: TextSpan( style: const TextStyle( color: Colors.white, fontSize: 18, ), children: notifier.descDataList, // not working ), ) children: notifier.isQuizNotCorrect() ? notifier.descDataList : null, 이렇게 바꿔주니까 인식이 되기 시작한다. LiveData 개념에서도 특정 Observable 상태인 데이터가 바뀌어야.. 2022. 4. 2.
[Flutter] RichText 안드로이드에서 여러 텍스트들 사이에서 원하는 Style을 적용하고 싶은 경우에 Span을 사용한다. Flutter에서 이러한 처리를 하기 위해 RichText 위젯을 사용하는데 사용법은 이렇다. RichText( text: TextSpan( style: const TextStyle( color: Colors.white, fontSize: 18, ), children: [ const TextSpan(text: "정답은 "), TextSpan( text: "사과", style: const TextStyle( color: Colors.yellow, fontWeight: FontWeight.bold)), const TextSpan(text: "에요."), ], ); RichText로 감싸고 TextSpan을 넣.. 2022. 4. 2.
[Java] 학생 관리 프로그램 학교에서 자바 프로젝트를 만들어 제출하는 수행평가가 있어서 제출했던 것을 올린다. 실제 제출했던 파일 그대로 이고, C++ 스타일을 최대한 살려서 만들었다. 자바로 만든 학생 관리 프로그램 코드를 참고하고 싶다면 마음껏 이용해도 좋다. ​ 보고서나 ppt는 코드 이해를 위한 용도로만 써주시길 바랍니다. (사실 별거 없음) 2022. 4. 1.
[Java] for-each class Exam { public static void main(String[] args) { int a[] = new int[] {100, 200, 300}; char c[] = new char[] {'a', 'b', 'c', 'd'}; String str[] = new String[] {"hansei", "cyber", "security"}; int sum = 0; for(int k : a) sum += k; System.out.println(sum); for(char k : c) System.out.print(k + " "); for(String k : str) System.out.print(k + " "); } } 600 a b c d hansei cyber security 2022. 4. 1.
[Java] label class Exam { public static void main(String[] args) { label: for(int i = 0; i 2022. 4. 1.
[Java] Scanner & 표준 출력 스트림 Scanner import java.util.Scanner; class Exam { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("String Line : "); // \n까지 받아서 버림 System.out.println(scanner.nextLine()); System.out.println("String : "); System.out.println(scanner.next()); System.out.println("Byte : "); System.out.println(scanner.nextByte()); System.out.println("Short : "); Sys.. 2022. 4. 1.
[Java] 문자 입력 받기 import java.io.IOException; class Exam { public static void main(String[] args) throws IOException { int Input1 = System.in.read(); int Input2 = System.in.read(); int Input3 = System.in.read(); int Input4 = System.in.read(); int Input5 = System.in.read(); System.out.println("Input1 : " + Input1); System.out.println("Input2 : " + Input2); System.out.println("Input3 : " + Input3); System.out.print.. 2022. 4. 1.
[Android] EditText 주로 쓰는 옵션 EditText의 옵션에 따라서 기본 키패드 옵션이 달라지게 된다. ​ // 문자열 추가 android:text="@string/str_dot" ​ // 텍스트 정렬 , 색상, 크기, style(bold, normal, italic), 입력 가능 문자 android:textAlignment="center" android:textColor="@color/black" android:textSize="50dp" android:textStyle="normal" android:maxLength="6" ​ // 비밀번호 입력 타입(영어) android:inputType="textPassword" ​ // 숫자 키패드 android:inputType="number" ​ // 이메일 키패드(영어, @) android:.. 2022. 4. 1.