WOONO's Blog






Eclipse 에서 Android Framework Base Source Download 하고 연결하기


"Android Framework Base Source" 를 받기 위해서는 "Linux" 의 "Git" 이나 "Repo" 를 이용해야 한다.

과거에 브라우저를 통해 받을 수 있었는데 해킹을 당한 후 브라우저로 Download 받는 것이 불가능한다.

이번 시간에는 "Eclipse PlugIn" 인 "JGit" 를 사용해서 받는 방법을 알아 보도록 한다.



1. 설치 시 필요한 것

 


Eclipse, JDK, Android SDK 가 설치 되어 있어야 한다.



1) Eclipse Downlaod
 
다운로드 : http://www.eclipse.org/downloads/

아래 둘 중 하나를 다운 받으면 된다.

● Eclipse IDE for Java Developers


● Eclipse for RCP and RAP Developers



2) sun-java JDK Downlaod

설치 사이트 : http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html

위 사이트에서 아래 둘 중 하나를 받으면 된다. (Link 를 바로 클릭해서 받아도 된다.)




3) android-sdk-windows Downlaod

   
설치 참고 사이트 : http://developer.android.com/sdk/index.html


"Eclipse" 에 "Android SDK" 를 연동 하는것은 아래 사이트를 통해 참고하기 바란다.

설치 가이드 : http://developer.android.com/sdk/installing.html



2. Google Password Generator 실행  


아래 사이트는 google 에서 제공하는 Androud Platform Base Source 를 받는 법을 소개 한다. 

http://source.android.com/source/downloading.html


※ Base는 참고용 Source 입니다 Build 할 수 없다.

Windows에서 FullSource를 받고 싶으면 아래 사이트들을 참고 하기 바란다.

아래 Site 에 방문하면 "repo" 랑 비슷한 shell script 를 제공한다. 그것을 msysgit 에서 실행 하면 된다.

http://bradchow.wordpress.com/2009/01/20/get-android-source-code-in-m-windows/


"Git" 과 "Repo" 사용법이 나와 있다.

하지만 많은 사람들이 이곳에서 좌절을 격 거나 "Linux" 를 설치하기에는 너무 큰 부담을 가지고 있다.

아래 원본주소나 짧은주소 링크를 통해 계정의 패스워드를 생성한다.   (링크가 무식하게 길다 ㅠㅠ)

 


위의 Link 중 아무거나 선택해서 브라우저를 실행한다.


[그림 2-1]


[그림 2-1] 처럼 로그인 화면이 나온다. (Google 계정에 이미 가입이 되어 있고 로그인이 되어 있으면 다음 화면으로 진행된다)

Google 계정이 있으면 Google 계정을 입력해주면 된다.

없으면 "가입하기" 버튼을 클릭해서 가입 절차를 진행한다.


[그림 2-2]


Google 계정에 로그인을 했으면 [그림 2-2] 처럼 권한요청 페이지가 나오게 된다.

여기서 "억세스 허용" 버튼을 선택한다.



[그림 2-3]



[그림 2-3] 처럼 승인이 완료된 페이지가 나오는데 생성된 "Username" 과 "Password"는 따로 메모장 같은 곳에 복사해둔다.

잡설 : 원문에 보면 원래는 안드로이드 소스 코드에 대한 억세스는 익명으로 가능하지만 과도한 사용에 대해서 서비스를 보호하려면(서버가 해킹 당한적이 있었죠 ^^) 각 IP에 대해서 억세스가 인증이 되도록 패스워드를 생성해서 ~/.netrc 에 저장을 해야 한 다는군요.



3. Eclipse JGit PlugIn 설치  


"Eclipse" 를 실행 하고 "Menu" 에서 "Help > Install New Software..." 를 선택 한다.



[그림 3-1]


Name : JGit PlugIn
Location : http://www.jgit.org/updates

[그림 3-1]에서 "Name" 과 "Location" 입력하고 "OK"를 선택한다.


[그림 3-2]


