전자공학설계실험 A 보고서 화 6A ~ 9B 박종태교수님 제출기한 ( 화 ) Android I.S 작업환경 Eclipse_Juno ver. 전자공학부 이상엽전자공학부 오윤재전자공학부

Size: px
Start display at page:

Download "전자공학설계실험 A 보고서 화 6A ~ 9B 박종태교수님 제출기한 ( 화 ) Android I.S 작업환경 Eclipse_Juno ver. 전자공학부 이상엽전자공학부 오윤재전자공학부"

Transcription

1 전자공학설계실험 A 보고서 화 6A ~ 9B 박종태교수님 제출기한 ( 화 ) Android I.S 작업환경 Eclipse_Juno ver. 전자공학부 이상엽전자공학부 오윤재전자공학부 이준철

2 AppName Oh! My Taxi 택시요금예상측정기 목차 개발동기 본 App의차별성 기능구상 개발과정 동작원리및사용방법 사용도구및 Open Sources(API, Lib) 결과물및추후개발방향 소스코드세부사항 개발동기 이동수단으로택시를선택할때택시비에대한것이늘고민되고걱정된다. 타지에서방문한초행자이거나, 외국인, 버스운행시간종료시에효율적으로택시비를예상하여자금상황과견주어볼어플리케이션의필요성을느껴개발하게되었다. 번거로움없이지정된위치와현재위치간의계산을위하여각기능을추가하여개발하였다 타 App 과비교 < App > < Call Taxi App > 예 1 : 이동경로나미터기에대해 GPS 를이용하여추적하는 App 예 2 : 택시회사에서콜택시에대한서비스를제공하는 App 본 App 가원하는기능의응용은찾아보기힘들다.

3 기능구상 ( 제안내용 ) 및개발환경 기능구상 - 지도탑재 - 선택한위치간의최단경로구현 - 경로의거리측정 - 측정된거리를바탕으로요금계산 - 도착지정보를즐겨찾기로등록 - 즐겨찾기정보를이용하여현재위치를읽어동작 개발환경 - 운영체제 : Windows XP Pro sp3 x86(32bit) Android Icecream Sandwitch (AVD) 개발과정 개괄 - MapView를구현한다음위치를선택하여경로및거리를찾아내어택시요금을계산한다. - 도착지정보를즐겨찾기하여해당위치를출발 / 도착로세팅후현재위치를읽어서위치를선택한다. 단계별세부사항

4 동작원리및사용방법 동작원리 - 앱이시작되면 Map으로의전환과, 즐겨찾기 (DB) 된 ListView가출력된다. - MapView는 DaumOpenAPI를사용하여띄운다. - DaumMaps의메소드를통해위치정보를출발 / 도착지로설정하고해당정보를 ArrayList 로저장한다. - 각각 [0],[1] Node가출발 / 도착지로, 해당정보를가지고 DaumMap의길찾기항목의경로로전송하여 json 파일을받는다. - json파일을파싱하여 NODE별위치를얻어서 HashMap으로받아온다. - HashMap의내용을 Map에 Point를찍어 PolyLine을구현한다. - 도착지의정보 ( 좌표 ) 는 db에추가하여파일로저장한다. - db( 좌표 ) 를읽어와서도착 / 출발지로설정하고, 현위치를호출하여요금계산을수행한다. 사용방법 - 앱을실행시키면버튼과즐겨찾기가있는메인화면이보인다. < > - 위치지정버튼을누르면 MapView가있는화면으로전환된다. 원하는위치로 Map을이동시킨후길게누르면첫번째터치가출발지로, 두번째터치가도착지로지정된다. 기기에있는 Menu을눌러서도착지정보를즐겨찾기로추가할수있다. < MapView, > < >

5 - 요금계산버튼을누르면요금계산화면으로전환된다. 해당좌표값과거리가뜨는데, 상단의요금계산버튼을누르면일반택시 ( 할증 ) 모범택시의예상요금을알수있다. 위치확인버튼을누르면이전경로가표시된화면으로전환되고다시보기버튼을누르면경로가사라진화면으로전환된다. < > - 즐겨찾기추가후처음화면으로돌아가면리스트의형태로위치정보가표시됨을알수있다 출발지그림을누르면해당정보가출발지로, 도착지그림을누르면해당정보가도착지로 설정되고, 현재위치와의길찾기부터수행한다. < ListView, main > < >

6 사용도구및 OpenSources(API, Lib) Mobile DaumMap Open API - Daum에서제공하는 Android용모바일맵오픈 API - MapView, MapPoint, MapPointItem 등의메소드를지원한다. DaumMap Local API - Daum에서제공하는웹용오픈 API(java) - Mobile에서지원하지않는길찾기나좌표계변환기능을지원하고, 본 App에서해당기능을웹에서 Json 파일로받아오는데사용하였다. TransCoord Class - Daum 로컬 API의좌표계변환부분을 Android 용 Class로포팅한것. - Local API 의 Key( 권한 ) 없이사용할수있다. LocationManager - 위치정보를위해 Google에서제공하는 API로 Provider (Network, GPS) 를이용하여받아오는데이용하였다. - 본 App에서는 Network Provider을이용하여기지국정보로부터위치를받아와서사용했다. 결과물및추후개발방향 구현한기능 - 지정된위치에따른경로 ( 길찾기 ) 표시 - db를이용한즐겨찾기항목저장및리스트뷰를이용한즐겨찾기출력 - 네트워크프로바이더를이용한현위치트래킹 - 거리에따른택시요금계산 - 위치에따른경로표시 - 좌표계변환 미구현된기능 - (Reverse) Geo-coding( 주소 좌표 ) 를이용한위치표현 - 시간에따른택시과금적용 개발방향 - Mobile DaumMap API가길찾기기능을제공하지않으므로해당기능들을완전 open source 인 GoogleMaps로포팅 - 미구현기능의추가및예외처리향상 - UI 디자인강화, 도움말항목추가

7 소스코드 Layout & Manifest - addtemp.xml : 위치정보를추가하는 dialog 구성 <LinearLayout xmlns:android=" xmlns:tools=" android:orientation="horizontal" android:id="@+id/lv06"> android:id="@+id/tv_add_name" android:layout_width="wrap_content" android:layout_marginleft="5sp" android:textcolor="#ffff00" android:text=" 명칭 :" /> <EditText android:id="@+id/ev_andd_name" android:layout_marginleft="5sp" android:layout_marginright="5sp" /> </LinearLayout> - calcdistance.xml : 거리계산 Activity 구성 <LinearLayout xmlns:android=" xmlns:tools=" android:layout_height="fill_parent" android:orientation="vertical" android:background="@drawable/back" >// 배경으로이미지를넣음 <Button android:id="@+id/btn_start" android:layout_margintop="10sp" android:layout_marginbottom="10sp" android:text=" 요금계산 " /> android:id="@+id/lblstart_pos" android:text=" 시작지점 :" /> android:id="@+id/start_pos" android:layout_height="50dp" /> android:id="@+id/lblend_pos" android:text=" 끝지점 :" /> android:id="@+id/end_pos" android:layout_height="50dp" /> android:id="@+id/lbldistance_meter" android:text="* 거리 " /> android:id="@+id/distance_meter" android:layout_height="50dp" /> android:id="@+id/lbltaxi_fare" android:text="* 일반택시요금 " /> android:id="@+id/taxi_fare" android:layout_height="50dp" /> android:id="@+id/lbltaxi_faremodel"

8 android:text="* 모범택시요금 " /> android:layout_height="50dp" android:layout_marginbottom="10sp"/> <LinearLayout android:layout_gravity="bottom" android:gravity="center" android:orientation="horizontal" > <Button android:layout_width="80sp" android:layout_marginright="20sp" android:text=" 위치확인 " /> <Button android:layout_width="80sp" android:layout_marginright="20sp" android:text=" 다시지정 " /> <Button android:layout_width="80sp" android:text=" 처음으로 " /> </LinearLayout> </LinearLayout> - favorate.xml : ListView 의항목구성 (Custom ListView) <LinearLayout xmlns:android=" xmlns:tools=" android:gravity="center" android:paddingtop="5px" android:paddingbottom="5px" android:orientation="horizontal" > <LinearLayout android:layout_width="200dp" android:orientation="vertical"> android:id="@+id/location" android:gravity="center_vertical" android:textsize="30px" android:ellipsize="end" />" </LinearLayout> <ImageButton android:id="@+id/btn_bringstart" android:layout_width="60px" android:layout_height="60px" android:layout_gravity="center_vertical" android:src="@drawable/start_2"/>// 이미지버튼으로이미지등록 <ImageButton android:id="@+id/btn_bringend" android:layout_width="60px" android:layout_height="60px" android:paddingleft="60px" android:layout_gravity="center_vertical" android:src="@drawable/end_2"/>" </LinearLayout> - main.xml : main Activity 에대한구성 <LinearLayout xmlns:android=" xmlns:tools=" android:layout_height="fill_parent" android:orientation="vertical" android:background="@drawable/back" >// 레이아웃배경화면등록 <LinearLayout android:orientation="horizontal"

9 android:gravity="center" android:layout_margintop="10sp"> <Button android:text=" 위치지정 android:layout_width="130sp" android:layout_marginright="20sp" <Button android:text=" 종료 " android:layout_width="130sp" </LinearLayout> android:text="( 즐겨찾기 )" android:textcolor="#010bf2" android:textsize="17dp" android:layout_width="wrap_content" android:layout_margintop="10sp" android:layout_marginleft="20sp"/> <LinearLayout android:layout_marginbottom="10sp" android:layout_marginleft="10sp" android:layout_marginright="10sp" android:layout_margintop="10sp" android:layout_height="fill_parent" android:orientation="vertical"> <ListView android:layout_height="fill_parent" />//ListView 항목 </LinearLayout> </LinearLayout> - map.xml : 지도가나오는 Activity 에대한구성 (DaumMapView 탑재 ) <LinearLayout xmlns:android=" xmlns:tools=" android:id="@+id/linlayout00" android:layout_height="fill_parent" android:orientation="vertical" > <net.daum.mf.map.api.mapview android:id="@+id/dmapview" android:layout_width="match_parent" android:layout_height="400dp" />//DaumMap View 를받아오는항목 <LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_margintop="10sp" > <Button android:id="@+id/btn_distance" android:layout_width="130sp" android:layout_marginright="20sp" android:enabled="false" android:text=" 요금계산 " /> <Button android:id="@+id/btn_tomain" android:layout_width="130sp" android:text=" 처음으로 " /> </LinearLayout> <EditText android:id="@+id/temp" /> </LinearLayout>

