ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 앱 개발 입문 수강 기록 7일 차_2023-02-26
    Study 2023. 2. 26. 16:33

    강좌명

    CH01_08. Firebase, Admob(앱 광고) 사용해보기

    CH01_09. 기능 종합해서 간단한 어플 만들어보기_숫자 카운트 어플


    1. Firebase
      1. 모바일 앱을 분석, 테스트할 뿐만 아니라 개발, 서비스까지 할 수 있는 모바일 개발 플랫폼
        1. Analytics: 사용자 분석
        2. Firestore: 데이터 저장 및 불러오기
        3. Crashlytics: 모바일 오류 분석
        4. Authentication: 사용자 인증
    2. Admob
      1. 구글에서 제공하는 모바일 광고 플랫폼
      2. 앱을 통해서 수익을 창출하는 방법
        1. 배너 광고: 하단 하단에 노출
        2. 전면광고: 화면 전체 노출
        3. 보상형 광고: 게임 아이템 얻기
        4. admob_flutter 라이브러리 사용 예정
    3. 숫자 카운트 어플
      1. 축구, 탁구, 배드민턴 등 다양한 운동 종목에서 사용가능한 점수 카운트 어플
      2. 각 종목에 맞게 종료 점수를 변경할 수 있으며 점수를 증가, 감소시킬 수 있음
    4. 코드
    import 'package:flutter/material.dart';
    
    void main() {
      runApp(const MyApp());
    }
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: '숫자 카운트 앱',
          theme: ThemeData(
            primarySwatch: Colors.blue,
          ),
          home: const MyHomePage(title: '숫자 카운트 앱 메인 페이지'),
        );
      }
    }
    
    class MyHomePage extends StatefulWidget {
      const MyHomePage({super.key, required this.title});
    
      final String title;
    
      @override
      State<MyHomePage> createState() => _MyHomePageState();
    }
    
    class _MyHomePageState extends State<MyHomePage> {
      int _counter = 0;
      int _idx = 0;
      Color color = Colors.blue;
      int count1 = 0;
      int count2 = 0;
      String vicTeam = "";
    
      void _incrementCounter() {
        setState(() {
          _counter++;
        });
      }
    
      @override
      void initState() {
        super.initState();
        color = Colors.green;
      }
    
      Widget build(BuildContext context) {
        return Scaffold(
            appBar: AppBar(
              title: Text(widget.title),
            ),
            body: Column(
              children: [
                Container(height: 50),
                Text("탁구 대회",
                    style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold)),
                Container(height: 30),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: [
                    Text("패스트 대학"),
                    Text("캠퍼스 대학"),
                  ],
                ),
                Container(height: 10),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: [
                    Text("$count1점",
                        style:
                            TextStyle(fontSize: 25, fontWeight: FontWeight.bold)),
                    Text("$count2점",
                        style:
                            TextStyle(fontSize: 25, fontWeight: FontWeight.bold)),
                  ],
                ),
                Container(height: 30),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        IconButton(
                          icon: Icon(Icons.add),
                          onPressed: () {
                            setState(() {
                              count1 = count1 + 1;
                              if(count1 >= 10){
                                vicTeam = "패스트 대학 승리!!!";
                              }
                            });
                          },
                        ),
                        IconButton(
                          icon: Icon(Icons.remove),
                          onPressed: () {
                            setState(() {
                              count1 = count1 - 1;
                            });
                          },
                        ),
                      ],
                    ),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceAround,
                      children: [
                        IconButton(
                          icon: Icon(Icons.add),
                          onPressed: () {
                            setState(() {
                              count2 = count2 + 1;
                              if(count2 >= 10){
                                vicTeam = "캠퍼스 대학 승리!!!";
                              }
                            });
                          },
                        ),
                        IconButton(
                          icon: Icon(Icons.remove),
                          onPressed: () {
                            setState(() {
                              count2 = count2 - 1;
                            });
                          },
                        ),
                      ],
                    ),
                  ],
                ),
                Container(height: 20),
                Text(vicTeam, style: TextStyle(fontSize: 50, color: Colors.green),
                )
              ],
            ));
      }
    }

     

    1. 정리
      1. 이제 괄호에 좀 익숙해졌다.
        1. 안드로이드 스튜디오에서 작업할 때 코드 리포맷 기능을 써주자. 보기가 더 편해진다.
          1. VSC에서는 자동으로 잘 해줘서 신경을 덜 썼었는데 얘는 줄 바꿈 때 자꾸 이상한데 갖다 놔서 불편함.
      2. 자동 주석도 이제 익숙해져서 덜 헷갈린다.
      3. 코드 중 아이콘 위치 정렬 함수를 어따 써야 하는지 잠깐 헷갈렸지만 금방 해결함.
        1. 이미지 2번째 -> 3번째

     

    #패스트캠퍼스 #패캠챌린지 #수강료0원챌린지
    #직장인인강 #직장인자기계발 #패캠인강후기 #패스트캠퍼스후기
    #환급챌린지 #오공완 #누적다운로드120만1인개발자와함께하는앱개발입문Online
    http://bit.ly/3Y34pE0

    본 포스팅은 패스트캠퍼스 환급 챌린지 참여를 위해 작성되었습니다.

Designed by Tistory.