[그림 3-2]에서 "Eclipse Git Team Provider" 를 선택하고 "Eclipse EGit"를 선택하고 "Next"를 선택한다.

계속해서 "Next"를 누르면 설치 과정이 진행되면서 "JGit PlugIn" 이 설치가 완료된다.

"Eclipse" 를 다시 실행한다.



4. JGit 으로 Source 받기

 


"JGit"으로 Source를 받기 위해서는 먼저 "Eclipse" 를 실행한다.

[그림 4-1]


[그림 4-1] 처럼 "File > Import"를 선택한다.


[그림 4-2]


[그림 4-2] 처럼 "Select" 항목에서 "Git > Projects from Git" 을 선택하고 "Next"를 선택한다.


[그림 4-3]


[그림 4-3]처럼 "URI" 를 선택하고 "Next"를 선택한다.


[그림 4-4]


URI : https://android.googlesource.com/a/platform/frameworks/base.git


[그림 4-4]에서 "URI" 를 입력하고 [2. Google Password Generator 실행] 에서 생성한 "Username" 과 "Password" 를  "User" 와 "Password" 란에 입력하고 "Next"를 선택한다.


[그림 4-5]


[그림 4-5] 처럼 "Branch" 를 선택 하는 화면이 나오는데 "Default" 로 놔두고 "Next"를 선택한다.


[그림 4-6]


[그림 4-6] 처럼 저장 할 "Directory" 위치를 묻는데 적당한 곳에 "Directory" 를 지정해주고 "Next"를 선택한다.


[그림 4-7]


[그림 4-7]처럼 파일을 Download 하는 화면이 나오는데 상당히 오랜 시간이 걸린다. (다른 작업을 하거나 잠시 자리를 비우는 것이 정신 건강에 좋다)


[그림 4-8]


어느정도 시간이 경과되면 [그림 3-8] 처럼 Downlaod 이 후 화면이 나오는데 이곳에서 "Finish"를 선택한다.

이후 "Wizard for project import" 가 실행 되는데 무시해도 된다.



5. Source 연결하기

 


"Eclipse" 에서 Test용 Project를 생성하거나 기존 Project 를 실행하고 "Editor" 창을 연다.


[그림 5-1]


[그림 5-1]처럼 "Activity" 에서오른쪽 마우스를 클릭하고 "Open Declaration"을 선택한다.

또는 단축키 "F3"을 눌러도 된다.


[그림 5-2]


[그림 5-2] 처럼 Source not found 라는 화면이 출력되는데 "Change Attached Source..." 버튼을 클릭하고 "Location path"에 아까 받은 경로를 지정해 주고 "OK"를 누르면 Souce 가 연결된 것을 볼 수 있다.


작성하는데 꽤 많은 시간이 소요 되었습니다.

참고가 되신 분들은 따뜻한 댓글 달아주시면 감사하겠습니다.

Posted by woono


Android Platform Source 2.3 다운로드


Android Platform Source를 받으려면 git 와 reps 등을 사용해야 합니다. 

하지만 download 할 때 정말 엄청난 인내를 요구합니다. 

포맷 등을 하고 다시 받기에는 인내심이 부족한듯합니다. 

그래서 source 파일을 통째로 올렸습니다. 

전체 source 아니라 2.3. x 기준입니다 

다른 Platform 에서도 참조할 수 있니 그냥 쓰셔도 무방합니다. 


설치방법  


1. 압축파일을 적당한 폴더에 받고 푼다.


2. 압축을 푼 파일들을 안드로이드가 설치된 디렉토리 "\android-sdk-windows\platforms\android-10\sources"  에 복사한다. (sources 폴더는 기본적으로 없기 때문에 새로 만들고 만든 폴더 아래 복사하면 된다.)



다운로드

 





android_sources.2.3.x.7z


Posted by woono

Codenames, Tags, and Build Numbers

At a high level, Android development happens around families of releases, which use code names ordered alphabetically after tasty treats.