10 Class(java) - calc.java : 계산 Activity 를구성하는 class package com.android.taximap; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.textview; import android.widget.toast; public class calc extends Activity{ Button btn_start,btn_loca,btn_tomain2,btn_reloca; TextView TVstart_pos, TVend_pos, TVdistance_meter, TVtaxi_fare,TVtaxi_faremodel; int fare, fareplus, faremodel; int distance_meter=jsondecode.distance_temp; double xpoint_start,ypoint_start, xpoint_end,ypoint_end;// public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.calcdistance); btn_start=(button)findviewbyid(r.id.btn_start); btn_loca=(button)findviewbyid(r.id.btn_loca); btn_tomain2=(button)findviewbyid(r.id.btn_tomain2); btn_reloca=(button)findviewbyid(r.id.btn_reloca); TVstart_pos=(TextView)findViewById(R.id.start_pos); TVend_pos=(TextView)findViewById(R.id.end_pos); TVdistance_meter=(TextView)findViewById(R.id.distance_meter); TVtaxi_fare=(TextView)findViewById(R.id.taxi_fare); TVtaxi_faremodel=(TextView)findViewById(R.id.taxi_faremodel); xpoint_start=daummap.alitems.get(0).getmappoint().getmappointwcongcoord().x; //DaumMap Class 에 alitem 의 ArrayList 0 번 index( 출발지 ) 저장된값을가지고옴 ypoint_start=daummap.alitems.get(0).getmappoint().getmappointwcongcoord().y; TVstart_pos.setText(" "+xpoint_start + ", " + ypoint_start); xpoint_end=daummap.alitems.get(1).getmappoint().getmappointwcongcoord().x; ypoint_end=daummap.alitems.get(1).getmappoint().getmappointwcongcoord().y; TVend_pos.setText(" "+xpoint_end + ", " + ypoint_end); TVdistance_meter.setText(" "+distance_meter + " M ("+(double)distance_meter/1000 +" Km )"); // 대구시요금체계 if (distance_meter < 2000) { fare = 2200; fareplus = 2640; faremodel = 4000; else if (distance_meter >= 2000 & distance_meter < 3000) { fare = (int) ( (distance_meter ) / 150 * 100); fareplus = (int) ( (distance_meter ) / 150 * 120); faremodel = (int) 4000; else if (distance_meter >= 3000) { fare = (int) ( (distance_meter ) / 150 * 100); fareplus = (int) ( (distance_meter ) / 150 * 120); faremodel = (int) ( (distance_meter ) / 150 * 200); // 버튼눌럿을때 btn_start.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { TVtaxi_fare.setText(" 비할증시 : " + fare + " 원," + " " + " 할증시 :" + fareplus + " 원 "); TVtaxi_faremodel.setText(faremodel + " 원 "); ); btn_tomain2.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { DaumMap.alitems.clear(); DaumMap._ID=0;// 동작구별을위한식별자를초기값으로세팅 Intent intent = new Intent(calc.this,MainActivity.class); startactivity(intent); Toast.makeText(getBaseContext(), " 처음화면으로...", Toast.LENGTH_SHORT).show();

11 ); btn_reloca.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { DaumMap.alitems.clear(); DaumMap._ID=0; Intent intent = new Intent(calc.this,DaumMap.class); startactivity(intent); ); btn_loca.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { onbackpressed();// 이전으로돌아가기위해 back 버튼을누른효과 ); - Database.java : DB 를구성하는내용에대한 class package com.android.taximap; import android.provider.basecolumns;//basecolumns 를상속받아 DB 를구성한다. public final class Database { public static final class creatdb implements BaseColumns{ public static final String ADDRESS="address"; public static final String XPOINT="xpoint"; public static final String YPOINT="ypoint"; public static final String _TABLE_NAME="locainfo"; public static final String CREATE= "create table "+_TABLE_NAME+"(" +_ID+" integer primary key autoincrement, " +ADDRESS+" text not null, " +XPOINT+" text not null, " +YPOINT+" text not null );"; //creatdb 클래스로각 Column 을정의하고구성한다. _ID 는자동으로증가하도록설정한다.( 입력받지않음 ) - DaumMap.java : MapView 가있는 Activity 를구성하는 class package com.android.taximap; import java.util.arraylist; import kr.hyosang.coordinate.coordpoint; import kr.hyosang.coordinate.transcoord; import net.daum.mf.map.api.mappoiitem; import net.daum.mf.map.api.mappoint; import net.daum.mf.map.api.mappolyline; import net.daum.mf.map.api.mapview; import android.app.activity; import android.app.alertdialog; import android.content.context; import android.content.dialoginterface; import android.content.intent; import android.graphics.color; import android.location.location; import android.location.locationlistener; import android.location.locationmanager; import android.os.bundle; import android.util.log; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.toast; public class DaumMap extends Activity implements MapView.MapViewEventListener { public jsondecode jsd=new jsondecode();//json 파싱을위한인스턴스선언 dbopenhelper mdbopenhelper;//db 를컨트롤하기위해선언 LocationManager locationmanager=null;// 위치정보를받아오기위해선언 Location here=null;// 위치정보를저장하기위해선언 static double xpoint=0,ypoint=0;// 위치정보를 (WCONG) 좌표계로저장 double xpoint_2=0,ypoint_2=0;// 받아온위치정보를저장하기위한변수

12 static public int _ID;// 기능구별을위한식별자 static public ArrayList<MapPOIItem> alitems;// 맵포인트를찍기위해 list 형태로선언 public MapPoint.PlainCoordinate Pcord; public MapPoint mappoint; public MapView mapview; Button public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.map); mapview=(mapview)findviewbyid(r.id.dmapview); mapview.setdaummapapikey("9a58163f57b1c380c276ec1370bd cb66c"); //DaumMap API 사용을위한인증값. mapview.setmapvieweventlistener(this); removeitems(0);//mapview 에찍힌포인트와경로를제거하는메서드 btn_fare=(button)findviewbyid(r.id.btn_distance); btn_tomain=(button)findviewbyid(r.id.btn_tomain); alitems=new ArrayList<MapPOIItem> (0); btn_fare.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { Intent intent = new Intent(DaumMap.this,calc.class); startactivity(intent); ); btn_tomain.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { removeitems(0); alitems.clear(); DaumMap._ID=0; Intent intent = new Intent(DaumMap.this,MainActivity.class); startactivity(intent);// 인식값및모든변수를초기화하고이전화면으로전환 ); Log.d("loca","_ID 비교전 : "+_ID); locationmanager=(locationmanager)getsystemservice(context.location_service); //LocationManager 변수선언, 지역정보를사용함 if(_id==1){// 식별값이 1( 출발지로선언 ) 일때 set_items(xpoint,ypoint,mapview,_id);// 식별값이 1( 출발지로선언 ) 일때 setgpsloca(_id);// 현재위치메서드호출 else if(_id==2){// 식별값이 2( 도착지로선언 ) 일때 setgpsloca(_id);// 현재위치를먼저찍고 set_items(xpoint,ypoint,mapview,_id);// 저장된좌표를도착지로찍음. else {// 아무설정이없을때초기화 _ID=0; public void removeitems(int cont){ mapview.removeallpoiitems();//poiitems메서드로찍힌 Polyline과포인트를삭제 mapview.removeallpolylines(); public void onmapviewcenterpointmoved(mapview mapview, MapPoint mapcenterpoint) { // 맵뷰중심위치가변했을때의값 (default) public void onmapviewdoubletapped(mapview mapview, MapPoint mappoint) { // 더블클릭되엇을때의값 (default로확대 / 축소를수행 ) public void onmapviewinitialized(mapview mapview) { //mapview가띄워졌을때초기위치에대한메소드 mapview.setmapcenterpointandzoomlevel(mappoint.mappointwithgeocoord( , ),5,true); // 초기위치를경북대의 Geo좌표계로선언 public void onmapviewlongpressed(mapview mapview, MapPoint mappoint) { // 길게터치가발생했을때 // 좌표값읽기 MapPoint.PlainCoordinate mappointgeo = mappoint.getmappointwcongcoord(); double xpoint = mappointgeo.x;// 해당위치의 x(wcong좌표 ) 를 xpoint에저장 double ypoint = mappointgeo.y; set_items(xpoint,ypoint,mapview,0); // 저장된좌표로포인트를찍는메서드를호출 Toast.makeText(getBaseContext(), String.format(" 위치선택 ( %.1f,.%.1f)", xpoint,ypoint),toast.length_short).show();// 토스트메시지로출력 public void onmapviewsingletapped(mapview mapview, MapPoint mappoint) { public void onmapviewzoomlevelchanged(mapview mapview, int zoomlevel) { public void set_items(double xpoint, double ypoint,mapview mapview,int id){ // 포인트를찍는메서드 MapPOIItem item=new MapPOIItem(); item.setdraggable(false); // 움직불가능마커표시 if((id==1 id==0)&&alitems.size()==0){ // 출발지로선언되거나아무설정이없고저장된값이없을때동작

13 item.setitemname(" 출발지 "); item.setmarkertype(mappoiitem.markertype.bluepin); item.setmappoint(mappoint.mappointwithwcongcoord(xpoint, ypoint)); item.setshowanimationtype(mappoiitem.showanimationtype.springfromground); mapview.addpoiitem(item); alitems.add(item); // 출발지로해당좌표를찍고 ArrayList(0) 번인덱스에추가한다. else if((id==2 id==0)&&alitems.size()==1){ // 도착지로선언되거나아무설정없이이미 ArrayList 에저장된값이있을때 item.setitemname(" 도착지 "); item.setmarkertype(mappoiitem.markertype.redpin); item.setmappoint(mappoint.mappointwithwcongcoord(xpoint, ypoint)); item.setshowanimationtype(mappoiitem.showanimationtype.springfromground); mapview.addpoiitem(item); btn_fare.setenabled(true); alitems.add(item); jsd.getroute(); // 값을추가하고루트를받아오는메서드를호출 DRaw(mapView); // 루트를그리는메서드를호출 public void DRaw(MapView mapview){ // 경로를그리는메서드 MapPolyline polyline = new MapPolyline(jsondecode.list_loc_point.size()); polyline.setlinecolor(color.argb(128, 0, 0, 255)); for(int i=0;i<jsondecode.list_loc_point.size();i++){ //json 을 parsing 해서저장된 AraayList 의크기만큼반복수행 double x = Double.valueOf(jsondecode.list_loc_point.get(i).get("xpoint"+i)); double y = Double.valueOf(jsondecode.list_loc_point.get(i).get("ypoint"+i)); //ArrayList<HashMap<"key","value">> 의값을각각읽어와서변수로저장하고 polyline.addpoint(mappoint.mappointwithwcongcoord(x, y)); // 해당포인트를추가한다. jsondecode.list_loc_point.clear(); // 기존포인트들을제거하고 mapview.addpolyline(polyline); // 맵뷰에해당포인트들을추가 ( 표시한다 ) mapview.fitmapviewareatoshowpolyline(polyline); // 경로가다보일수있게맵스케일을자동조정한다. LocationListener locationlistener=new LocationListener(){ // 위치정보에대한리스너 public void onlocationchanged(location location) { // 위치가변경되었을때 CoordPoint pt = new CoordPoint(location.getLongitude(),location.getLatitude()); CoordPoint tpt=transcoord.gettranscoord(pt, TransCoord.COORD_TYPE_WGS84, TransCoord.COORD_TYPE_WCONGNAMUL); //location 에저장된위치정보를콩나물좌표계로변환한다. xpoint_2=tpt.x; ypoint_2=tpt.y; public void onproviderdisabled(string provider) { // TODO Auto-generated method stub //Provider 가종료되었을때 public void onproviderenabled(string provider) { // TODO Auto-generated method stub //Provider 가활성화되었을때 public void onstatuschanged(string provider, int status, Bundle extras) { // TODO Auto-generated method stub //Provider 상태가변화되었을때 ; public void setgpsloca(int id){ // 위치정보를받는메서드 MapPoint map2; Log.d("loca"," 커런트로케이션이벤트호출전 : "+", "+xpoint+", "+ypoint+"id="+id); locationmanager.requestlocationupdates(locationmanager.network_provider, 5000, 1, this.locationlistener); // 위치정보변화를요구한다.(NETWORK_PROVIDER: 네트워크정보로부터위치전달 ) 5 초만큼 1 미터최소단위로 here=locationmanager.getlastknownlocation(locationmanager.network_provider); // 최근에획득한위치정보를 here 에저장한다. if(here!=null){ //Here 가값이있게되면 CoordPoint pt = new CoordPoint(here.getLongitude(),here.getLatitude()); CoordPoint tpt=transcoord.gettranscoord(pt, TransCoord.COORD_TYPE_WGS84, TransCoord.COORD_TYPE_WCONGNAMUL);

14 xpoint_2=tpt.x; ypoint_2=tpt.y; // 최근위치로포인트설정 map2 = MapPoint.mapPointWithWCONGCoord(xpoint_2, ypoint_2); // 해당포인트를맵포인트로지정 if(id==1){ set_items(map2.getmappointwcongcoord().x,map2.getmappointwcongcoord().y,this.mapview,2); // 출발지로되어있으면호출한현재위치를도착지로표기한다 else if(id==2){ set_items(map2.getmappointwcongcoord().x,map2.getmappointwcongcoord().y,this.mapview,1); // 도착지로되어있으면호출위치를출발지로표기한다. else{ set_items(map2.getmappointwcongcoord().x,map2.getmappointwcongcoord().y,this.mapview,0); // 둘다아니면설정이없이표기한다. try{ Thread.sleep(10000); //10 초만큼딜레이를둔다. catch(exception e){ Log.d("loca"," 딜레이예외 "); locationmanager.removeupdates(locationlistener); // 위치정보를받아오는것을종료한다. static public void setmappoint(favorate a, int id){ // 맵포인트를세팅하는메서드 DaumMap.xpoint=a.xpoint; DaumMap.ypoint=a.ypoint; public boolean oncreateoptionsmenu(menu menu) { menu.add(0, Menu.FIRST+1, Menu.NONE, " 즐겨찾기추가 "); return super.oncreateoptionsmenu(menu); // public boolean onoptionsitemselected(menuitem item) { // 다이아로그창을띄우기위해레이아웃을객채화한다. LayoutInflater inflater=layoutinflater.from(this); // 레이아웃객채화하는 layoutinflater inflater 선언 View addview=inflater.inflate(r.layout.addtemp, null); final TextView tview=(textview)addview.findviewbyid(r.id.tv_add_name); final EditText medit=(edittext)addview.findviewbyid(r.id.ev_andd_name); Log.d("dbdata", " 다이아로그전 "); AlertDialog.Builder dlg=new AlertDialog.Builder(this); mdbopenhelper=new dbopenhelper(this); mdbopenhelper.open(); Log.d("dbdata", " 헬퍼호출 "); dlg.settitle(" 도착지위치정보추가 ").setmessage(" 도착지의위치정보를 \n"+" 즐겨찾기하시겠습니까?").setView(addView).setPositiveButton("ok", new DialogInterface.OnClickListener() { public void onclick(dialoginterface dialog, int which) { Log.d("dbdata", "values 생성전 "); Log.d("dbdata", "alitem.get(1).x : "+alitems.get(1).getmappoint().getmappointwcongcoord().x); Log.d("dbdata"," 텍스트입력된거 : "+medit.gettext().tostring()); mdbopenhelper.insertcolumn(medit.gettext().tostring(), alitems.get(1).getmappoint().getmappointwcongcoord().x, alitems.get(1).getmappoint().getmappointwcongcoord().y); //Alitems 에저장된도착지정보를 db 로저장한다. mdbopenhelper.close(); Toast.makeText(getBaseContext(), " 위치정보가즐겨찾기되었습니다.", Toast.LENGTH_SHORT).show(); ).setnegativebutton("cancel", new DialogInterface.OnClickListener() { public void onclick(dialoginterface dialog, int which) { // TODO Auto-generated method stub ).show(); return super.onoptionsitemselected(item); - dbopenhelper : dbopenhelper(sqliteopenhelper 를상속받아구현 ) package com.android.taximap;

15 import android.content.contentvalues; import android.content.context; import android.database.cursor; import android.database.sqlexception; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqlitedatabase.cursorfactory; import android.database.sqlite.sqliteopenhelper; public class dbopenhelper{ private static final String DATABASE_NAME = "adress.db";//db 이름설정 private static final int DATABASE_VERSION=1;//dB 버전 : 업데이트를위해사용 public static SQLiteDatabase mdb; private DatabaseHelper mdbhelper; private Context mctx; public class DatabaseHelper extends SQLiteOpenHelper{//SQLiteOpenHelper 상속받아구현 public DatabaseHelper(Context context, String name, CursorFactory factory, int version) { super(context, name, factory, public void oncreate(sqlitedatabase db) { public void onupgrade(sqlitedatabase db, int oldversion, int newversion) { db.execsql("drop TABLE IF EXISTS "+Database.creatDB._TABLE_NAME); oncreate(db); public dbopenhelper(context context){ this.mctx=context; public dbopenhelper open() throws SQLException{ mdbhelper=new DatabaseHelper(mCtx,DATABASE_NAME,null,DATABASE_VERSION); mdb=mdbhelper.getwritabledatabase(); return this; public void close(){ mdb.close(); public long insertcolumn(string address,double xpoint, double ypoint){// 추가에관한메서드 ContentValues values = new ContentValues(); values.put(database.creatdb.address, address); values.put(database.creatdb.xpoint, xpoint); values.put(database.creatdb.ypoint, ypoint); return mdb.insert(database.creatdb._table_name, null, values); public boolean updatecolumn(long id, String address, double xpoint, double ypoint){// 업데이트에관한메서드 ContentValues values = new ContentValues(); values.put(database.creatdb.address, address); values.put(database.creatdb.xpoint, xpoint); values.put(database.creatdb.ypoint, ypoint); return mdb.update(database.creatdb._table_name, values, "_id="+id, null)>0; public boolean deletecolumn(long id){// 삭제에관한메서드 return mdb.delete(database.creatdb._table_name, "_id="+id, null)>0; public Cursor getallcolumns(){ return mdb.query(database.creatdb._table_name, null, null, null, null, null, null); public Cursor getcolumn(long id){ Cursor c=mdb.query(database.creatdb._table_name, null, "_id="+id, null, null, null, null); if(c!=null && c.getcount()!=0){ c.movetofirst(); return c; - Favorate.java : list 를구성하는항목에대한 class package com.android.taximap; public class Favorate { public int _id; public String locate; public double xpoint; public double ypoint; public Favorate(int _id, String locate,double xpoint,double ypoint){ this._id=_id;

16 this.locate=locate; this.xpoint=xpoint; this.ypoint=ypoint; public String getloca(){ return this.locate; public double getxpoint(){ return this.xpoint; public double getypoint(){ return this.ypoint; - FavorateAdapter.java : CustomListView 를구현하기위한 CustomAdapter class package com.android.taximap; import java.util.arraylist; import android.content.context; import android.content.intent; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.view.onclicklistener; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.imagebutton; import android.widget.textview; public class FavorateAdapter extends ArrayAdapter<Favorate>{// 커스텀어답터를구현하기위해 ArrayAdapter 을상속 private Context mcontext; private int mresource; private ArrayList<Favorate> Fitems; private LayoutInflater vi;// 레이아웃을객체화 public FavorateAdapter(Context context, int textviewresid, ArrayList<Favorate> Fitems){ super(context, textviewresid, Fitems); this.fitems=fitems; this.mcontext=context; this.mresource=textviewresid; public View getview(int position, View convertview, ViewGroup parent) { View v=convertview; if(v==null){ v=vi.inflate(r.layout.favorate, null);// 레이아웃에뷰어가없으면 favorate 를객체화하여가져온다 Favorate p=fitems.get(position); if(p!=null){ TextView Loca=(TextView)v.findViewById(R.id.location); Loca.setText(p.getLoca()); ImageButton bring_start=(imagebutton)v.findviewbyid(r.id.btn_bringstart); ImageButton bring_end=(imagebutton)v.findviewbyid(r.id.btn_bringend); bring_start.setfocusable(false); bring_end.setfocusable(false); bring_start.settag(position); bring_end.settag(position); bring_start.setonclicklistener(new OnClickListener(){ public void onclick(view v) { int position=integer.parseint(v.gettag().tostring()); Favorate p = Fitems.get(position); if(p!=null){ // 출발지로선언 // 이미지버튼이눌렸을때맵포인트를해당정보를새팅하고화면전환 DaumMap.setmapPoint(p,1); Intent intent = new Intent(mContext,DaumMap.class); mcontext.startactivity(intent); ); bring_end.setonclicklistener(new OnClickListener(){ public void onclick(view v) {

17 int position=integer.parseint(v.gettag().tostring()); Favorate p = Fitems.get(position); if(p!=null){ // 도착지로선언 // 즐겨찾기가져오기 double xpoint, ypoint; xpoint=fitems.get(position).xpoint; ypoint=fitems.get(position).ypoint; DaumMap.setmapPoint(p,2); Intent intent = new Intent(mContext,DaumMap.class); mcontext.startactivity(intent); ); return v; public void setarraylist(arraylist<favorate> array){ this.fitems=array; public ArrayList<Favorate> getarraylist(){ return this.fitems; - jsondecode.java : url 을구성하여전송하고 son 파일을받아 parsing 하는 class package com.android.taximap; import java.io.bufferedreader; import java.io.inputstreamreader; import java.net.httpurlconnection; import java.net.url; import java.util.arraylist; import java.util.hashmap; import java.util.list; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import android.content.context; import android.util.log; public class jsondecode { BufferedReader buffer=null;//json 을버퍼형태로가져오기위해선언 Context mcontext; static int distance_temp=0; static public List<HashMap<String, String>> list_loc_point = new ArrayList<HashMap<String,String>>(); HashMap<String, String> loc_point = new HashMap<String, String>(); // 값을저장하기위해 ArrayList<HashMap<"key","value">> 로선언 URL url=null; HttpURLConnection urlconnection=null; //URL 로값을주고받기위해선언 StringBuffer json_data=new StringBuffer(); //json 파일을저장하기위해선언 String Temp=null; public String geturl(){ String urlstring = new String(); urlstring=" =".replaceall("\\p{space","") +(Double.toString(DaumMap.alitems.get(0).getMapPoint().getMapPointWCONGCoord().x).replaceAll("\\p{Space","")) +"&sy=".replaceall("\\p{space","") +(Double.toString(DaumMap.alitems.get(0).getMapPoint().getMapPointWCONGCoord().y).replaceAll("\\p{Space","")) +"&ex=".replaceall("\\p{space","") +(Double.toString(DaumMap.alitems.get(1).getMapPoint().getMapPointWCONGCoord().x).replaceAll("\\p{Space","")) +"&ey=".replaceall("\\p{space","") +(Double.toString(DaumMap.alitems.get(1).getMapPoint().getMapPointWCONGCoord().y).replaceAll("\\p{Space","")).replaceAll("\\p{Space",""); return urlstring; // 저장된경로로 json 파일을받기위한 url 을구성

18 public void getjson(){ //json 을가져오는메서드 String line=null; String temp=geturl().tostring(); String mapurl=temp; try { url = new URL(mapURL); urlconnection=(httpurlconnection)url.openconnection(); Temp=urlConnection.toString(); buffer = new BufferedReader(new InputStreamReader(urlConnection.getInputStream(),"EUC-KR"),8192); //Url 스트림을열어 EUC-KR 로인코딩하여값을버퍼로읽어옴 while((line=buffer.readline())!=null){ json_data.append(line); // 버퍼의크기가다할때까지문장단위로 json_data 에붙임 urlconnection.disconnect(); //url 스트림을닫음 buffer.close(); // 버퍼를종료 catch (Exception e){ finally{ try{ buffer.close(); catch (Exception e2) { // 예외처리 public void parseforjson() throws JSONException{ //jasonparsing 을위한메서드 //json 구조를들어가기위해차례대로선언 JSONObject json = new JSONObject(json_data.toString()); json=json.getjsonobject("car"); distance_temp=integer.valueof(json.getstring("totallength")); JSONArray nodes_temp= json.getjsonarray("nodes"); //nodes 에있는정보를가지고옴 for(int i = 0; i < nodes_temp.length(); i++) { JSONObject jtemp=nodes_temp.getjsonobject(i); loc_point.put("ypoint"+i, jtemp.getstring("y")); loc_point.put("xpoint"+i, jtemp.getstring("x")); list_loc_point.add(loc_point); // 키값을읽어서값으로 ArrayList 에저장 public void getroute(){ //json 파일을가지고와서파싱까지수행하는메서드이메서드로값을얻는다. getjson(); try{ parseforjson(); catch (JSONException e){ Log.e(TAG,"getRoute() : "+e.tostring()); - MainActivity.java : 최초시작 Activity package com.android.taximap; import java.util.arraylist; import android.app.activity; import android.app.alertdialog; import android.content.dialoginterface; import android.content.intent; import android.database.cursor; import android.os.bundle; import android.view.view; import android.widget.adapterview; import android.widget.adapterview.onitemlongclicklistener; import android.widget.button; import android.widget.listview; import android.widget.toast; public class MainActivity extends Activity { Button btn_map,btn_exit;

19 ListView lv01; ArrayList<Favorate> mfavorarray; Favorate mfavorate; FavorateAdapter lvadapter; dbopenhelper mdbopenhelper; Cursor public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); btn_map=(button)findviewbyid(r.id.btn_showmap); btn_exit=(button)findviewbyid(r.id.btn_exit); lv01=(listview)findviewbyid(r.id.listview01); btn_map.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { Intent intent=new Intent(MainActivity.this,DaumMap.class); startactivity(intent); Toast.makeText(getBaseContext(), " 위치지정화면으로이동합니다 ", Toast.LENGTH_SHORT).show(); ); btn_exit.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { Toast.makeText(getBaseContext(), " 종료합니다.", Toast.LENGTH_SHORT).show(); Kill_app(); ); mfavorarray=new ArrayList<Favorate>();// 리스트뷰를구현하기위해 mdbopenhelper=new dbopenhelper(this); mdbopenhelper.open();//db 제어를위한헬퍼를개방 CursortoArray();// 리스트뷰에 db 내용을가져오기위한커서 lvadapter=new FavorateAdapter(this, R.layout.favorate, mfavorarray);// 커스텀어답터선언 lv01.setadapter(lvadapter);// 어답터를셋팅 lv01.setonitemlongclicklistener(new OnItemLongClickListener(){ // 리스트의아이템이선택되었을때의동작 public boolean onitemlongclick(adapterview<?> arg0, View arg1, final int position, long arg3) { final boolean result = mdbopenhelper.deletecolumn(position+1); AlertDialog.Builder dlg = new AlertDialog.Builder(MainActivity.this); dlg.settitle(" 삭제확인 ").setmessage(" 삭제하시겠습니까?").setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onclick(dialoginterface dialog, int which) { if(result){ mfavorarray.remove(position); lvadapter.setarraylist(mfavorarray); lvadapter.notifydatasetchanged(); Toast.makeText(getBaseContext(), " 즐겨찾기항목삭제..", Toast.LENGTH_SHORT).show(); else{ Toast.makeText(getBaseContext(), "Index 오류 ", Toast.LENGTH_SHORT).show(); ).setnegativebutton("cancel",new DialogInterface.OnClickListener() { public void onclick(dialoginterface dialog, int which) { // TODO Auto-generated method stub ); ).show(); return false; protected void Kill_app() { movetasktoback(true); android.os.process.killprocess(android.os.process.mypid()); // 프로세스킬시키는함수 private void CursortoArray(){ mcursor=null; mcursor=mdbopenhelper.getallcolumns(); while(mcursor.movetonext()){ mfavorate=new Favorate(

20 mcursor.close(); //db 부터커서가가르키는것을리스트로가지고온다. mcursor.getint(mcursor.getcolumnindex("_id")), mcursor.getstring(mcursor.getcolumnindex("address")), mcursor.getdouble(mcursor.getcolumnindex("xpoint")), mcursor.getdouble(mcursor.getcolumnindex("ypoint")) ); mfavorarray.add(mfavorate);

[ 그림 8-1] XML 을이용한옵션메뉴설정방법 <menu> <item 항목ID" android:title=" 항목제목 "/> </menu> public boolean oncreateoptionsmenu(menu menu) { getme

[ 그림 8-1] XML 을이용한옵션메뉴설정방법 <menu> <item 항목ID android:title= 항목제목 /> </menu> public boolean oncreateoptionsmenu(menu menu) { getme 8 차시메뉴와대화상자 1 학습목표 안드로이드에서메뉴를작성하고사용하는방법을배운다. 안드로이드에서대화상자를만들고사용하는방법을배운다. 2 확인해볼까? 3 메뉴 1) 학습하기 [ 그림 8-1] XML 을이용한옵션메뉴설정방법 public boolean

More information

어댑터뷰

어댑터뷰 04 커스텀어댑터뷰 (Custom Adapter View) 커스텀어댑터뷰 (Custom Adapter View) 커스텀어댑터뷰 (Custom Adatper View) 란? u 어댑터뷰의항목하나는단순한문자열이나이미지뿐만아니라, 임의의뷰가될수 있음 이미지뷰 u 커스텀어댑터뷰설정절차 1 2 항목을위한 XML 레이아웃정의 어댑터정의 3 어댑터를생성하고어댑터뷰객체에연결

More information

2) 활동하기 활동개요 활동과정 [ 예제 10-1]main.xml 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.

2) 활동하기 활동개요 활동과정 [ 예제 10-1]main.xml 1 <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android 2 xmlns:tools=http://schemas.android. 10 차시파일처리 1 학습목표 내장메모리의파일을처리하는방법을배운다. SD 카드의파일을처리하는방법을배운다. 2 확인해볼까? 3 내장메모리파일처리 1) 학습하기 [ 그림 10-1] 내장메모리를사용한파일처리 2) 활동하기 활동개요 활동과정 [ 예제 10-1]main.xml 1

More information

안드로이드기본 11 차시어댑터뷰 1 학습목표 어댑터뷰가무엇인지알수있다. 리스트뷰와스피너를사용하여데이터를출력할수있다. 2 확인해볼까? 3 어댑터뷰 1) 학습하기 어댑터뷰 - 1 -

안드로이드기본 11 차시어댑터뷰 1 학습목표 어댑터뷰가무엇인지알수있다. 리스트뷰와스피너를사용하여데이터를출력할수있다. 2 확인해볼까? 3 어댑터뷰 1) 학습하기 어댑터뷰 - 1 - 11 차시어댑터뷰 1 학습목표 어댑터뷰가무엇인지알수있다. 리스트뷰와스피너를사용하여데이터를출력할수있다. 2 확인해볼까? 3 어댑터뷰 1) 학습하기 어댑터뷰 - 1 - ArrayAdapter ArrayAdapter adapter = new ArrayAdapter(this, android.r.layout.simple_list_item_1,

More information

9 차시고급위젯다루기 1 학습목표 날짜 / 시간과관련된위젯을배운다. 웹뷰를사용하여간단한웹브라우저기능을구현한다. 매니패스트파일의설정법을배운다. 2 확인해볼까? 3 날짜 / 시간위젯 1) 활동하기 활동개요

9 차시고급위젯다루기 1 학습목표 날짜 / 시간과관련된위젯을배운다. 웹뷰를사용하여간단한웹브라우저기능을구현한다. 매니패스트파일의설정법을배운다. 2 확인해볼까? 3 날짜 / 시간위젯 1) 활동하기 활동개요 9 차시고급위젯다루기 1 학습목표 날짜 / 시간과관련된위젯을배운다. 웹뷰를사용하여간단한웹브라우저기능을구현한다. 매니패스트파일의설정법을배운다. 2 확인해볼까? 3 날짜 / 시간위젯 1) 활동하기 활동개요 [ 그림 9-1] 시간예약앱 활동과정 - 2 - [ 그림 9-2] 안드로이드 SDK Manager [ 예제 9-1]main.xml 1

