2012년 7월 7일 토요일

[Git] Git 활용한 Android project 관리 ( Git + Eclipse + Android + Google Code)

여기서 정리해보려고 하는 것은
  • 1. 안드로이드 프로젝트
  • 2. 이클립스에서 개발
  • 3. 구글 코드프로젝트를 사용
  • 4. 버전관리 시스템으로는 Git

전체적인 순서는
  • A1. 구글 코드에서 프로젝트 생성
  • A2. 이클립스에서 EGit 플러그인 설치
  • A3. Clone Git repository
  • A4. 기존의 안드로이드 프로젝트를 Git Repository로 커밋
  • A5. Push 로 전체 소스 업데이트


A1. 구글코드에서 프로젝트 생성
먼저 code.google.com 에서 android 프로젝트를 생성한다.
생성 시에는 버전관리 시스템을 Git로 선택한다.
그러면 다음과 같은 Git Repository 정보를 얻을 수 있다.

git clone https://[project name]@code.google.com/p/[project name]/ 


A2. 이클립스에서 EGit 플러그인 설치

A3. Clone Git repository

그림1. code.google.com 에서 받은 repository URI 정보를 이클립스에 입력한다.
그림2. 브랜치를 선택한다.


A4. 기존의 안드로이드 프로젝트를 Git Repository로 커밋
커밋하기 위해 기존의 프로젝트를 share project 한다.

 그림3. 기존의 안드로이드 프로젝트를 share project 한다.

그림4. 로컬저장소를 지정한다.
A5. Push 로 전체 소스 업데이트

그림5. 프로젝트를 커밋한다.

그림6. 프로젝트를 Push 해서 소스코드를 업데이트한다.




2012년 7월 4일 수요일

[jQuery] attr() 과 prop() 차이점



Attribute/Property.attr().prop()
accesskey
align
async
autofocus
checked
class
contenteditable
defaultValue
draggable
href
id
label
location *
multiple
nodeName
nodeType
readOnly
rel
selected
selectedIndex
src
style
tabindex
tagName
title
type
width **


http://blog.jquery.com/2011/05/12/jquery-1-6-1-released/ 에서 퍼옴

2012년 6월 30일 토요일

[jQuery] 1.7 변경사항 중

$(this).attr() 이 사용 중지되고 대신 $(this).prop()로 대체되었다.

2012년 6월 17일 일요일

[Android] DB에서 데이터 가져와 스피너에 업데이트하기


// 디비에접속해서 데이터를 가져와 커서에 넣는다.
Cursor itemCursor = mDbHelperTable.fetchAllAvailTables();
// 안드로이드 특성상 앱/데이터의 life cycle을 지키기 위해 startmanagingcursor를 호출한다.
 startManagingCursor(itemCursor);
  
      List list = new ArrayList();
     
      // create the string array.
      while(itemCursor.moveToNext()){
          String eng = itemCursor.getString(0);
          list.add(eng);
      }               
    

// 스피너 객체생성 
Spinner s = (Spinner) findViewById(R.id.spinner_table);

ArrayAdapter dataAdapter = new ArrayAdapter(this,
              android.R.layout.simple_spinner_item, list);
      dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
s.setAdapter(dataAdapter);

[Android] adb로 sqlite 테이블 select 하기

안드로이드 앱 개발시 sqlite를 사용하면 DB는 다음 위치에 저장되게 된다.

/data/data//databases
예> #cd /data/data/com.android.project-name/databases

데이터베이스 이름을 확인하고 sqlite를 실행한다.

#sqlite3

sqlite 커맨드 프롬프트가 보이면 sql을 실행할 수 있다.


테이블을 셀렉트
sqlite>select * from table_name;

테이블 목록을 확인하는 명령어
sqlite>.tables

[Android] ADB 기본

ADB란 Android debug bridge
쉽게 말하면 디버그를 쉽게 할 수 있도록 여러가지 기능을 제공한다.

ICS 이전에는

\android-sdk\tools

이곳에 있었으나 ICS 이후 부터는

\android-sdk\platform-tools

로 이동되었다.

아래 명령어로 실행할 수 있다.
 c:\>adb shell