2013년 8월 30일 금요일

android - backward compatibility

0. Support library

The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level. This design means that your applications can use the libraries' features and still be compatible with devices running Android 1.6 (API level 4) and up. 
Android의 Design Principles은 http://developer.android.com/design/ 에 잘 나와 있는데, 이러한 디자인 철학은 Ice Cream Sandwich - Android 4.0 부터 적용이 되기 때문에 app을 기획하고 개발할 때 하위 호환성(backward compatibility)이 고민된다. 
다행히 support library를 통해서 상위 버전의 api를 사용할 수 있게 해준다.

1. Adding Support Libraries

Some Support Libraries contain resources beyond compiled code classes, such as images or XML files. For example, the v7 appcompat and v7 gridlayout libraries include resources. 
설정하는 건 http://developer.android.com/tools/support-library/setup.html 에 잘 나와 있다. 
위 내용 처럼 resource를 포함하는 library도 있는데, 이 경우 문서에 빠진 내용이 있어 삽질을 좀 했다.

 기본적으로 android-support-v7-appcompat라는 library project를 생성한 후 나의 project의 build-path에 추가하는 내용인데 아래 중 1번과 2번 사이에 Android property를 선택하라는 내용이 빠져있다 ㅠㅠ Java Build Path에서 해매질 마시길 ..


 * eclipse에서 library project가 현재 project와 다른 workspace에 있으면 참조가 안된다. 주의!!!!!!

댓글 없음:

댓글 쓰기