More information

[ 그림 7-1] 프로젝트 res 폴더 이미지뷰 [ 예제 7-1] 이미지뷰 1 <LinearLayout 2 ~~~~ 중간생략 ~~~~ 3 android:orientation="vertical" > 4 <ImageView

[ 그림 7-1] 프로젝트 res 폴더 이미지뷰 [ 예제 7-1] 이미지뷰 1 <LinearLayout 2 ~~~~ 중간생략 ~~~~ 3 android:orientation=vertical > 4 <ImageView 7 차시이미지처리 1 학습목표 이미지뷰를사용하는방법을배운다. 비트맵을사용하는방법을배운다. 2 확인해볼까? 3 이미지뷰와이미지버튼 1) 학습하기 [ 그림 7-1] 프로젝트 res 폴더 이미지뷰 [ 예제 7-1] 이미지뷰 1 4

More information

리니어레이아웃 - 2 -

리니어레이아웃 - 2 - 4 차시레이아웃 1 학습목표 레이아웃의개념을이해한다. 중복리니어레이아웃의개념이해한다. 2 확인해볼까? 3 레이아웃개념익히기 1) 학습하기 [ 그림 4-1] ViewGroup 클래스계층도 리니어레이아웃 - 2 - [ 예제 4-1]orientation 속성-horizontal 1