Platform code names, versions, API levels, and NDK releases

The code names match the following version numbers, along with API levels and NDK releases provided for convenience:

Code nameVersionAPI level
(no code name)1.0API level 1
(no code name)1.1API level 2
Cupcake1.5API level 3, NDK 1
Donut1.6API level 4, NDK 2
Eclair2.0API level 5
Eclair2.0.1API level 6
Eclair2.1API level 7, NDK 3
Froyo2.2.xAPI level 8, NDK 4
Gingerbread2.3 - 2.3.2API level 9, NDK 5
Gingerbread2.3.3 - 2.3.7API level 10
Honeycomb3.0API level 11
Honeycomb3.1API level 12, NDK 6
Honeycomb3.2.xAPI level 13
IceCreamSandwich4.0.1 - 4.0.2API level 14, NDK 7
IceCreamSandwich4.0.3API level 15

Starting with Cupcake, individual builds are identified with a short build code, e.g. FRF85B.

The first letter is the code name of the release family, e.g. F is Froyo.

The second letter is a branch code that allows Google to identify the exact code branch that the build was made from, and R is by convention the primary release branch.

The next letter and two digits are a date code. The letter counts quarters, with A being Q1 2009. Therefore, F is Q2 2010. The two digits count days within the quarter, so F85 is June 24 2010.

Finally, the last letter identifies individual versions related to the same date code, sequentially starting with A; A is actually implicit and usually omitted for brevity.

The date code is not guaranteed to be the exact date at which a build was made, and it is common that minor variations added to an existing build re-use the same date code as that existing build.

Source code tags and builds

Starting with Donut, the exact list of tags and builds is in the following table:

BuildTagNotes
DRC83android-1.6_r1.1earliest Donut version, ADP1, ADP2
DRC92android-1.6_r1.2
DRD08android-1.6_r1.3
DRD20android-1.6_r1.4
DMD64android-1.6_r1.5latest Donut version
ESD20android-2.0_r1earliest Eclair version
ESD56android-2.0.1_r1
ERD79android-2.1_r1Nexus One
ERE27android-2.1_r2Nexus One
EPE54Bandroid-2.1_r2.1pNexus One
ESE81android-2.1_r2.1s
EPF21Bandroid-2.1_r2.1p2latest Eclair version
FRF85Bandroid-2.2_r1earliest Froyo version, Nexus One
FRF91android-2.2_r1.1Nexus One
FRG01Bandroid-2.2_r1.2
FRG22Dandroid-2.2_r1.3
FRG83android-2.2.1_r1Nexus One
FRG83Dandroid-2.2.1_r2Nexus One
FRG83Gandroid-2.2.2_r1Nexus One
FRK76android-2.2.3_r1
FRK76Candroid-2.2.3_r2latest Froyo version
GRH55android-2.3_r1earliest Gingerbread version, Nexus S
GRH78android-2.3.1_r1Nexus S
GRH78Candroid-2.3.2_r1Nexus S
GRI40android-2.3.3_r1Nexus One, Nexus S
GRI54android-2.3.3_r1.1Nexus S
GRJ06Dandroid-2.3.4_r0.9Nexus S 4G
GRJ22android-2.3.4_r1Nexus One, Nexus S, Nexus S 4G
GRJ90android-2.3.5_r1Nexus S 4G
GRK39Candroid-2.3.6_r0.9Nexus S
GRK39Fandroid-2.3.6_r1Nexus One, Nexus S
GWK74android-2.3.7_r1latest Gingerbread version, Nexus S 4G
ITL41Dandroid-4.0.1_r1earliest IceCreamSandwich version, Galaxy Nexus
ITL41Dandroid-4.0.1_r1.1Galaxy Nexus
ITL41Fandroid-4.0.1_r1.2Galaxy Nexus
ICL53Fandroid-4.0.2_r1Galaxy Nexus
IML74Kandroid-4.0.3_r1Nexus S
IML77latest IceCreamSandwich version

