모바일 오유 바로가기
http://m.todayhumor.co.kr
분류 게시판
베스트
  • 베스트오브베스트
  • 베스트
  • 오늘의베스트
  • 유머
  • 유머자료
  • 유머글
  • 이야기
  • 자유
  • 고민
  • 연애
  • 결혼생활
  • 좋은글
  • 자랑
  • 공포
  • 멘붕
  • 사이다
  • 군대
  • 밀리터리
  • 미스터리
  • 술한잔
  • 오늘있잖아요
  • 투표인증
  • 새해
  • 이슈
  • 시사
  • 시사아카이브
  • 사회면
  • 사건사고
  • 생활
  • 패션
  • 패션착샷
  • 아동패션착샷
  • 뷰티
  • 인테리어
  • DIY
  • 요리
  • 커피&차
  • 육아
  • 법률
  • 동물
  • 지식
  • 취업정보
  • 식물
  • 다이어트
  • 의료
  • 영어
  • 맛집
  • 추천사이트
  • 해외직구
  • 취미
  • 사진
  • 사진강좌
  • 카메라
  • 만화
  • 애니메이션
  • 포니
  • 자전거
  • 자동차
  • 여행
  • 바이크
  • 민물낚시
  • 바다낚시
  • 장난감
  • 그림판
  • 학술
  • 경제
  • 역사
  • 예술
  • 과학
  • 철학
  • 심리학
  • 방송연예
  • 연예
  • 음악
  • 음악찾기
  • 악기
  • 음향기기
  • 영화
  • 다큐멘터리
  • 국내드라마
  • 해외드라마
  • 예능
  • 팟케스트
  • 방송프로그램
  • 무한도전
  • 더지니어스
  • 개그콘서트
  • 런닝맨
  • 나가수
  • 디지털
  • 컴퓨터
  • 프로그래머
  • IT
  • 안티바이러스
  • 애플
  • 안드로이드
  • 스마트폰
  • 윈도우폰
  • 심비안
  • 스포츠
  • 스포츠
  • 축구
  • 야구
  • 농구
  • 바둑
  • 야구팀
  • 삼성
  • 두산
  • NC
  • 넥센
  • 한화
  • SK
  • 기아
  • 롯데
  • LG
  • KT
  • 메이저리그
  • 일본프로야구리그
  • 게임1
  • 플래시게임
  • 게임토론방
  • 엑스박스
  • 플레이스테이션
  • 닌텐도
  • 모바일게임
  • 게임2
  • 던전앤파이터
  • 마비노기
  • 마비노기영웅전
  • 하스스톤
  • 히어로즈오브더스톰
  • gta5
  • 디아블로
  • 디아블로2
  • 피파온라인2
  • 피파온라인3
  • 워크래프트
  • 월드오브워크래프트
  • 밀리언아서
  • 월드오브탱크
  • 블레이드앤소울
  • 검은사막
  • 스타크래프트
  • 스타크래프트2
  • 베틀필드3
  • 마인크래프트
  • 데이즈
  • 문명
  • 서든어택
  • 테라
  • 아이온
  • 심시티5
  • 프리스타일풋볼
  • 스페셜포스
  • 사이퍼즈
  • 도타2
  • 메이플스토리1
  • 메이플스토리2
  • 오버워치
  • 오버워치그룹모집
  • 포켓몬고
  • 파이널판타지14
  • 배틀그라운드
  • 기타
  • 종교
  • 단어장
  • 자료창고
  • 운영
  • 공지사항
  • 오유운영
  • 게시판신청
  • 보류
  • 임시게시판
  • 메르스
  • 세월호
  • 원전사고
  • 2016리오올림픽
  • 2018평창올림픽
  • 코로나19
  • 2020도쿄올림픽
  • 게시판찾기
  • 게시물ID : programmer_9558
    작성자 : 아촉불
    추천 : 0
    조회수 : 1751
    IP : 122.32.***.36
    댓글 : 5개
    등록시간 : 2015/04/26 21:42:13
    http://todayhumor.com/?programmer_9558 모바일
    안드로이드 스튜디오 실행파일좀 만들어주실분...
    내일 당장 학교과제인데 집에 안드로이드 스튜디오가 먹통이라서 실행이 않돼네요;;
    소스는 다있고 실행파일만 만들면돼는데 부탁드리겠습니다.ㅠㅠ

    Biorhythm.java
    package com.zzerr;

    import android.app.Activity;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;

    public class Biorhythm extends Activity {
        private BioView bioView;
        private EditText inputYear, inputMonth, inputDay;
        
        
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            
            setContentView(R.layout.main);
            
            bioView = (BioView)findViewById(R.id.myView);
            
            inputYear = (EditText)findViewById(R.id.inputYear);
            inputMonth = (EditText)findViewById(R.id.inputMonth);
            inputDay = (EditText)findViewById(R.id.inputDay);
            
            
            Button button = (Button)findViewById(R.id.showButton);
            button.setOnClickListener(new Button.OnClickListener() {
                public void onClick(View v) {
                    bioView.setBirthDay(Integer.parseInt(inputYear.getText().toString()), 
                            Integer.parseInt(inputMonth.getText().toString()),
                            Integer.parseInt(inputDay.getText().toString()));
                    
                    bioView.invalidate();
                }
            });
        }
    }

    BioView.java
    package com.zzerr;

    import android.view.View;
    import android.content.Context;
    import android.util.AttributeSet;
    import android.graphics.Canvas;
    import android.graphics.Paint;
    import android.graphics.Rect;
    import android.util.Log;

    import java.util.Date;

    public class BioView extends View {
        
        private static final int mMaxDays = 30;
        private static final int mMaxType = 3;
        private static final long mTDV = (60*60*24*1000);
        private static final double mPI = 3.14159; 
        
        private static final double mBioValues[] = { 23.0, 28.0, 33.0 };
        private static final int mColors[] = { 0xff0000ff, 0xffff00ff, 0xff00ffff };
        
        
        private Paint mPaint;
        private Rect mRect;
        private double mStartDays;
        private Date mBirthDate, mTodayDate;
            
        public BioView(Context context, AttributeSet attrs) {
            super(context, attrs);
            
            mRect = new Rect();
            mPaint = new Paint();
            
            mRect.top = 0;
            mRect.bottom = getWidth();
            mRect.left = 0;
            mRect.right = getHeight();

            mTodayDate = new Date();
            Date startDate = new Date(mTodayDate.getYear(), mTodayDate.getMonth(), 1);
            
            mStartDays = startDate.getTime()/mTDV;
            mBirthDate = new Date();
            
            mBirthDate.setYear(0);
        }
        
        public void setBirthDay(int year, int month, int day) {
            mBirthDate.setYear(year);
            mBirthDate.setMonth(month);
            mBirthDate.setDate(day);
        }

       @Override
       protected void onDraw(Canvas canvas) {
            int cellWidth = getWidth()/mMaxDays;
            
            mRect.top = 0;
            mRect.bottom = getWidth();
            mRect.left = 0;
            mRect.right = getHeight();
            
            mPaint.setStyle(Paint.Style.STROKE);
            mPaint.setColor(0xFFFFFFFF);

            int x = 0, y = 0, oldY = 0;
             
            // 세로줄 출력
            for (int i = 0; i <= mMaxDays; i++) {
                x += cellWidth;
                canvas.drawLine(x, mRect.top, x, mRect.bottom, mPaint);
            }
             
            // 가로줄 출력
            canvas.drawLine(0, mRect.bottom/2, mRect.right, mRect.bottom/2, mPaint);
          
            // 오늘 날짜 출력
            mPaint.setColor(0xFFFFFF00);
            x = cellWidth * mTodayDate.getDate(); 
            canvas.drawLine(x, mRect.top, x, mRect.bottom, mPaint);
                  
            // 바이오리듬 출력
            if (mBirthDate.getYear() != 0) {
                Log.e("LOG", "year:" + mBirthDate.getYear() +
                        "month:" + mBirthDate.getMonth() +
                        "day:" + mBirthDate.getDate());
                
                double startDays = mStartDays;
                double birthDays = mBirthDate.getTime()/mTDV;
                     
                for (int k = 0; k < mMaxType; k++) {
                    x = 0;
                 
                    mPaint.setColor(mColors[k]);
                 
                    for (int i = 0; i <= mMaxDays; i++) {
                        double gab = birthDays - startDays;
                        double p = (int)(Math.sin((gab/mBioValues[k]) * 2.0 * mPI) * 100.0);
       
                        y = mRect.bottom/2 + (int)(p * ((mRect.bottom/2.0)/100.0));
                        
                        if (i != 0)
                            canvas.drawLine(x, oldY, x + cellWidth, y, mPaint);
                        
                        oldY = y;
                        startDays++;
                        x += cellWidth;
                    }
                }
            }
            
            super.onDraw(canvas);
        }
    }

    main.xml
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#666666"
        >

    <com.zzerr.BioView android:id="@+id/myView" 
        android:layout_width="fill_parent" 
        android:layout_height="330px" 
        android:background="#000000"
        />
        
    <TextView android:id="@+id/helpLabel" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_below="@id/myView"
        android:layout_marginTop="20px"
        android:text="생년월일을 입력후에 보기버튼을 클릭해 주세요."
        />

    <EditText android:id="@+id/inputYear" 
        android:layout_width="80px" 
        android:layout_height="wrap_content" 
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:text="" 
        />

    <EditText android:id="@+id/inputMonth" 
        android:layout_width="60px" 
        android:layout_height="wrap_content" 
        android:layout_toRightOf="@id/inputYear"
        android:layout_alignTop="@id/inputYear"
        android:text="" 
        />

    <EditText android:id="@+id/inputDay" 
        android:layout_width="60px" 
        android:layout_height="wrap_content" 
        android:layout_below="@id/myView"
        android:layout_toRightOf="@id/inputMonth"
        android:layout_alignTop="@id/inputMonth"
        android:text="" 
        />
            
    <Button android:id="@+id/showButton" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_alignParentRight="true"
         android:layout_marginLeft="10px"
         android:layout_toRightOf="@id/inputDay"
         android:layout_alignTop="@id/inputDay"
         android:text="보기" 
         />

    </RelativeLayout>

    R.java
    /* AUTO-GENERATED FILE.  DO NOT MODIFY.
     *
     * This class was automatically generated by the
     * aapt tool from the resource data it found.  It
     * should not be modified by hand.
     */

    package com.zzerr;

    public final class R {
        public static final class attr {
        }
        public static final class drawable {
            public static final int icon=0x7f020000;
        }
        public static final class id {
            public static final int helpLabel=0x7f050001;
            public static final int inputDay=0x7f050004;
            public static final int inputMonth=0x7f050003;
            public static final int inputYear=0x7f050002;
            public static final int myView=0x7f050000;
            public static final int showButton=0x7f050005;
        }
        public static final class layout {
            public static final int main=0x7f030000;
        }
        public static final class string {
            public static final int app_name=0x7f040001;
            public static final int hello=0x7f040000;
        }
    }

    [email protected] 파일좀 보내주시면 감사드리겟습니다.ㅠㅠ

    이 게시물을 추천한 분들의 목록입니다.
    푸르딩딩:추천수 3이상 댓글은 배경색이 바뀝니다.
    (단,비공감수가 추천수의 1/3 초과시 해당없음)

    죄송합니다. 댓글 작성은 회원만 가능합니다.

    번호 제 목 이름 날짜 조회 추천
    23461
    로또 [2] 까망사투리 25/02/12 13:13 445 2
    23459
    C++ 입문전 초보자입니다. Qt / wxWidgets / FLTK 어떤 [6] OMG! 24/12/07 00:28 949 0
    23458
    [KOCCA] 2024 게임콘텐츠 제작지원 이용자평가 체험단모집 장파랑 24/11/26 16:56 929 0
    23457
    [한국콘텐츠진흥원] 2024 게임콘텐츠 제작지원 이용자평가 이용자 모집 장파랑 24/11/18 14:02 962 0
    23456
    [한국콘텐츠진흥원] 2024 게임콘텐츠 제작지원 이용자평가 이용자 모집 장파랑 24/10/28 18:24 1362 0
    23455
    논문 읽는 사람들을 위한 문서 번역 서비스 rWhale 24/10/10 13:06 1691 2
    23453
    로또번호 [2] 까망사투리 24/09/19 11:10 2321 2
    23452
    AI와 함께가는 코딩 업계 [1] 펌글 우가가 24/09/02 22:19 2567 9
    23451
    Switch문 도배된 2100줄 짜리 함수 [4] 펌글 우가가 24/08/26 22:37 2429 4
    23450
    개인정보 수집 없는 이미지 리사이즈 사라밍 24/08/23 20:31 1836 0
    23449
    디자인 패턴의 템플릿 메소드 패턴 실무 적용 사례 [1] 써니썬 24/08/23 16:47 1846 1
    23448
    TMDB API Key 얻을 때 동의하게 되는 면책 및 포기 조항 우가가 24/08/18 16:07 1851 1
    23447
    펌) 아무튼 개쩌는 번역기를 국내기술로 개발완료 했다는 소식 [1] 펌글 우가가 24/08/15 17:30 2117 2
    23446
    쿠팡 가격 변동 추적 알림 서비스 피드백 요청 (제발) 창작글펌글 애오옹 24/08/10 14:30 2067 0
    23445
    넥사크로 17.1 관련 [2] 본인삭제금지 나르하나 24/08/01 12:30 2053 0
    23444
    개밯자 의자에 머리받침 없어 [2] 까망사투리 24/07/25 13:32 2446 1
    23443
    안드로이드 EditText 리스너 연동 문의드립니다. - 해결됨 [1] 창작글 상사꽃 24/07/01 17:47 2317 2
    23442
    펌) 파이어폭스 엔진이 신인 이유 [1] 펌글 우가가 24/06/30 23:25 2919 2
    23441
    예전에는 함수 하나에 대한 기능에 고민을 많이 했는데.. ssonacy 24/05/21 09:45 2683 0
    23440
    c++ 에서 DB 쿼리문처럼 사용할 방법이 있을까요? [8] 상사꽃 24/05/19 11:10 2839 0
    23439
    쉬운 배터리 알림 창작글 언젠가아자 24/05/14 10:47 2973 0
    23438
    아후 서터레스 [1] NeoGenius 24/04/02 17:52 2657 1
    23436
    로또 [3] 까망사투리 24/03/11 15:53 3340 4
    23434
    copilot 기업유료버전 intelliJ에 붙여서 쓰고있는데 지리네요 안녕월드 24/02/22 00:15 3345 0
    23433
    코딩마을 대나무숲 [6] cocoa 24/02/20 14:50 3512 5
    23432
    (질문) 프로그래머분들은 싱글PC게임 레벨제한 풀수 있죠?? [23] 본인삭제금지 할배궁디Lv2 24/02/13 13:36 3522 1
    23431
    Freemium NeoGenius 24/02/13 13:23 2954 0
    23429
    부산에서 프로그래머 구인하는데 연봉 6천에서 8천 작은건가 [3] 폴팡 24/02/04 20:50 3866 1
    23427
    chatgpt? bard? [3] 별빛러브 24/01/25 06:24 3090 0
    23426
    Next.js로 만들어봤어요~ [2] 창작글 sonnim 24/01/24 12:52 3326 3
    [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [다음10개▶]
    단축키 운영진에게 바란다(삭제요청/제안) 운영게 게시판신청 자료창고 보류 개인정보취급방침 청소년보호정책 모바일홈