More information

13ÀåÃß°¡ºÐ

13ÀåÃß°¡ºÐ 13 CHAPTER 13 CHAPTER 2 3 4 5 6 7 06 android:background="#ffffffff"> 07

More information

01장

01장 CHAPTER1 Camera (MediaStore) EXIF 1 2 CHAPTER 1 SDK (intent) Camera Camera Camera Android Manifest xml Camera Camera

More information

학습목표 메뉴를추가하는방법을이해하고실습할수있다. 프로그램의기본설정 (settings) 을정의하는방법을알고실습할수있다. 대화상자를여는방법을알고실습할수있다. 로그메시지로디버깅하는방법을이해한다. 디버거로디버깅하는방법을이해한다.

학습목표 메뉴를추가하는방법을이해하고실습할수있다. 프로그램의기본설정 (settings) 을정의하는방법을알고실습할수있다. 대화상자를여는방법을알고실습할수있다. 로그메시지로디버깅하는방법을이해한다. 디버거로디버깅하는방법을이해한다. 헬로, 안드로이드 4 주차 사용자인터페이스디자인하기 (2) 강대기동서대학교컴퓨터정보공학부 학습목표 메뉴를추가하는방법을이해하고실습할수있다. 프로그램의기본설정 (settings) 을정의하는방법을알고실습할수있다. 대화상자를여는방법을알고실습할수있다. 로그메시지로디버깅하는방법을이해한다. 디버거로디버깅하는방법을이해한다. 차례 메뉴추가하기 Settings 추가하기 새게임시작하기

More information

03장

