달력

3

« 2024/3 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2011. 8. 26. 11:45

getVisibility와 View.GONE View.INVISIBLE Study/Android2011. 8. 26. 11:45

이미지 뷰의 보이기 상태를 조사함....

View.GONE   아예 View의 영역부분 조차 없앰

View.INVISIBLE    영역은 있지만 보이지는 않음 

'Study > Android' 카테고리의 다른 글

상태바 Notification 예제 파일분석  (0) 2011.08.29
Intent  (0) 2011.08.29
getSystemService  (0) 2011.08.29
Style / Theme  (0) 2011.08.29
Notification 공부 정리  (0) 2011.08.29
layout_alignWithParentIfMissing  (0) 2011.08.26
Relative Layout 예제 중 명함예제  (0) 2011.08.26
LinerLayout 추가 기록  (0) 2011.08.25
Android process 개략설명  (0) 2011.08.25
AndroidManifest 개략 설명  (0) 2011.08.25
:
Posted by 유쾌한순례자
2011. 8. 26. 00:51

layout_alignWithParentIfMissing Study/Android2011. 8. 26. 00:51

android:layout_toLeftOf="@id/icon"
android:layout_alignWithParentIfMissing="true"
android:layout_centerVertical="true"  


안드로이드 배치하다보니까 느낀건데 직관적으로 써 있어서 너무 좋다. 

해당 이미지가 사라지면 부모를 기준으로 해 라는 말.

'Study > Android' 카테고리의 다른 글

Intent  (0) 2011.08.29
getSystemService  (0) 2011.08.29
Style / Theme  (0) 2011.08.29
Notification 공부 정리  (0) 2011.08.29
getVisibility와 View.GONE View.INVISIBLE  (0) 2011.08.26
Relative Layout 예제 중 명함예제  (0) 2011.08.26
LinerLayout 추가 기록  (0) 2011.08.25
Android process 개략설명  (0) 2011.08.25
AndroidManifest 개략 설명  (0) 2011.08.25
Activity Life Cycle  (0) 2011.08.25
:
Posted by 유쾌한순례자
2011. 8. 26. 00:31

Relative Layout 예제 중 명함예제 Study/Android2011. 8. 26. 00:31

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#ffffff"
    android:padding="5dip"
    >
<ImageView 
android:id="@+id/pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/picman"
/>
<TextView 
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4px"
android:layout_toRightOf="@id/pic"
android:textSize="20sp"
android:text="홍길동"
/>
<TextView 
android:id="@+id/phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignBaseline="@id/title"
android:textSize="12sp"
android:text="015-123-4567"
/>
<Button 
android:id="@+id/delButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/pic"
android:text="Del"
/>
<TextView 
android:id="@+id/contents"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/delButton"
android:layout_below="@id/title"
android:layout_alignLeft="@id/title"
android:layout_centerVertical="true"
android:text="우리 딸래미가 처음 그린 그림이다. 누구를 그린것인지는 알 수 없으나 머리카락이 몇올 없는 것으로 보아 갓 태어난 동새을 그린 것으로
추측된다. 본인도 기억이 나지 않는다 하여 확인할 방법은 없다."
/>

</RelativeLayout>


문제점분석

1) 전화번호 배치 틀린이유

android:layout_alignParentRight="true" 와 동시에 android:layout_toRightOf="@id/title" 를 썼더니 

title에 바짝 붙어버렸다. 아예 오른쪽 정렬을 하고자 할때는 alignParentRight가 맞구나.
(사실 좀만 생각해봐도 나왔을 답이였는데)

2) Contents 배치가 겹쳐버린 이유
android:layout_alignLeft="@id/title" 요부분 빼먹어서.


이런거 한번해보니까 배치가 어떻게 돌아가는지 충분히 감이 오는구마....


'Study > Android' 카테고리의 다른 글

getSystemService  (0) 2011.08.29
Style / Theme  (0) 2011.08.29
Notification 공부 정리  (0) 2011.08.29
getVisibility와 View.GONE View.INVISIBLE  (0) 2011.08.26
layout_alignWithParentIfMissing  (0) 2011.08.26
LinerLayout 추가 기록  (0) 2011.08.25
Android process 개략설명  (0) 2011.08.25
AndroidManifest 개략 설명  (0) 2011.08.25
Activity Life Cycle  (0) 2011.08.25
layout_gravity vs gravity  (0) 2011.08.25
:
Posted by 유쾌한순례자
2011. 8. 25. 20:50

LinerLayout 추가 기록 Study/Android2011. 8. 25. 20:50

baselineAligned 밑에줄 맞추기

layout_weight 비율로 남은 레이아웃 영역 차지하기

padding 뷰와 내용물의 간격

margin 뷰와 부모사이

'Study > Android' 카테고리의 다른 글

getSystemService  (0) 2011.08.29
Style / Theme  (0) 2011.08.29
Notification 공부 정리  (0) 2011.08.29
getVisibility와 View.GONE View.INVISIBLE  (0) 2011.08.26
layout_alignWithParentIfMissing  (0) 2011.08.26
Relative Layout 예제 중 명함예제  (0) 2011.08.26
Android process 개략설명  (0) 2011.08.25
AndroidManifest 개략 설명  (0) 2011.08.25
Activity Life Cycle  (0) 2011.08.25
layout_gravity vs gravity  (0) 2011.08.25
:
Posted by 유쾌한순례자
2011. 8. 25. 16:44

Android process 개략설명 Study/Android2011. 8. 25. 16:44

process