The branches froyo, gingerbread, ics-mr0, ics-mr1, represent development branches that do not exactly match configurations that were tested by Google. They might contain a variety of changes in addition to the official tagged releases, and those haven't been as thoroughly tested.

Honeycomb GPL modules

For Honeycomb, the entire platform source code isn't available. However, the parts of Honeycomb licensed under the GPL and LGPL are available under the following tags:

BuildTagNotes
HRI39android-3.0_r1earliest Honeycomb version
HRI66android-3.0_r1.1
HWI69android-3.0_r1.2
HRI93android-3.0_r1.3
HMJ37android-3.1_r1
HTJ85Bandroid-3.2_r1
HTK55Dandroid-3.2.1_r1
HTK75Dandroid-3.2.1_r2
HLK75Candroid-3.2.2_r1
HLK75Dandroid-3.2.2_r2
HLK75Fandroid-3.2.4_r1latest Honeycomb version

There is no manifest that contains exactly those. However, there are manifests that allow building those components. The following commands work for 3.0_r1.1, and using other versions can be done by switching the git checkout paramater, and if necessary the -m parameter in repo init. The git checkout command outputs an error for the non-GPL projects, where it can't find the tag in question.

Posted by woono

웹페이지 띄우기

Uri uri = Uri.parse("http://www.google.com");
Intent it  = new Intent(Intent.ACTION_VIEW,uri);
startActivity(it);

구글맵 띄우기

Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.Action_VIEW,uri);
startActivity(it);


구글 길찾기 띄우기

Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=출발지주소&daddr=도착지주소&hl=ko"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it);


SMS/MMS 발송

Intent it = new Intent(Intent.ACTION_VIEW);   
it.putExtra("sms_body", "The SMS text");   
it.setType("vnd.android-dir/mms-sms");   
startActivity(it);  
 
 
// SMS 발송
Uri uri = Uri.parse("smsto:0800000123");   
Intent it = new Intent(Intent.ACTION_SENDTO, uri);   
it.putExtra("sms_body", "The SMS text");   
startActivity(it);  
 
 
// MMS 발송
Uri uri = Uri.parse("content://media/external/images/media/23");   
Intent it = new Intent(Intent.ACTION_SEND);   
it.putExtra("sms_body", "some text");   
it.putExtra(Intent.EXTRA_STREAM, uri);   
it.setType("image/png");   
startActivity(it);


이메일 발송

Uri uri = Uri.parse("mailto:xxx@abc.com");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
startActivity(it);
 
 
Intent it = new Intent(Intent.ACTION_SEND);   
it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");   
it.putExtra(Intent.EXTRA_TEXT, "The email body text");   
it.setType("text/plain");   
startActivity(Intent.createChooser(it, "Choose Email Client"));  
 
 
Intent it = new Intent(Intent.ACTION_SEND);     
String[] tos = {"me@abc.com"};     
String[] ccs = {"you@abc.com"};     
it.putExtra(Intent.EXTRA_EMAIL, tos);     
it.putExtra(Intent.EXTRA_CC, ccs);     
it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");     
it.setType("message/rfc822");     
startActivity(Intent.createChooser(it, "Choose Email Client"));   
 
 
// extra 추가하기
Intent it = new Intent(Intent.ACTION_SEND);   
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");   
it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");   
sendIntent.setType("audio/mp3");   
startActivity(Intent.createChooser(it, "Choose Email Client"));
 
 
// 첨부파일을 추가하여 메일 보내기
Intent it = new Intent(Intent.ACTION_SEND);  
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");  
it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/eoe.mp3");  
sendIntent.setType("audio/mp3");  
startActivity(Intent.createChooser(it, "Choose Email Client"));


설치 어플 제거

Uri uri = Uri.fromParts("package", strPackageName, null);   
Intent it = new Intent(Intent.ACTION_DELETE, uri);   
startActivity(it);


APK파일을 통해 제거하기

Uri uninstallUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri);
 
 
// APK파일 설치
Uri installUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);



마켓에서 어플리케이션 검색