03장 CHAPTER3 ( ) Gallery 67 68 CHAPTER 3 Intent ACTION_PICK URI android provier MediaStore Images Media EXTERNAL_CONTENT_URI URI SD MediaStore Intent choosepictureintent = new Intent(Intent.ACTION_PICK, ë

More information

( )부록

( )부록 A ppendix 1 2010 5 21 SDK 2.2. 2.1 SDK. DevGuide SDK. 2.2 Frozen Yoghurt Froyo. Donut, Cupcake, Eclair 1. Froyo (Ginger Bread) 2010. Froyo Eclair 0.1.. 2.2. UI,... 2.2. PC 850 CPU Froyo......... 2. 2.1.

More information

SQLite v 소개 ü SQLite 라이브러리를통해완전한관계형데이터베이스 (RDBMS) 기능제공 ü 오픈소스 ü 표준준수 ü 경량 ü 단일계층 2

SQLite v 소개 ü SQLite 라이브러리를통해완전한관계형데이터베이스 (RDBMS) 기능제공 ü 오픈소스 ü 표준준수 ü 경량 ü 단일계층 2 Android 데이터베이스 (SQLite) 모바일응용 SQLite v 소개 ü SQLite 라이브러리를통해완전한관계형데이터베이스 (RDBMS) 기능제공 ü 오픈소스 ü 표준준수 ü 경량 ü 단일계층 2 SQLite 데이터베이스라이브러리 v SQLiteDatabase ü 추가라이브러리 (android.database.sqlite.sqlitedatabase) ü

More information

// 화면을터치하였을때해야할작업구현 case MotionEvent.ACTION_MOVE: // 화면을드래그하였때 // 화면을드래그하였을때해야할작업구현 case MotionEvent.ACTION_UP: // 화면에서터치가사라질때 // 화면에서터치가사라질때해야할자업구현 c

// 화면을터치하였을때해야할작업구현 case MotionEvent.ACTION_MOVE: // 화면을드래그하였때 // 화면을드래그하였을때해야할작업구현 case MotionEvent.ACTION_UP: // 화면에서터치가사라질때 // 화면에서터치가사라질때해야할자업구현 c 6 차시이벤트처리 1 학습목표 터치이벤트처리를배운다. XML 의 onclick 속성을사용하여이벤트를처리한다. 2 확인해볼까? 3 이벤트처리하기 1) 학습하기 터치이벤트 public boolean ontouchevent(motionevent event) { swtich(event.getaction()) { case MotionEvent.ACTION_DOWN:

More information

슬라이드 1

슬라이드 1 모바일소프트웨어프로젝트 지도 API 1 조 20070216 김성수 20070383 김혜준 20070965 이윤상 20071335 최진 1 매시업? 공개 API? 2 매시업 웹으로제공하고있는정보와서비스를융합하여새로운소프트웨어나서비스, 데이터베이스등을만드는것 < 최초의매시업 > 3 공개 API 누구나사용할수있도록공개된 API 지도, 검색등다양한서비스들에서제공 대표적인예

More information

이것은리스트뷰의 setadapter 메소드에잘표현되어있습니다. setadapter 는리스트뷰에사용할데이터객체를넘겨주는메소드입니다. 일반적으로생각한다면 ArrayAdapter 객체를생성하여사용할데이터를저장할것이고데이터가저장된 ArrayAdapter 객체를 setadapt

이것은리스트뷰의 setadapter 메소드에잘표현되어있습니다. setadapter 는리스트뷰에사용할데이터객체를넘겨주는메소드입니다. 일반적으로생각한다면 ArrayAdapter 객체를생성하여사용할데이터를저장할것이고데이터가저장된 ArrayAdapter 객체를 setadapt 1. 리스트뷰의구조 리스트뷰는어떤데이터그룹에대한각각의정보들을항목별로출력시키고사용자에게원하는항목을검색하거나선택할수있도록해주는컨트롤객체입니다. 그래서다른컨트롤처럼정해진형태의정보를저장하는것이아니기때문에리스트뷰가데이터를직접관리하기는힘들었을것입니다. 그래서효과적인데이터관리를위해 "ArrayAdapter" 라는클래스가추가되었고리스트뷰는이클래스를이용해서사용자가지정한데이터에접근하도록구현되어있습니다.

More information

학습목표 선언하여디자인을하는방법을이해하고, 실행할수있다. 시작화면을만드는방법과대체리소스를사용하는방법을이해하고실행할수있다. About 과같은상자를구현하고, 테마를적용하는법을이해하고실행할수있다.

학습목표 선언하여디자인을하는방법을이해하고, 실행할수있다. 시작화면을만드는방법과대체리소스를사용하는방법을이해하고실행할수있다. About 과같은상자를구현하고, 테마를적용하는법을이해하고실행할수있다. 헬로, 안드로이드 3 주차 사용자인터페이스디자인하기 (1) 강대기동서대학교컴퓨터정보공학부 학습목표 선언하여디자인을하는방법을이해하고, 실행할수있다. 시작화면을만드는방법과대체리소스를사용하는방법을이해하고실행할수있다. About 과같은상자를구현하고, 테마를적용하는법을이해하고실행할수있다. 차례 스도쿠예제소개하기 선언하여디자인하기 시작화면만들기 대체리소스사용하기 About

More information

슬라이드 1

슬라이드 1 헬로, 안드로이드 3 주차 사용자인터페이스디자인하기 (1) 강대기동서대학교컴퓨터정보공학부 학습목표 선언하여디자인을하는방법을이해하고, 실행핛수있다. 시작화면을만드는방법과대체리소스를사용하는방법을이해하고실행핛수있다. About 과같은상자를구현하고, 테마를적용하는법을이해하고실행핛수있다. 차례 스도쿠예제소개하기 선언하여디자인하기 시작화면만들기 대체리소스사용하기 About

More information

1. 개요 - 계획서 프로젝트개요프로그램명 : 닥터 119 제작배경애완견을키우는사람들이부득이하게병원에가지못할경우에이앱을통해서자가진단을통해상태의심각성을알수있게되고또가까운동물병원으로갈수있는지도와전화번호를제공한다. 그리고애견다이어리기능을통해애견의성장과정과추억들을저

1. 개요 - 계획서 프로젝트개요프로그램명 : 닥터 119 제작배경애완견을키우는사람들이부득이하게병원에가지못할경우에이앱을통해서자가진단을통해상태의심각성을알수있게되고또가까운동물병원으로갈수있는지도와전화번호를제공한다. 그리고애견다이어리기능을통해애견의성장과정과추억들을저 소프트웨어공학프로젝트 8 조 큐리 119 학 과 컴퓨터과학전공 팀 장 20084334 장용준 팀 원 200914550 서준원 200914626 차진환 201014523 박지혜 201113479 김현수 담당교수 문양세교수님 1 1. 개요 - 계획서 - 1.1 프로젝트개요프로그램명 : 닥터 119 제작배경애완견을키우는사람들이부득이하게병원에가지못할경우에이앱을통해서자가진단을통해상태의심각성을알수있게되고또가까운동물병원으로갈수있는지도와전화번호를제공한다.

More information

신림프로그래머_클린코드.key

신림프로그래머_클린코드.key CLEAN CODE 6 11st Front Dev. Team 6 1. 2. 3. checked exception 4. 5. 6. 11 : 2 4 : java (50%), javascript (35%), SQL/PL-SQL (15%) : Spring, ibatis, Oracle, jquery ? , (, ) ( ) 클린코드를 무시한다면 . 6 1. ,,,!

More information

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V Mobile Service > IAP > Android SDK IAP SDK TOAST SDK. IAP SDK. Android Studio IDE 2.3.3 Android SDK Version 2.3.3 (API Level 10). Name Reference Version License okhttp http://square.github.io/okhttp/ 1.5.4

More information

50_1953.pdf

50_1953.pdf C h a p t e r 02 194 Part Mobile Apps 01 01 02 Chapter 02 195 03 04 196 Part 02 01 02 03 04 Chapter 02 197 05 06 07 08 198 Part 03 01 02 Chapter 02 199 03 04 05 06 200 Part 07 08 09 10 Chapter 02 201 04

More information

@OneToOne(cascade = = "addr_id") private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a

@OneToOne(cascade = = addr_id) private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a 1 대 1 단방향, 주테이블에외래키실습 http://ojcedu.com, http://ojc.asia STS -> Spring Stater Project name : onetoone-1 SQL : JPA, MySQL 선택 http://ojc.asia/bbs/board.php?bo_table=lecspring&wr_id=524 ( 마리아 DB 설치는위 URL

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 인터페이스, 람다식, 패키지 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 홈네트워킹 public interface RemoteControl { public void turnon(); // 가전제품을켠다. public void turnoff(); // 가전제품을끈다. 인터페이스를구현 public class Television

More information

rmi_박준용_final.PDF

rmi_박준용_final.PDF (RMI) - JSTORM http://wwwjstormpekr (RMI)- Document title: Document file name: Revision number: Issued by: Document Information (RMI)- rmi finaldoc Issue Date: Status:

More information

Microsoft PowerPoint - 04-UDP Programming.ppt

Microsoft PowerPoint - 04-UDP Programming.ppt Chapter 4. UDP Dongwon Jeong djeong@kunsan.ac.kr http://ist.kunsan.ac.kr/ Dept. of Informatics & Statistics 목차 UDP 1 1 UDP 개념 자바 UDP 프로그램작성 클라이언트와서버모두 DatagramSocket 클래스로생성 상호간통신은 DatagramPacket 클래스를이용하여

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

오핀 (OFIN) SDK Guide Fintech Mobile SDK Guide - Android V 1.0 OPPFLIB 1

오핀 (OFIN) SDK Guide Fintech Mobile SDK Guide - Android V 1.0 OPPFLIB 1 오핀 (OFIN) SDK Guide Fintech Mobile SDK Guide - Android V 1.0 OPPFLIB 1 1. 버전정보 버전개정일자개정사유개정내역 1.0 2017.06.22 1. 초안작성 2. 개요 O'FIN( 오핀 ) 은금융투자회사, 유관기관, 핀테크기업의데이터와서비스를 Open API 로게시하고, 상호융합을통해혁신적비즈니스를만들수있도록하는핀테크오픈플랫폼입니다.

More information

Spring Boot/JDBC JdbcTemplate/CRUD 예제

Spring Boot/JDBC JdbcTemplate/CRUD 예제 Spring Boot/JDBC JdbcTemplate/CRUD 예제 오라클자바커뮤니티 (ojc.asia, ojcedu.com) Spring Boot, Gradle 과오픈소스인 MariaDB 를이용해서 EMP 테이블을만들고 JdbcTemplate, SimpleJdbcTemplate 을이용하여 CRUD 기능을구현해보자. 마리아 DB 설치는다음 URL 에서확인하자.

More information

JAVA 프로그래밍실습 실습 1) 실습목표 - 메소드개념이해하기 - 매개변수이해하기 - 새메소드만들기 - Math 클래스의기존메소드이용하기 ( ) 문제 - 직사각형모양의땅이있다. 이땅의둘레, 면적과대각

JAVA 프로그래밍실습 실습 1) 실습목표 - 메소드개념이해하기 - 매개변수이해하기 - 새메소드만들기 - Math 클래스의기존메소드이용하기 (   ) 문제 - 직사각형모양의땅이있다. 이땅의둘레, 면적과대각 JAVA 프로그래밍실습 실습 1) 실습목표 - 메소드개념이해하기 - 매개변수이해하기 - 새메소드만들기 - Math 클래스의기존메소드이용하기 ( http://java.sun.com/javase/6/docs/api ) 문제 - 직사각형모양의땅이있다. 이땅의둘레, 면적과대각선의길이를계산하는메소드들을작성하라. 직사각형의가로와세로의길이는주어진다. 대각선의길이는 Math클래스의적절한메소드를이용하여구하라.

More information

슬라이드 1

슬라이드 1 UNIT 16 예외처리 로봇 SW 교육원 3 기 최상훈 학습목표 2 예외처리구문 try-catch-finally 문을사용핛수있다. 프로그램오류 3 프로그램오류의종류 컴파일에러 (compile-time error) : 컴파일실행시발생 럮타임에러 (runtime error) : 프로그램실행시발생 에러 (error) 프로그램코드에의해서해결될수없는심각핚오류 ex)