foreground : 현재활성상태에있는 어플리케이션정보를 관리
background : Life cycle의 stop 상태에 있는 것들 관리. 또는 음악같은것.메모리가 부족하여  kill된 activity 의 정보를 기억하고 있음.(30분동안 BACK되지 않으면 삭제)
service : 서비스를 유지 저장 전달 
visible : 사용자화면에는 나타나나 foreground가 관리하는건 아닐때
empty : 활성화 된 어플리케이션도 점유하지 않음. (다음에 실행할필요가 있을때 준비하고 있는 프로세스 - 최대 3가지)

'Study > Android' 카테고리의 다른 글

getSystemService  (0) 2011.08.29
Style / Theme  (0) 2011.08.29
Notification 공부 정리  (0) 2011.08.29
getVisibility와 View.GONE View.INVISIBLE  (0) 2011.08.26
layout_alignWithParentIfMissing  (0) 2011.08.26
Relative Layout 예제 중 명함예제  (0) 2011.08.26
LinerLayout 추가 기록  (0) 2011.08.25
AndroidManifest 개략 설명  (0) 2011.08.25
Activity Life Cycle  (0) 2011.08.25
layout_gravity vs gravity  (0) 2011.08.25
:
Posted by 유쾌한순례자
2011. 8. 25. 16:44

AndroidManifest 개략 설명 Study/Android2011. 8. 25. 16:44



versionCode,versionName 은 마켓에 올릴때 기존 버전을 수정해서 올려야함.

application android:icon =          @ <- R클래스 참조하라는이야기    drawable/icon (drawable폴더의 icon이미지참조)

(실제 어플리케이션 아이콘의 모양)

/* 이미지 파일의 확장자는 굳이 신경쓸필요가 없다. 그러나 이름은 변수로 사용되기때문에 전부다르게한다 */

            andorid:label =  @string/app_name   string.xml의 app_name참조

<activity> 

android:name   = 작동클래스
android:label  = activity 제목 

    <intent-filter>
action android:name=" ~~~MAIN" />
        category android:name=" ~~~ LAUNCHER" /> 이런식으로 main launcher로 되면 시작화면

    </intent-filter>
</activity>

'Study > Android' 카테고리의 다른 글

getSystemService  (0) 2011.08.29
Style / Theme  (0) 2011.08.29
Notification 공부 정리  (0) 2011.08.29
getVisibility와 View.GONE View.INVISIBLE  (0) 2011.08.26
layout_alignWithParentIfMissing  (0) 2011.08.26
Relative Layout 예제 중 명함예제  (0) 2011.08.26
LinerLayout 추가 기록  (0) 2011.08.25
Android process 개략설명  (0) 2011.08.25
Activity Life Cycle  (0) 2011.08.25
layout_gravity vs gravity  (0) 2011.08.25
:
Posted by 유쾌한순례자
2011. 8. 25. 16:43

Activity Life Cycle Study/Android2011. 8. 25. 16:43

Activity life cycle  (컨텐츠 프로바이더는 라이프 사이클이 없음)


onCreate() 한번만 실행(어플이 실행될때최초) 기본적화면구성
onStart()  데이터 가져오는것(DB에서 가져오는것등)
onResume() 음악파일 또는 배경음악같은것 가져올때.
실행
다음화면을볼때
onPause() 
다른 Activity
onCreate()
onStart()
onResume()
현재 ACTIVTY 에서 다른 ACTIVTY 화면으로 전환
현재 activity는 onStop()
...

'Study > Android' 카테고리의 다른 글

getSystemService  (0) 2011.08.29
Style / Theme  (0) 2011.08.29
Notification 공부 정리  (0) 2011.08.29
getVisibility와 View.GONE View.INVISIBLE  (0) 2011.08.26
layout_alignWithParentIfMissing  (0) 2011.08.26
Relative Layout 예제 중 명함예제  (0) 2011.08.26
LinerLayout 추가 기록  (0) 2011.08.25
Android process 개략설명  (0) 2011.08.25
AndroidManifest 개략 설명  (0) 2011.08.25
layout_gravity vs gravity  (0) 2011.08.25
:
Posted by 유쾌한순례자
2011. 8. 25. 16:42

layout_gravity vs gravity Study/Android2011. 8. 25. 16:42

gravity : 뷰안의 내용물을 어디에 정렬할것인가
layout_gravity : 레이아웃 어디에 정렬할것인가 

'Study > Android' 카테고리의 다른 글

getSystemService  (0) 2011.08.29
Style / Theme  (0) 2011.08.29
Notification 공부 정리  (0) 2011.08.29
getVisibility와 View.GONE View.INVISIBLE  (0) 2011.08.26
layout_alignWithParentIfMissing  (0) 2011.08.26
Relative Layout 예제 중 명함예제  (0) 2011.08.26
LinerLayout 추가 기록  (0) 2011.08.25
Android process 개략설명  (0) 2011.08.25
AndroidManifest 개략 설명  (0) 2011.08.25
Activity Life Cycle  (0) 2011.08.25
:
Posted by 유쾌한순례자

http://www.narratage.com/project/TodoList.do

원하는 결과물 /TodoList.do

str.substring(str.lastIndexOf("/"),str.length())
:
Posted by 유쾌한순례자
2011. 7. 20. 16:51

AWT Frame 윈도우 정 가운데에 오기 Study/Java2011. 7. 20. 16:51


import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Toolkit;

public class MyFrame {

public static void main(String[] args){

Frame f = new Frame("AWT TEST");

//윈도우 사이즈 구하기
Dimension dim1 = Toolkit.getDefaultToolkit().getScreenSize(); 

//Frame 사이즈 구하기
Dimension dim2 = f.getSize();  

f.setVisible(true);

//Frame 윈도우 가운데에 띄우기 공식
f.setLocation((int)dim1.getWidth()/2-(int)dim2.getWidth()/2, 
                                                         (int)dim1.getHeight()/2-(int)dim2.getHeight()/2);

}

}


 

:
Posted by 유쾌한순례자