Uri uri = Uri.parse("market://search?q=pname:pkg_name");  
Intent it = new Intent(Intent.ACTION_VIEW, uri);  
startActivity(it);  
// 패키지명은 어플리케이션의 전체 패키지명을 입력해야 합니다.
 
 
// 마켓 어플리케이션 상세 화면
Uri uri = Uri.parse("market://details?id=어플리케이션아이디");  
Intent it = new Intent(Intent.ACTION_VIEW, uri);  
startActivity(it);
// 아이디의 경우 마켓 퍼블리싱사이트의 어플을 선택후에 URL을 확인해보면 알 수 있습니다.


구글 검색

Intent intent = new Intent();
intent.setAction(Intent.ACTION_WEB_SEARCH);
intent.putExtra(SearchManager.QUERY,"searchString");


내장 사진 고르기 (Image Selection)

  • android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI
  • android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI
String action = Intent.ACTION_PICK;
Uri uri = android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI;
Intent intent = new Intent(action, uri);
startActivityForResult(intent, SELECT_IMAGE);
 
 
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == SELECT_IMAGE) {
        if (resultCode == Activity.RESULT_OK) {
            Uri selectedImage = data.getData();
            // TODO Do something with the select image URI
        }
    }
}

장치 사용

Camera 사진 촬영

Intent intent2 = new Intent("android.media.action.IMAGE_CAPTURE");
imgUri = Uri.fromFile(photofile);
intent2.putExtra(MediaStore.EXTRA_OUTPUT, imgUri);
startActivityForResult(intent2, 1);


Video 영상 녹화

Intent i = new Intent("android.media.action.VIDEO_CAPTURE");
i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(videofile));
i.putExtra(android.provider.MediaStore.EXTRA_VIDEO_QUALITY, 0);
i.putExtra("android.intent.extra.durationLimit", 60);
startActivityForResult(i, 2);


Audio 음성 녹음

Intent i = new Intent("android.provider.MediaStore.RECORD_SOUND");

음악 파일 재생

Uri playUri = Uri.parse("file:///sdcard/download/everything.mp3");
returnIt = new Intent(Intent.ACTION_VIEW, playUri);


미디어파일 플레이 하기

Intent it = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.parse("file:///sdcard/song.mp3");
it.setDataAndType(uri, "audio/mp3");
startActivity(it);
 
 
Uri uri = Uri.withAppendedPath(
  MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");   
Intent it = new Intent(Intent.ACTION_VIEW, uri);   
startActivity(it);


전화 걸기

Uri uri = Uri.parse("tel:xxxxxx");
Intent it = new Intent(Intent.ACTION_DIAL, uri);  
startActivity(it);  
 
 
Uri uri = Uri.parse("tel.xxxxxx");
Intent it = new Intent(Intent.ACTION_CALL,uri);
// 퍼미션을 잊지 마세요. <uses-permission id="android.permission.CALL_PHONE" />

Posted by woono

Android ListView -Sample Code



1. main.xml 에서 Listview 의 이름을 android:id="@android:id/list" 로 작성하지 않고  "@+id/listView1" 등으로 작성해도 된다. 


이해가 안되는 점은 Graphical Layout Editor 에서 ListView를 넣으면 android:id="@+id/listView1"식으로 이름이 생성되는데 Sample들을 보면 하나같이 android:id="@android:id/list" 로 되어 있다


2. Activaty 에서 ListActivaty로 Extended 하지 않아도 된다.


Posted by woono

개발용 글꼴 ProWindow

2012. 4. 1. 10:36 : Dev

개발용 글꼴 ProWindow 입니다.

 

글꼴 이름은 "H_ProWindow (clear type)" 으로 변경하여 배포 합니다.

 

파일을 다운 받으시고 "windows\fonts" 폴더에 복사 하시면 됩니다.

<Edit++ 에서 사용한 모습>

 

<Eclips 에 적용한 모습>



H_ProFontWindows.7z

Posted by woono