More information

안드로이드애플리케이션과통합하는데는자바가편하므로대표적인두가지라이브러리를비교해보자. 자바 ID3 태그라이브러리 jaudiotagger ID3v1, ID3v1.1, Lyrics3v1, Mp3, Mp4 (Mp4 오디오, M4a 지원범위 Lyrics3v2, ID3v2.2, ID

안드로이드애플리케이션과통합하는데는자바가편하므로대표적인두가지라이브러리를비교해보자. 자바 ID3 태그라이브러리 jaudiotagger ID3v1, ID3v1.1, Lyrics3v1, Mp3, Mp4 (Mp4 오디오, M4a 지원범위 Lyrics3v2, ID3v2.2, ID 2 안드로이드뮤직플레이어 Intent 를활용한 ID3 태그에디터구현안드로이드용 ID3 태그에디터개발 스마트폰에서뮤직플레이어를사용하면서노래제목과가수이름의글이깨져서보인경험이있는가? 필자는 MP3 의메타정보인 ID3 태그를편집할수있는에디터를만들어사용자의불편을개선하는애플리케이션을만들어배포하고있다. 이번호에서는 ID3 태그에디터를만들어보면서안드로이드에서음악정보를수정할수있는방법을알아보자.

More information

JAVA PROGRAMMING 실습 09. 예외처리

JAVA PROGRAMMING 실습 09. 예외처리 2015 학년도 2 학기 예외? 프로그램실행중에발생하는예기치않은사건 예외가발생하는경우 정수를 0으로나누는경우 배열의크기보다큰인덱스로배열의원소를접근하는경우 파일의마지막부분에서데이터를읽으려고하는경우 예외처리 프로그램에문제를발생시키지않고프로그램을실행할수있게적절한조치를취하는것 자바는예외처리기를이용하여예외처리를할수있는기법제공 자바는예외를객체로취급!! 나뉨수를입력하시오

More information

Microsoft PowerPoint - 11주차_Android_GoogleMap.ppt [호환 모드]

Microsoft PowerPoint - 11주차_Android_GoogleMap.ppt [호환 모드] Google Map View 구현 학습목표 교육목표 Google Map View 구현 Google Map 지원 Emulator 생성 Google Map API Key 위도 / 경도구하기 위도 / 경도에따른 Google Map View 구현 Zoom Controller 구현 Google Map View (1) () Google g Map View 기능 Google

More information

슬라이드 1

슬라이드 1 13 장. 커스텀뷰개발 API 에서제공하는뷰를그대로이용하면서약간변형시킨뷰 여러뷰를합쳐서한번에출력하기위한뷰 기존 API 에전혀존재하지않는뷰 public class MyView extends TextView { public class MyView extends ViewGroup { public class MyView extends View { 커스텀뷰를레이아웃

More information

제11장 프로세스와 쓰레드

제11장 프로세스와 쓰레드 제9장자바쓰레드 9.1 Thread 기초 (1/5) 프로그램 명령어들의연속 (a sequence of instruction) 프로세스 / Thread 실행중인프로그램 (program in execution) 프로세스생성과실행을위한함수들 자바 Thread 2 9.1 Thread 기초 (2/5) 프로세스단위작업의문제점 프로세스생성시오버헤드 컨텍스트스위치오버헤드

More information

안드로이드2_14

안드로이드2_14 .,,,,,. 11...,,,.,.,.,. Chapter 14. force feedback.., getsystemservice. String service_name = Context.SENSOR_SERVICE; SensorManager sensormanager = (SensorManager)getSystemService(service_name);. Sensor.,,,.

More information

12-file.key

12-file.key 11 (String).. java.lang.stringbuffer. s String s = "abcd"; s = s + "e"; a b c d e a b c d e ,., "910359,, " "910359" " " " " (token) (token),, (delimiter). java.util.stringtokenizer String s = "910359,,

More information

헬로, 안드로이드 13 주차 SQL 활용하기 (2) 강대기동서대학교컴퓨터정보공학부

헬로, 안드로이드 13 주차 SQL 활용하기 (2) 강대기동서대학교컴퓨터정보공학부 헬로, 안드로이드 13 주차 SQL 활용하기 (2) 강대기동서대학교컴퓨터정보공학부 학습목표 데이터바인딩을통해데이터소스에해당하는데이터베이스와뷰에해당하는액티비티를연결한데이터베이스응용프로그램을작성할수있다. 안드로이드내의다른어플리케이션의데이터에접근하기위해제공되는 ContentProvider 를사용할수있다. 자신의어플리케이션에서다른어플리케이션으로의데이터제공을위한 ContentProvider

More information

목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper 클래스작성 - JSONParser 클래스작성 공공

목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper 클래스작성 - JSONParser 클래스작성 공공 메신저의새로운혁신 채팅로봇 챗봇 (Chatbot) 입문하기 소 이 메 속 : 시엠아이코리아 름 : 임채문 일 : soulgx@naver.com 1 목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper

More information

Microsoft PowerPoint - CSharp-10-예외처리

Microsoft PowerPoint - CSharp-10-예외처리 10 장. 예외처리 예외처리개념 예외처리구문 사용자정의예외클래스와예외전파 순천향대학교컴퓨터학부이상정 1 예외처리개념 순천향대학교컴퓨터학부이상정 2 예외처리 오류 컴파일타임오류 (Compile-Time Error) 구문오류이기때문에컴파일러의구문오류메시지에의해쉽게교정 런타임오류 (Run-Time Error) 디버깅의절차를거치지않으면잡기어려운심각한오류 시스템에심각한문제를줄수도있다.

More information

PowerPoint Presentation

PowerPoint Presentation Package Class 3 Heeseung Jo 목차 section 1 패키지개요와패키지의사용 section 2 java.lang 패키지의개요 section 3 Object 클래스 section 4 포장 (Wrapper) 클래스 section 5 문자열의개요 section 6 String 클래스 section 7 StringBuffer 클래스 section

More information

C++ Programming

C++ Programming C++ Programming 예외처리 Seo, Doo-okok clickseo@gmail.com http://www.clickseo.com 목 차 예외처리 2 예외처리 예외처리 C++ 의예외처리 예외클래스와객체 3 예외처리 예외를처리하지않는프로그램 int main() int a, b; cout > a >> b; cout

More information

<BFF8B5E5B7CEC0CCB5E5322E687770>

<BFF8B5E5B7CEC0CCB5E5322E687770> 안드로이드응용프로그램개발 2010.5 호서대학교뉴미디어학과이호석교수 알림 [1] 세미나자료의 1 장부터 11 장에있는안드로이드관련내용과안드로이드소스코드는참고문헌 (1)(2)(3) 에서발췌하여작성하였다. 12 장과 13 장의내용은 developer.android.com 을참고하여작성하였으며소스코드는 (2)(3) 에서발췌하여작성하였다. [2] 안드로이드에대한최신의내용은

More information

01 [ 일기장 ] 애플리케이션프로젝트작성 - [MyDiary] 앱 Mobile Apps >> [MyDiary] 앱프로젝트구조설계 일기장애플리케이션인 [MyDiary] 앱은메인화면과일기장의내용을작성하는화면으로이루어져있다. 화면이 2개라는것은액티비티가 2개이고액티비티에대

01 [ 일기장 ] 애플리케이션프로젝트작성 - [MyDiary] 앱 Mobile Apps >> [MyDiary] 앱프로젝트구조설계 일기장애플리케이션인 [MyDiary] 앱은메인화면과일기장의내용을작성하는화면으로이루어져있다. 화면이 2개라는것은액티비티가 2개이고액티비티에대 Chapter 03 일기장앱개발 일기장애플리케이션프로젝트를작성할수있다. 일기장애플리케이션의화면을작성할수있다. 일기장애플리케이션의로직을작성할수있다. { 프로젝트작성하기 Step 1 - [MyDiary] 앱 [ 일기장 ] 애플리케이션프로젝트작성 >> >> Step 2 [ 일기장 ] 애플리케이션의화면설계 Step 3 [ 일기장 ] 애플리케이션의로직작성 이장에서는

More information

헬로, 안드로이드 11 주차 위치파악하기와감지하기 강대기동서대학교컴퓨터정보공학부

헬로, 안드로이드 11 주차 위치파악하기와감지하기 강대기동서대학교컴퓨터정보공학부 헬로, 안드로이드 11 주차 위치파악하기와감지하기 강대기동서대학교컴퓨터정보공학부 학습목표 GPS 장치를통해위치를인식하는방법에대해서알아본다. 가속도계에대해서알아본다. 지도를나타내는맵뷰에대해알아본다. 웹뷰와맵뷰를결합함으로써, 여러서비스들을결합하는매시업 (mashup) 에대해알아본다. 차례 위치, 위치, 위치 센서를최대로설정하기 조감도 웹뷰와맵뷰 요약 퀴즈 연습문제

More information

Daum 카페

Daum 카페 인쇄하기 인쇄 [22 장 ] 프래그먼트 (1/8) (20140815 완료 ) 책에담지못한장들 슈퍼성근 조회 326 2014/08/10 22:38:46 주의 : 소스내용중 "0nClick", "0nStart" 함수명첫글자가숫자 0 인것은오타가아닙니다. 다움게시판은 o n C l i c k 라는글을입력할수없기때문에어쩔수없이 영문소문자 o 를숫자 0 으로대체하였습니다.

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 오류처리 손시운 ssw5176@kangwon.ac.kr 오류메시지를분석한다. 오류메시지에서많은내용을알수있다. 2 디버깅 디버거를사용하면프로그램에서쉽게오류를감지하고진단할수있다. 디버거는중단점을설정하여서프로그램의실행을제어할수있으며문장 단위로실행하거나변수의값을살펴볼수있다. 3 이클립스에서디버깅 4 이클립스에서디버깅 5 이클립스의디버깅명령어 6 예외처리

More information

학습목표 SQLite 가뭔지알고, 이를사용할줄안다. SQL 의기본적인사용법들을안다. SQLite 을이용해기본적인데이터베이스응용프로그램을작성할수있다. 행을추가하는기본적인데이터베이스응용프로그램을작성할수있다. 쿼리를실행하는기본적인데이터베이스응용프로그램을작성할수있다. 쿼리결과

학습목표 SQLite 가뭔지알고, 이를사용할줄안다. SQL 의기본적인사용법들을안다. SQLite 을이용해기본적인데이터베이스응용프로그램을작성할수있다. 행을추가하는기본적인데이터베이스응용프로그램을작성할수있다. 쿼리를실행하는기본적인데이터베이스응용프로그램을작성할수있다. 쿼리결과 헬로, 안드로이드 12 주차 SQL 활용하기 (1) 강대기동서대학교컴퓨터정보공학부 학습목표 SQLite 가뭔지알고, 이를사용할줄안다. SQL 의기본적인사용법들을안다. SQLite 을이용해기본적인데이터베이스응용프로그램을작성할수있다. 행을추가하는기본적인데이터베이스응용프로그램을작성할수있다. 쿼리를실행하는기본적인데이터베이스응용프로그램을작성할수있다. 쿼리결과를보여주는기본적인데이터베이스응용프로그램을작성할수있다.

More information

교육자료

교육자료 THE SYS4U DODUMENT Java Reflection & Introspection 2012.08.21 김진아사원 2012 SYS4U I&C All rights reserved. 목차 I. 개념 1. Reflection 이란? 2. Introspection 이란? 3. Reflection 과 Introspection 의차이점 II. 실제사용예 1. Instance의생성

More information

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx 2018 학년도 1 학기 JAVA 프로그래밍 II 514760-1 2018 년봄학기 5/10/2018 박경신 Lab#1 (ImageTest) Lab#1 은영상파일 (Image) 을읽어서정보를출력 Java Tutorials Lesson: Working with Images https://docs.oracle.com/javase/tutorial/2d/images/index.html

More information

JUNIT 실습및발표

JUNIT 실습및발표 JUNIT 실습및발표 JUNIT 접속 www.junit.org DownLoad JUnit JavaDoc API Document 를참조 JUNIT 4.8.1 다운로드 설치파일 (jar 파일 ) 을다운로드 CLASSPATH 를설정 환경변수에서설정 실행할클래스에서 import JUnit 설치하기 테스트실행주석 @Test Test 를실행할 method 앞에붙임 expected

More information

PowerPoint Presentation

PowerPoint Presentation Class - Property Jo, Heeseung 목차 section 1 클래스의일반구조 section 2 클래스선언 section 3 객체의생성 section 4 멤버변수 4-1 객체변수 4-2 클래스변수 4-3 종단 (final) 변수 4-4 멤버변수접근방법 section 5 멤버변수접근한정자 5-1 public 5-2 private 5-3 한정자없음

More information

슬라이드 1

슬라이드 1 Android Mobile Application Development Part 2 Agenda Part 1 Build Develop Environment Create new Project Composition of Project Simulate Application Part 2 User Interface Activity Toast Preference Log

More information

파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter

파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter 파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter 클래스의사용법은다음과같다. PrintWriter writer = new PrintWriter("output.txt");

More information

Microsoft PowerPoint UI-Event.Notification(1.5h).pptx

Microsoft PowerPoint UI-Event.Notification(1.5h).pptx To be an Android Expert 문양세강원대학교 IT 대학컴퓨터학부 UI 이벤트 Event listener Touch mode Focus handling Notification Basic toast notification Customized toast notification Status bar notification 2 사용자가인터랙션하는특정 View

More information

다른 JSP 페이지호출 forward() 메서드 - 하나의 JSP 페이지실행이끝나고다른 JSP 페이지를호출할때사용한다. 예 ) <% RequestDispatcher dispatcher = request.getrequestdispatcher(" 실행할페이지.jsp");

다른 JSP 페이지호출 forward() 메서드 - 하나의 JSP 페이지실행이끝나고다른 JSP 페이지를호출할때사용한다. 예 ) <% RequestDispatcher dispatcher = request.getrequestdispatcher( 실행할페이지.jsp); 다른 JSP 페이지호출 forward() 메서드 - 하나의 JSP 페이지실행이끝나고다른 JSP 페이지를호출할때사용한다. 예 ) RequestDispatcher dispatcher = request.getrequestdispatcher(" 실행할페이지.jsp"); dispatcher.forward(request, response); - 위의예에서와같이 RequestDispatcher

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 실습 1 배효철 th1g@nate.com 1 목차 조건문 반복문 System.out 구구단 모양만들기 Up & Down 2 조건문 조건문의종류 If, switch If 문 조건식결과따라중괄호 { 블록을실행할지여부결정할때사용 조건식 true 또는 false값을산출할수있는연산식 boolean 변수 조건식이 true이면블록실행하고 false 이면블록실행하지않음 3

More information

<4D F736F F F696E74202D20C1A63038C0E520C5ACB7A1BDBABFCD20B0B4C3BC4928B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63038C0E520C5ACB7A1BDBABFCD20B0B4C3BC4928B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 8 장클래스와객체 I 이번장에서학습할내용 클래스와객체 객체의일생직접 메소드클래스를 필드작성해 UML 봅시다. QUIZ 1. 객체는 속성과 동작을가지고있다. 2. 자동차가객체라면클래스는 설계도이다. 먼저앞장에서학습한클래스와객체의개념을복습해봅시다. 클래스의구성 클래스 (class) 는객체의설계도라할수있다. 클래스는필드와메소드로이루어진다.

More information

RDS_MAN_NO 도로구간일련번호 NUMBER(12) BSI_INT_SN 기초구간일련번호 NUMBER(10) EQB_MAN_SN 건물군일련번호 NUMBER(10) BULD_SE_CD 건물구분코드 VARCHAR2(1) BULD_MNNM 건물본번 NUMBER(5) BUL

RDS_MAN_NO 도로구간일련번호 NUMBER(12) BSI_INT_SN 기초구간일련번호 NUMBER(10) EQB_MAN_SN 건물군일련번호 NUMBER(10) BULD_SE_CD 건물구분코드 VARCHAR2(1) BULD_MNNM 건물본번 NUMBER(5) BUL 모바일 GIS 실습 A. 실습할프로젝트소개 첫째, 스마트폰또는태블릿 PC의화면에지도를표시하고둘째, 지도를레이어 (Layer) 단위로구성하며셋째, 구성된레이어의색상등의심벌을지정하고넷째, 구성된레이어의라벨을표시하며다섯째, 표시된건물을터치하면터치된건물의속성정보를제공하고여섯째, 현재내위치로지도를이동함 B. 사용할지도데이터살펴보기 레이어이름 설명 형상 SJ _EMD

More information

Microsoft PowerPoint - Java7.pptx

Microsoft PowerPoint - Java7.pptx HPC & OT Lab. 1 HPC & OT Lab. 2 실습 7 주차 Jin-Ho, Jang M.S. Hanyang Univ. HPC&OT Lab. jinhoyo@nate.com HPC & OT Lab. 3 Component Structure 객체 (object) 생성개념을이해한다. 외부클래스에대한접근방법을이해한다. 접근제어자 (public & private)

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field

More information

¾Èµå·ÎÀÌµå ³¹Àå-Åë.PDF

¾Èµå·ÎÀÌµå ³¹Àå-Åë.PDF 시작하기 시작하기 :: 학습목표 :: 이클립스에서새로운 Project를만들수있다 View를디자인하고프로그램에연결할수있다 버튼의 Listener를작성할수있다 작성한 Listener를여러개의버튼이공유하게할수있다 일정한범위의난수를만들수있다 난수의발생빈도를조절할수있다 프로그램에서 ImageView의비트맵을바꿀수있다 1.1 시작하기에앞서 프로그램의기본흐름은입력, 처리,

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 예외처리 배효철 th1g@nate.com 1 목차 예외와예외클래스 실행예외 예외처리코드 예외종류에따른처리코드 자동리소스닫기 예외처리떠넘기기 사용자정의예외와예외발생 예외와예외클래스 구문오류 예외와예외클래스 구문오류가없는데실행시오류가발생하는경우 예외와예외클래스 import java.util.scanner; public class ExceptionExample1

More information

Microsoft PowerPoint - 4주차_Android_UI구현.ppt [호환 모드]

Microsoft PowerPoint - 4주차_Android_UI구현.ppt [호환 모드] Android UI 구현 학습목표 교육목표 Android application 구성요소 Activity Layout UI 설계 Linear Layout 구현 Android application 구성요소 (1) () Application 구성요소 AndroidManifest.xml Android application 구성요소 (2) 구성요소 기능 Activity

More information

07 자바의 다양한 클래스.key

07 자바의 다양한 클래스.key [ 07 ] . java.lang Object, Math, String, StringBuffer Byte, Short, Integer, Long, Float, Double, Boolean, Character. java.util Random, StringTokenizer Calendar, GregorianCalendar, Date. Collection, List,

More information

(Microsoft PowerPoint - java1-lecture11.ppt [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - java1-lecture11.ppt [\310\243\310\257 \270\360\265\345]) 예외와예외클래스 예외처리 514760-1 2016 년가을학기 12/08/2016 박경신 오류의종류 에러 (Error) 하드웨어의잘못된동작또는고장으로인한오류 에러가발생되면 JVM실행에문제가있으므로프로그램종료 정상실행상태로돌아갈수없음 예외 (Exception) 사용자의잘못된조작또는개발자의잘못된코딩으로인한오류 예외가발생되면프로그램종료 예외처리 추가하면정상실행상태로돌아갈수있음

More information

쉽게 풀어쓴 C 프로그래밊

쉽게 풀어쓴 C 프로그래밊 Power Java 제 27 장데이터베이스 프로그래밍 이번장에서학습할내용 자바와데이터베이스 데이터베이스의기초 SQL JDBC 를이용한프로그래밍 변경가능한결과집합 자바를통하여데이터베이스를사용하는방법을학습합니다. 자바와데이터베이스 JDBC(Java Database Connectivity) 는자바 API 의하나로서데이터베이스에연결하여서데이터베이스안의데이터에대하여검색하고데이터를변경할수있게한다.

More information

Cluster management software

Cluster management software 자바네트워크프로그래밍 (OCJP 국제공인자격취득중심 ) 충북대학교 최민 기본예제 예외클래스를정의하고사용하는예제 class NewException extends Exception { public class ExceptionTest { static void methoda() throws NewException { System.out.println("NewException

More information

Spring Data JPA Many To Many 양방향 관계 예제

Spring Data JPA Many To Many 양방향 관계 예제 Spring Data JPA Many To Many 양방향관계예제 오라클자바커뮤니티 (ojc.asia, ojcedu.com) 엔티티매핑 (Entity Mapping) M : N 연관관계 사원 (Sawon), 취미 (Hobby) 는다 : 다관계이다. 사원은여러취미를가질수있고, 하나의취미역시여러사원에할당될수있기때문이다. 보통관계형 DB 에서는다 : 다관계는 1

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 클래스, 객체, 메소드 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 필드만있는클래스 텔레비젼 2 예제 1. 필드만있는클래스 3 예제 2. 여러개의객체생성하기 4 5 예제 3. 메소드가추가된클래스 public class Television { int channel; // 채널번호 int volume; // 볼륨 boolean

More information

UI TASK & KEY EVENT

UI TASK & KEY EVENT T9 & AUTOMATA 2007. 3. 23 PLATFORM TEAM 정용학 차례 T9 개요 새로운언어 (LDB) 추가 T9 주요구조체 / 주요함수 Automata 개요 Automata 주요함수 추후세미나계획 질의응답및토의 T9 ( 2 / 30 ) T9 개요 일반적으로 cat 이라는단어를쓸려면... 기존모드 (multitap) 2,2,2, 2,8 ( 총 6번의입력

More information

2_안드로이드UI

2_안드로이드UI 03 Layouts 레이아웃 (Layout) u ViewGroup의파생클래스로서, 포함된 View를정렬하는기능 u 종류 LinearLayout 컨테이너에포함된뷰들을수평또는수직으로일렬배치하는레이아웃 RelativeLayout 뷰를서로간의위치관계나컨테이너와의위치관계를지정하여배치하는레이아웃 TableLayout 표형식으로차일드를배치하는레이아웃 FrameLayout

More information

Network Programming

Network Programming Part 5 확장된 Network Programming 기술 1. Remote Procedure Call 2. Remote Method Invocation 3. Object Request Broker 2. Java RMI

More information

XML Parser

XML Parser XML Parser 6 조 20080945 이성훈 20081005 이재환 20111519 김기순 목차 1. Parsing의정의, 필요성 2. DOM Parser 3. SAX Parser 4. XML Pull Parser 1. Parsing 의정의, 필요성 Parsing 이란? 주어진문장을분석하거나문법적관계를해석하는것 Parsing 의필요성 프로그래밍이간편 플랫폼독립적프로그래밍언어에구애받지않음

More information

chap 5: Trees

chap 5: Trees 5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경

More information

09-interface.key

09-interface.key 9 Database insert(record r): boolean find(key k): Record 1 Record getkey(): Key * Record Key Database.? Key equals(key y): boolean Database insert(record r): boolean find(key k): Record * Database OK 1

More information

JMF3_심빈구.PDF

JMF3_심빈구.PDF JMF JSTORM http://wwwjstormpekr Issued by: < > Revision: Document Information Document title: Document file name: Revision number: Issued by: JMF3_ doc Issue Date:

More information

제8장 자바 GUI 프로그래밍 II

제8장 자바 GUI 프로그래밍 II 제8장 MVC Model 8.1 MVC 모델 (1/7) MVC (Model, View, Controller) 모델 스윙은 MVC 모델에기초를두고있다. MVC란 Xerox의연구소에서 Smalltalk 언어를바탕으로사용자인터페이스를개발하기위한방법 MVC는 3개의구성요소로구성 Model : 응용프로그램의자료를표현하기위한모델 View : 자료를시각적으로 (GUI 방식으로

More information

슬라이드 1

슬라이드 1 -Part3- 제 4 장동적메모리할당과가변인 자 학습목차 4.1 동적메모리할당 4.1 동적메모리할당 4.1 동적메모리할당 배울내용 1 프로세스의메모리공간 2 동적메모리할당의필요성 4.1 동적메모리할당 (1/6) 프로세스의메모리구조 코드영역 : 프로그램실행코드, 함수들이저장되는영역 스택영역 : 매개변수, 지역변수, 중괄호 ( 블록 ) 내부에정의된변수들이저장되는영역

More information

뷰그룹 ( 레이아웃 ) 레이아웃이름 ( 클래스이름 ) FrameLayout LinearLayout 설명단일객체를표현하기위한프레임. 왼쪽상단에하나의뷰를배치하기때문에나중 에그린객체만보여준다. 수평또는수직으로자손의뷰를배치. 뷰가들어갈만한공간이없을때는자동으로 스크롤바가나타난다

뷰그룹 ( 레이아웃 ) 레이아웃이름 ( 클래스이름 ) FrameLayout LinearLayout 설명단일객체를표현하기위한프레임. 왼쪽상단에하나의뷰를배치하기때문에나중 에그린객체만보여준다. 수평또는수직으로자손의뷰를배치. 뷰가들어갈만한공간이없을때는자동으로 스크롤바가나타난다 크기에사용할수있는단위 표기 단위 설명 px 픽셀수 사용중화면에서의픽셀수, 해상도가높아지면픽셀의물리적인크기가줄어든다. in 인치 사용중화면에서의인치단위의길이 mm 밀리미터 사용중화면에서의밀리미터단위의길이 pt 포인트수 사용중화면에서의 1/72 인치를 1 포인트로하는길이 dp 해상도에의존하지않는픽셀수 1은해상도가 180dpi일때 1 픽셀. 10dp가 160dpi일때에는

More information

슬라이드 1

슬라이드 1 사용자인터페이스 (II) 시작하면서 2 목차 리스트뷰 : 어댑터, 어댑터뷰, 대화창 메뉴 리스트뷰 - 어댑터 Adapter 4 배열, XML 파일, 데이터베이스에서다양한종류의값을읽어오는공통의인터페이스 선택위젯에게데이터를제공, 각데이터항목들을위젯내부에표시하는위젯클래스로의변홖수행 사용자인터페이스인뷰와데이터소스를연결 Data Source: Array, XML, Database

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 오류처리 손시운 ssw5176@kangwon.ac.kr 오류메시지를분석한다. 오류메시지에서많은내용을알수있다. 2 디버깅 디버거를사용하면프로그램에서쉽게오류를감지하고진단할수있다. 디버거는중단점을설정하여서프로그램의실행을제어할수있으며문장 단위로실행하거나변수의값을살펴볼수있다. 3 이클립스에서디버깅 4 이클립스에서디버깅 5 이클립스의디버깅명령어 6 예외처리

More information

JAVA PROGRAMMING 실습 08.다형성

JAVA PROGRAMMING 실습 08.다형성 2015 학년도 2 학기 1. 추상메소드 선언은되어있으나코드구현되어있지않은메소드 abstract 키워드사용 메소드타입, 이름, 매개변수리스트만선언 public abstract String getname(); public abstract void setname(string s); 2. 추상클래스 abstract 키워드로선언한클래스 종류 추상메소드를포함하는클래스

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Application Framework 어플리케이션프레임워크 발표자 : 김준섭 이문서는나눔글꼴로작성되었습니다. 다운받기 목차 Application Framework. 1. 통지관리자 (Notification Manager) 2. 리소스관리자 (resource manager) 3. 레이아웃인플레이터매니저 (Layout Inflater Manager) Notification

More information

Design Issues

Design Issues 11 COMPUTER PROGRAMMING INHERIATANCE CONTENTS OVERVIEW OF INHERITANCE INHERITANCE OF MEMBER VARIABLE RESERVED WORD SUPER METHOD INHERITANCE and OVERRIDING INHERITANCE and CONSTRUCTOR 2 Overview of Inheritance

More information

Microsoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드]

Microsoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드] - Socket Programming in Java - 목차 소켓소개 자바에서의 TCP 프로그램작성방법 주요클래스와메소드 HTTP 프로토콜을이용한예제 에코프로그램 Q/A 에코프로그램 - EchoServer 에코프로그램 - EchoClient TCP Programming 1 소켓소개 IP, Port, and Socket 포트 (Port): 전송계층에서통신을수행하는응용프로그램을찾기위한주소

More information

오버라이딩 (Overriding)

오버라이딩 (Overriding) WindowEvent WindowEvent 윈도우가열리거나 (opened) 닫힐때 (closed) 활성화되거나 (activated) 비활성화될때 (deactivated) 최소화되거나 (iconified) 복귀될때 (deiconified) 윈도우닫힘버튼을누를때 (closing) WindowEvent 수신자 abstract class WindowListener

More information

목차 JEUS EJB Session Bean가이드 stateful session bean stateful sample 가이드 sample source 결과확인 http session에

목차 JEUS EJB Session Bean가이드 stateful session bean stateful sample 가이드 sample source 결과확인 http session에 개념정리및샘플예제 EJB stateful sample 문서 2016. 01. 14 목차 JEUS EJB Session Bean가이드... 3 1. stateful session bean... 3 1.1 stateful sample 가이드... 3 1.1.1 sample source... 3 1.1.2 결과확인... 6 1.2 http session에서사용하기...

More information

윈도우시스템프로그래밍

윈도우시스템프로그래밍 데이터베이스및설계 MySQL 을위한 MFC 를사용한 ODBC 프로그래밍 2012.05.10. 오병우 컴퓨터공학과금오공과대학교 http://www.apmsetup.com 또는 http://www.mysql.com APM Setup 설치발표자료참조 Department of Computer Engineering 2 DB 에속한테이블보기 show tables; 에러발생

More information

Microsoft PowerPoint - lec2.ppt

Microsoft PowerPoint - lec2.ppt 2008 학년도 1 학기 상지대학교컴퓨터정보공학부 고광만 강의내용 어휘구조 토큰 주석 자료형기본자료형 참조형배열, 열거형 2 어휘 (lexicon) 어휘구조와자료형 프로그램을구성하는최소기본단위토큰 (token) 이라부름문법적으로의미있는최소의단위컴파일과정의어휘분석단계에서처리 자료형 자료객체가갖는형 구조, 개념, 값, 연산자를정의 3 토큰 (token) 정의문법적으로의미있는최소의단위예,

More information

BLOB NULL Binary 데이터 값이존재하지않음 테이블의작성예 Create table contact_list( _id integer primary key autoincrement, name text not null, tel text not null default

BLOB NULL Binary 데이터 값이존재하지않음 테이블의작성예 Create table contact_list( _id integer primary key autoincrement, name text not null, tel text not null default 1. SQLite 의특징 - 오픈소스 - 최소한의라이브러리만으로동작 - 관리유저나설정파일등이불필요 - 원자성 (atomicity), 일관성 (consistency), 독립성 (isolation), 영속성 (durabitiy) 이라는데이터베이스에필요한특성을갖추고있다. - SQL92에서정의된명령어의대부분이용가능, 하나의데이터베이스가하나의파일에저장 2. 어플리케이션개발시

More information

PowerPoint Template

PowerPoint Template JavaScript 회원정보 입력양식만들기 HTML & JavaScript Contents 1. Form 객체 2. 일반적인입력양식 3. 선택입력양식 4. 회원정보입력양식만들기 2 Form 객체 Form 객체 입력양식의틀이되는 태그에접근할수있도록지원 Document 객체의하위에위치 속성들은모두 태그의속성들의정보에관련된것

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

TipssoftAppActivity.java // 기본소스파일 main.xml // 배치와구성에관련된리소스파일 string.xml // 프로그램에서사용할문자열에관련된리소스파일 컴파일을하고나면 r.java 라는소스파일이하나추가되는데이파일은리소스파일을소스파일에서이용할수있도

TipssoftAppActivity.java // 기본소스파일 main.xml // 배치와구성에관련된리소스파일 string.xml // 프로그램에서사용할문자열에관련된리소스파일 컴파일을하고나면 r.java 라는소스파일이하나추가되는데이파일은리소스파일을소스파일에서이용할수있도 1. " 소스파일 " 과 " 리소스파일 " 에대하여 소스파일은우리가흔히알고있듯이프로그래밍언어를사용해서자신이만들고자하는프로그램을구현한파일입니다. 예전에작성된프로그램들은소스파일만으로이루어진프로그램도많았습니다. 하지만, 프로그램환경이점점더복잡해지고사용자인터페이스가다양해지면서인터페이스구성을서술식으로나열해서소스파일에표현하는것은한계가왔고작업효율을떨어트리게되어해결책이필요하게되었습니다.

More information

Microsoft Word - src.doc

Microsoft Word - src.doc IPTV 서비스탐색및콘텐츠가이드 RI 시스템운용매뉴얼 목차 1. 서버설정방법... 5 1.1. 서비스탐색서버설정... 5 1.2. 컨텐츠가이드서버설정... 6 2. 서버운용방법... 7 2.1. 서비스탐색서버운용... 7 2.1.1. 서비스가이드서버실행... 7 2.1.2. 서비스가이드정보확인... 8 2.1.3. 서비스가이드정보추가... 9 2.1.4. 서비스가이드정보삭제...

More information

OpenCV와 함께하는 컴퓨터 비전 프로그래밍 캠프

OpenCV와 함께하는 컴퓨터 비전 프로그래밍 캠프 OpenCV 와함께하는컴퓨터비전프로그래밍캠프 Appx. 안드로이드 OpenCV 프로그래밍 Last Update: 2018/06/07 Visual C++ 영상처리프로그래밍 저자 황선규 / 공학박사 sunkyoo.hwang@gmail.com 모바일컴퓨터비전프로그래밍 목차 Android 개요 Android 개발환경구축 Android Studio 설치 OpenCV

More information