검색결과 리스트
Android에 해당되는 글 12건
- 2012.12.29 View PopupMenu
- 2012.12.29 View/Full Screen Modes / Hide Navigation
- 2012.12.03 런처 아이콘 사이즈
- 2012.11.22 FreezesText TextView나 EditText에 존재하는 기능
- 2012.11.22 TextView나 EditText에 존재하는 inputType에 대해서
- 2012.11.22 게임 개발자를 위한 유튜브 세미나 자료
- 2012.11.19 Using the new Build System
- 2012.11.16 세로 SeekBar 예제 소스
- 2012.11.16 쓸만한 위젯 lib
- 2012.09.16 [책] 스마트폰과 태블릿 호환을 위한 안드로이드 앱 프로그래밍
- 2011.07.21 MIV에 대해서
- 2011.07.15 Application Class에 대해서
글
API 11에서 제공하는 팝업 메뉴
메뉴에 서브메뉴가 가능해서 기존 노출되는 팝업 메뉴가 사라지고 서브메뉴가 나온다.
public void onPopupButtonClick(View button) {
PopupMenu popup = new PopupMenu(this, button);
popup.getMenuInflater().inflate(R.menu.popup, popup.getMenu());
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
Toast.makeText(PopupMenu1.this, "Clicked popup menu item " + item.getTitle(),
Toast.LENGTH_SHORT).show();
return true;
}
});
popup.show();
}
메뉴 xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/search"
android:icon="@android:drawable/ic_menu_search"
android:title="@string/popup_menu_search" />
<item android:id="@+id/add"
android:icon="@android:drawable/ic_menu_add"
android:title="@string/popup_menu_add" />
<item android:id="@+id/edit"
android:icon="@android:drawable/ic_menu_edit"
android:title="@string/popup_menu_edit">
<menu>
<item android:id="@+id/share"
android:icon="@android:drawable/ic_menu_share"
android:title="@string/popup_menu_share" />
</menu>
</item>
</menu>
'Android > ApiDemo_Graphic' 카테고리의 다른 글
View/Full Screen Modes / Hide Navigation (0) | 2012.12.29 |
---|
설정
트랙백
댓글
글
화면에 동적으로 제어하는 코드로써
특징적인 것은 Navigation을 숨기는 코드가 들어 있다.
네비게이션을 옮기는 설정은 SYSTEM_UI_FLAG_HIDE_NAVIGATION인데, 아래와 같은 사항에 주의해서 사용해야 하네요.
"View has requested that the system navigation be temporarily hidden. This is an even less obtrusive state than that called for by SYSTEM_UI_FLAG_LOW_PROFILE; on devices that draw essential navigation controls (Home, Back, and the like) on screen, SYSTEM_UI_FLAG_HIDE_NAVIGATION will cause those to disappear. This is useful (in conjunction with the FLAG_FULLSCREEN and FLAG_LAYOUT_IN_SCREEN window flags) for displaying content using every last pixel on the display. There is a limitation: because navigation controls are so important, the least user interaction will cause them to reappear immediately."
This flag will allow to take over the entire screen, unlike Honeycomb where there was always a navigation bar at the bottom with room for the Back, Home, and Recents button. Unfortunately it won't work for games because of the last sentence.
'Android > ApiDemo_Graphic' 카테고리의 다른 글
View PopupMenu (0) | 2012.12.29 |
---|
설정
트랙백
댓글
글
Size and Format
Launcher icons should be 32-bit PNGs with an alpha channel for transparency. The finished launcher icon dimensions corresponding to a given generalized screen density are shown in the table below.
Table 1. Summary of finished launcher icon dimensions for each generalized screen density.
ldpi (120 dpi)(Low density screen) | mdpi (160 dpi)(Medium density screen) | hdpi (240 dpi)(High density screen) | xhdpi (320 dpi)(Extra-high density screen) | |
---|---|---|---|---|
Launcher Icon Size | 36 x 36 px | 48 x 48 px | 72 x 72 px | 96 x 96 px |
You can also include a few pixels of padding in launcher icons to maintain a consistent visual weight with adjacent icons. For example, a 96 x 96 pixel xhdpi
launcher icon can contain a 88 x 88 pixel shape with 4 pixels on each side for padding. This padding can also be used to make room for a subtle drop shadow, which can help ensure that launcher icons are legible across on any background color.
http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html
'Android' 카테고리의 다른 글
FreezesText TextView나 EditText에 존재하는 기능 (0) | 2012.11.22 |
---|---|
TextView나 EditText에 존재하는 inputType에 대해서 (0) | 2012.11.22 |
게임 개발자를 위한 유튜브 세미나 자료 (0) | 2012.11.22 |
Using the new Build System (0) | 2012.11.19 |
세로 SeekBar 예제 소스 (0) | 2012.11.16 |
설정
트랙백
댓글
글
아직 정확히 어떤 기능을 하는지 확인되지 않고 있음
android:freezesText
If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. By default this is disabled; it can be useful when the contents of a text view is not stored in a persistent place such as a content provider.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form "@[package:]type:name
") or theme attribute (in the form "?[package:][type:]name
") containing a value of this type.
This corresponds to the global attribute resource symbol freezesText
.
Related Methods
'Android' 카테고리의 다른 글
런처 아이콘 사이즈 (0) | 2012.12.03 |
---|---|
TextView나 EditText에 존재하는 inputType에 대해서 (0) | 2012.11.22 |
게임 개발자를 위한 유튜브 세미나 자료 (0) | 2012.11.22 |
Using the new Build System (0) | 2012.11.19 |
세로 SeekBar 예제 소스 (0) | 2012.11.16 |
설정
트랙백
댓글
글
android:inputType
The type of data being placed in a text field, used to help an input method decide how to let the user enter text. The constants here correspond to those defined by InputType
. Generally you can select a single value, though some can be combined together as indicated. Setting this attribute to anything besides none also implies that the text is editable.
Must be one or more (separated by '|') of the following constant values.
Constant | Value | Description |
---|---|---|
none | 0x00000000 | There is no content type. The text is not editable. |
text | 0x00000001 | 멀티라인을 지원하지 않아서 키보드에서 Enter 키 입력이 무시된다. TYPE_CLASS_TEXT |TYPE_TEXT_VARIATION_NORMAL . |
textCapCharacters | 0x00001001 | Can be combined with text and its variations to request capitalization of all characters. Corresponds to TYPE_TEXT_FLAG_CAP_CHARACTERS . |
textCapWords | 0x00002001 | Can be combined with text and its variations to request capitalization of the first character of every word. Corresponds toTYPE_TEXT_FLAG_CAP_WORDS . |
textCapSentences | 0x00004001 | Can be combined with text and its variations to request capitalization of the first character of every sentence. Corresponds toTYPE_TEXT_FLAG_CAP_SENTENCES . |
textAutoCorrect | 0x00008001 | Can be combined with text and its variations to request auto-correction of text being input. Corresponds to TYPE_TEXT_FLAG_AUTO_CORRECT . |
textAutoComplete | 0x00010001 | Can be combined with text and its variations to specify that this field will be doing its own auto-completion and talking with the input method appropriately. Corresponds toTYPE_TEXT_FLAG_AUTO_COMPLETE . |
textMultiLine | 0x00020001 | 문자 입력시 멀티 라인입력이 가능하다. TYPE_TEXT_FLAG_MULTI_LINE . |
textImeMultiLine | 0x00040001 | Can be combined with text and its variations to indicate that though the regular text view should not be multiple lines, the IME should provide multiple lines if it can. Corresponds toTYPE_TEXT_FLAG_IME_MULTI_LINE . |
textNoSuggestions | 0x00080001 | Can be combined with text and its variations to indicate that the IME should not show any dictionary-based word suggestions. Corresponds to TYPE_TEXT_FLAG_NO_SUGGESTIONS . |
textUri | 0x00000011 | Text that will be used as a URI. Corresponds to TYPE_CLASS_TEXT |TYPE_TEXT_VARIATION_URI . |
textEmailAddress | 0x00000021 | Text that will be used as an e-mail address. Corresponds toTYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_ADDRESS . |
textEmailSubject | 0x00000031 | Text that is being supplied as the subject of an e-mail. Corresponds toTYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_EMAIL_SUBJECT . |
textShortMessage | 0x00000041 | Text that is the content of a short message. Corresponds toTYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_SHORT_MESSAGE . |
textLongMessage | 0x00000051 | Text that is the content of a long message. Corresponds toTYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_LONG_MESSAGE . |
textPersonName | 0x00000061 | Text that is the name of a person. Corresponds to TYPE_CLASS_TEXT |TYPE_TEXT_VARIATION_PERSON_NAME . |
textPostalAddress | 0x00000071 | Text that is being supplied as a postal mailing address. Corresponds toTYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_POSTAL_ADDRESS . |
textPassword | 0x00000081 | Text that is a password. Corresponds to TYPE_CLASS_TEXT |TYPE_TEXT_VARIATION_PASSWORD . |
textVisiblePassword | 0x00000091 | Text that is a password that should be visible. Corresponds toTYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_VISIBLE_PASSWORD . |
textWebEditText | 0x000000a1 | Text that is being supplied as text in a web form. Corresponds toTYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_WEB_EDIT_TEXT . |
textFilter | 0x000000b1 | Text that is filtering some other data. Corresponds toTYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_FILTER . |
textPhonetic | 0x000000c1 | Text that is for phonetic pronunciation, such as a phonetic name field in a contact entry. Corresponds to TYPE_CLASS_TEXT |TYPE_TEXT_VARIATION_PHONETIC . |
textWebEmailAddress | 0x000000d1 | Text that will be used as an e-mail address on a web form. Corresponds to TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS . |
textWebPassword | 0x000000e1 | Text that will be used as a password on a web form. Corresponds toTYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_WEB_PASSWORD . |
number | 0x00000002 | A numeric only field. Corresponds to TYPE_CLASS_NUMBER |TYPE_NUMBER_VARIATION_NORMAL . |
numberSigned | 0x00001002 | Can be combined with number and its other options to allow a signed number. Corresponds to TYPE_CLASS_NUMBER |TYPE_NUMBER_FLAG_SIGNED . |
numberDecimal | 0x00002002 | Can be combined with number and its other options to allow a decimal (fractional) number. Corresponds to TYPE_CLASS_NUMBER |TYPE_NUMBER_FLAG_DECIMAL . |
numberPassword | 0x00000012 | A numeric password field. Corresponds to TYPE_CLASS_NUMBER |TYPE_NUMBER_VARIATION_PASSWORD . |
phone | 0x00000003 | For entering a phone number. Corresponds to TYPE_CLASS_PHONE . |
datetime | 0x00000004 | For entering a date and time. Corresponds to TYPE_CLASS_DATETIME |TYPE_DATETIME_VARIATION_NORMAL . |
date | 0x00000014 | For entering a date. Corresponds to TYPE_CLASS_DATETIME |TYPE_DATETIME_VARIATION_DATE . |
time | 0x00000024 | For entering a time. Corresponds to TYPE_CLASS_DATETIME |TYPE_DATETIME_VARIATION_TIME . |
This corresponds to the global attribute resource symbol inputType
.
'Android' 카테고리의 다른 글
런처 아이콘 사이즈 (0) | 2012.12.03 |
---|---|
FreezesText TextView나 EditText에 존재하는 기능 (0) | 2012.11.22 |
게임 개발자를 위한 유튜브 세미나 자료 (0) | 2012.11.22 |
Using the new Build System (0) | 2012.11.19 |
세로 SeekBar 예제 소스 (0) | 2012.11.16 |
설정
트랙백
댓글
글
'Android' 카테고리의 다른 글
FreezesText TextView나 EditText에 존재하는 기능 (0) | 2012.11.22 |
---|---|
TextView나 EditText에 존재하는 inputType에 대해서 (0) | 2012.11.22 |
Using the new Build System (0) | 2012.11.19 |
세로 SeekBar 예제 소스 (0) | 2012.11.16 |
쓸만한 위젯 lib (0) | 2012.11.16 |
설정
트랙백
댓글
글
http://tools.android.com/tech-docs/new-build-system
We are working on a new build system to replace both the build system inside ADT and Ant.
Using the new Build System
If you are not familiar with Gradle, it is recommended to read at least the first few chapters ofhttp://gradle.org/docs/current/userguide/userguide_single.html The location of the SDK folder is still needed and is provided by one of the following methods:
Using the new Android plugin for GradleThe android plugin for gradle is available through Maven:
Requirements:
For library project, the plugin to apply is ‘android-library’ In the future we will investigate how to simplify this step. Basic Project SetupAll configuration related to the Android plugin is done inside the android namespace:
The most important setting is the build target (previously found in project.properties):
Changing the default configuration is done using the defaultConfig object:
Default Config can be configured with the following properties:
However, you can use these signing properties if you share a single debug keystore across developers. Build Types and Product FlavorsCreating new build types or editing the built-in debug and release is done with the buildTypes element. This configures the debug build type and adds another one called “staging”:
Build Types can be configured with the following properties:
} packageName = “com.example.myapp.free” minSdkVersion = 10 } paidapp { packageName = “com.example.myapp.paid” versionCode = 14 } } Flavors can be configured with the same properties as the default config. If both define a properties, then the flavor overrides the default config. Flavor GroupsUsing multi-flavor variants is done with the following two steps:
Other OptionsBuildConfigBuildConfig is a class that is generated automatically at build time.Similar to the old build system, the class is generated with a DEBUG boolean field. In this case it maps to the value ofBuildType.debuggable. On top of this you can now insert new items in the class. This is done by providing full Java lines. This is possible from the defaultConfig, any flavors, any build types. All lines are aggregated together in the same class for a given variant. For instance:
To provide options to aapt, the aaptOptions element is used. Right now two options are supported (more will come later):
As mentioned above, the plugin for library projects is android-library. It uses the same Maven artifact. Libraries don’t have flavors, and only two build types. They can be configured this way:
Using a library is done one of the following way:
Using a library through a repo is the same as a regular Java library, using the groupId, artifactId and version. Standard TasksJava projects built with Gradle use 4 main tasks:
For instance, a project with flavor1 and flavor2 and the two default build types will have the following 4 tasks:
Additionally, assemble tasks for test apps are created:
The check task is augmented similarly:
Checks are run by doing the following
Building an android application takes a lot of steps and each are available to be run on demand. Here’s a full list of tasks used to build an application:
Customizing the tasksGradle provides an API to query for tasks by name or by classes. The classes used by the Android tasks are the following:
In the future we intend to provide a custom API to access flavors, build types, and variants, as well as task inputs/output to do easier manipulation of the tasks. Working with and Customizing SourceSetsStarting with 0.2, the build system uses its own SourceSet objects intead of the ones provided by the Java plugin. You can use them to configure the location of all source elements as well as (in the case of the java source and resource folders) customize filters and exclusion. The default config creates two sourcesets: "main" and "test". All flavors and build types automatically create their own sourceset, named after the flavor/build type name. Additionally, all flavors create a corresponding test flavor named "test<Flavorname>" Default sourceset location is under src/<sourceset> Sourceset have the following properties:
as well as the normal java project sourceset properties:
AndroidSourceFile and AndroidSourceDirectory have a single configurable property, respectively srcFile andsrcDir. Example of reconfiguring the sourcesets to match an existing project structure:
For more information about working with Sourceset, see: http://gradle.org/docs/current/userguide/java_plugin.html#sec:source_sets Note that for Android projects, the sourceSets container must be modified inside the android container. |
'Android' 카테고리의 다른 글
TextView나 EditText에 존재하는 inputType에 대해서 (0) | 2012.11.22 |
---|---|
게임 개발자를 위한 유튜브 세미나 자료 (0) | 2012.11.22 |
세로 SeekBar 예제 소스 (0) | 2012.11.16 |
쓸만한 위젯 lib (0) | 2012.11.16 |
[책] 스마트폰과 태블릿 호환을 위한 안드로이드 앱 프로그래밍 (0) | 2012.09.16 |
설정
트랙백
댓글
글
세로 프로그래스바와 씨크바 예제이다.
[xml 구성시 주의 사항]
1. Thumb 이미지 보다 크게 layout_width 폭을 지정하면 프로그래스바 폭이 두껍게 된다.
2. 프로그래바 폭을 조절하려면 android:maxWidht에 값을 넣어 준다.
<com.tokaracamara.android.verticalslidevar.VerticalSeekBar
android:id="@+id/SeekBar02"
android:layout_width="56px"
android:layout_height="fill_parent"
android:maxWidth="10px"
android:progressDrawable="@drawable/progress_vertical"
android:thumb="@drawable/seek_thumb_wide" />
[샘플 소스]
아래 프로젝트에 AbsVerticalSeekBar파일의 한 곳이 오류가 잇어서 수정했다.
썸브 바운데리 설정시 LeftBounday가 -1로 되는 것을 방지했다. gap 부분
[참고 사이트]
http://code.google.com/p/trimirror-task/source/checkout
http://560b.sakura.ne.jp/android/VerticalSlidebarExample.zip
'Android' 카테고리의 다른 글
게임 개발자를 위한 유튜브 세미나 자료 (0) | 2012.11.22 |
---|---|
Using the new Build System (0) | 2012.11.19 |
쓸만한 위젯 lib (0) | 2012.11.16 |
[책] 스마트폰과 태블릿 호환을 위한 안드로이드 앱 프로그래밍 (0) | 2012.09.16 |
MIV에 대해서 (0) | 2011.07.21 |
설정
트랙백
댓글
글
http://d.hatena.ne.jp/thorikawa/20101130/p1
Android 응용 프로그램에서 사용할 수있는 편리한 UI 라이브러리









Android 애플 리케이션 말하면 UI 생명! 라는 것으로 괴짜 분들이 만들어지는 편리한 UI 라이브러리를 찾아낸 한 스크린 샷과 함께 정리해 있습니다 .
여러분 모두 소스와 일부 샘플 응용 프로그램을 게시되어 있으므로 당장이라도 시도 할 수 있습니다.
(작가 분들, 싣기로 문제가있는 것 같다면 수고 스럽겠지만 연락해주십시오)
Quick Action
- 공식 Twitter 어플 바람에 터치 한 부분에 풍선을 볼 수
- 레이아웃도 지정 가능
YAM의 잡기장 : Android Quick Action의 Android 라이브러리 프로젝트를 만들어 보았다
Drag and Drop ListView
사용자가 정렬 가능한 ListView를 조금 리치에 해 보았다 - 내일의 열쇠
Calendar
CalendarView 공개했습니다 - Kazzz의 일기
3D ListView
Android Tutorial : Making your own 3D list - Part 3 (final part) | Developer World
CoverFlow
Interfuser : Android Coverflow Widget V2
ChartLibrary
- 차트 라이브러리
- JFreeChart 를 Android 용으로 확장 한 것
- 막대 그래프 · 선 그래프 · 원 그래프 등 필요한 것 같은 것은 대략 구비되어있어 꽤 고기능
- LGPL 라이센스
afreechart - Project Hosting on Google Code
Zoomable ImageView
Android one finger zoom tutorial - Part 4 | Developer World
Drag and Drop ImageView
Android에서 드래그 앤 드롭 - hidecheck의 일기
NumberPicker
- 증가 · 감소의 간격을 조정 가능한 수치 피커
사용자 NumberPicker 만들기 - 냐ン다후루 일기
Color Picker
- 색상 선택기
- 이쪽은 구형
Android에서 색상 선택기를 만들자 - 내일의 열쇠
Color Picker ( 11 / 30 추가)
- 또 한번 더 색상 선택기
- 이쪽은 링 계
- @ yanzm 씨가 가르쳐 주셨습니다!
YAM의 잡기장 : Android ColorPickerDialog을 만든
Vertical Slider ( 11 / 30 추가)
- 세로 슬라이더
- @ yyaammaa 씨가 가르쳐 주셨습니다!
Vertical Seekbar - Android Developers | Google 그룹
그 밖에도
이런 편리한있어! 라고하는 것이 있으면 가르쳐주세요
'Android' 카테고리의 다른 글
Using the new Build System (0) | 2012.11.19 |
---|---|
세로 SeekBar 예제 소스 (0) | 2012.11.16 |
[책] 스마트폰과 태블릿 호환을 위한 안드로이드 앱 프로그래밍 (0) | 2012.09.16 |
MIV에 대해서 (0) | 2011.07.21 |
Application Class에 대해서 (0) | 2011.07.15 |
설정
트랙백
댓글
글
간단한 기술 서적을 읽고 내용을 공유합니다.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
제목: 스마트폰과 태블릿 호환을 위한 안드로이드 앱 프로그래밍
저자: 고강태
출판사: 한빛미디어
이 책은 eBook, Free DRM 형태로 발행된 책으로 아래 사이트에서 구입할 수 있다.
http://bit.ly/SQIFc6
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[도입 글]
최근 앱을 개발하면서 노이로제 처럼 다가오는 것이 멀티 해상도 지원이다.
그냥 480x800 해상도만 개발하고 앱을 출시하까해도 뭔가 캥기는 것이
최신 스마트폰들이 고행도를 지원하기 때문이다.
더욱이 구글에서 내놓은 넥서스 7과 같이 태블릿도 다양한 형태로 출시되고 있기에
멀티 해상도에 대한 지원을 간과할 수 없는 부분이 되고 있다.
그래서 개발 초기부터 멀티 해상도를 위한 레이아웃이나 이미지 컷을 준비하고
마지막에 레이아웃별로 포팅 작업을 하게된다...
이런 시점에 이 책은 한번 정도 주의 깊게 읽어볼 필요가 있다.
이런 멀티해상도와 태블릿용과 호환되는 앱을 개발하기 위해서 가추어야 할 것을 핵심만 요약해서 알려주기에 좋다.
1부에서는 스마트폰 앱과 태블릿 앱 개발의 차이점
2부에서는 태블릿 앱 개발을 위한 안드로이드 프로그래밍
3부에서는 스마트폰과 태블릿 호환 앱 개발
목차 내용을 보다시피, 내용이 상당히 깔끔하다.
역사, 필요성등 군더더기가 없이 필요한 내용을 바로 볼 수 있다.
이것은 한빛 미니어가 내 세우는 eBook에 특징이라고 한다.
500페이지의 내용 대신 핵심만 들어있는 100페이지의 책..
이런 점은 잘 선택한 편집 방향이라고 생각한다.
이 책은 스마트폰과 태블릿의 호환성 관점에서 글을 기록하지만,
최신 안드로이드 OS가 4.0으로 어찌보면 최신 OS가 요구하는 개발방식을
사용하는 안드로이드 개발을 소개한다고 봐도 될 듯하다.
그러면서 구형 OS에서 최신 기술을 적용하는 방법을 소개하는 것과 같은 개념으로
인식해도 되는 것이다.
[책을 구체적으로 들여다 보자]
책의 내용을 보려면 목차를 보는 것이 빠르다
목차는 다음과 같다.
1부 스마트폰 앱과 태블릿 앱 개발의 차이점
0 1 태블릿 앱 개발의 필요성 2
0 2 다양한 단말기에 호환 가능한 앱 개발 3
2.1 태블릿 앱 개발 시 고려할 사항 3
2.1.1 안드로이드가 지원하는 화면 크기 5
2.1.2 레이아웃 최적화를 위한 기본적인 프로그래밍 방법 6
2.1.3 설정 식별자를 이용한 레이아웃 최적화 7
2.1.4 앱이 지원할 화면 크기를 정확하게 manifest에 정의 9
2.2 화면호환 가이드 10
2.2.1 화면호환 모드 버전 11
2.2.2 화면호환 모드 사용 안 하기 12
2.2.3 화면호환 모드 사용하기 13
2.3 프래그먼트 가이드 14
2.3.1 프래그먼트 사용 시 주의사항 16
2.4 태블릿 레이아웃 가이드 17
2.4.1 새로운 크기 식별자 18
2.4.2 새로운 식별자 사용 예 19
2.4.3 화면 크기 선언 20
2부 태블릿 앱 개발을 위한 안드로이드 프로그래밍
0 3 태블릿 UI/UX의 특징 22
3.1.1 홀로그래픽 UI 22
3.1.2 기존 데스크톱 OS와 유사한 UX 24
3.1.3 편리한 입력 24
3.1.4 큰 화면에 적합한 레이아웃 25
0 4 태블릿 앱 프로그래밍 27
4.1 액티비티 27
4.2 액티비티 생명주기 32
4.3 프래그먼트 37
4.3.1 프래그먼트를 이용한 앱 개발 39
4.4 프래그먼트 동적 처리 45
4.4.1 main.xml 수정 45
4.4.2 분할된 프래그먼트를 하나로 전환 46
4.5 프래그먼트 생명주기 49
4.5.1 프래그먼트 생명주기 순환 49
4.6 프래그먼트 사이의 통신 58
4.6.1 Fragment2에 버튼 추가 58
4.6.2 Fragment2 클래스 수정 59
4.6.3 프래그먼트 동작 61
4.7 인터페이스를 통한 상호 통신 61
4.7.1 Fragment1에 인터페이스 선언 62
4.7.2 Fragment2 구현 65
4.7.3 HoneyActivity 수정 67
4.8 액션 바 69
4.8.1 액션 바 보이기/숨기기 69
4.8.2 액션 바에 액션 아이템 추가하기 72
4.8.3 액션 아이템과 앱 아이콘 수정 78
3부 스마트폰과 태블릿 호환 앱 개발
0 5 Support Library Package를 이용한 앱 개발 82
5.1.1 Android Support Library 사용 84
5.1.2 HoneyActivity 변경 89
5.1.3 Fragment1 변경 92
5.1.4 Fragment2 수정 94
0 6 멀티팬과 싱글팬을 이용한 앱 개발 99
6.1.1 레이아웃 재배치 100
6.1.2 Fragment2Activity 추가 104
6.1.3 Fragment2 클래스 수정 106
6.1.4 HoneyMessage 리스너 개선 108
책의 전체적인 흐름의 해상도 편화에 대한 대응을 위하여 필요한 내용을 여러 단계를 통해서 설명을 하게된다.
1. 레이아웃을 사용되는 속성값 들의 소개
- wrap_content, fill_parent,, match_parent, dp, sp
- 사이즈, 밀도, 해상도, 비율
- 프로젝트 res 폴더를 통해서 다양한 이미지 적재 방법
* 절대로 px과 같은 값을 레이아웃에 직접 정의하지 말것을 당부한다.
2. 메니페스트에 다양한 옵션들
- 화면모드
- support-screens, minSdk, TargetSdk
- 태블릿을 위한 새로운 식별자, sw<N>dp, w<N>dp, h<N>dp
4.Fragment
- 태블릿 또는 스마트폰에서 사용할 수 있는 프래그먼트 개발 방법 및 데이터 전송방법
액티비가 중계 역활을 하는 프레그먼트간의 통신 방식 (아래에 좀더 내용을 기록했다.)
- 스마트폰, 태블릿 구분이 최신 개발 기술이다.
5. 액션바
- 허니컴 이상에서 지원하는 액션바 개발 방법
- 액션바 꾸미기 등6. Support Library Package
- 절대적으로 중요한 부분으로 최신 OS기능 특히 프래그먼트를 구현 OS에서 사용할 때 필수적인 lib로
이것을 사용방법을 안내한다.
- 최신 기능을 모두 포함하는 것은 아니지만, 프래그먼트 등 주요한 것이 OS 구분없이 사용 가능하게 해준다.
7. 멀티팬 처리
- 화면을 분활해서 구성할 수 있다.
- 작은 화면과 큰화면에 대응이 용이하다.
[내용중에 기억할 사항들]
Fragment간에 통신 방식은 Activity가 중계해 주는 인테페이스 방식을 사용한다.
(4.7 인터페이스를 통한 상호 통신)
<pre class="brush: java">
Fragment1 fragment1;
Fragment2 fragment2;
…
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
fragment1 = (Fragment1)getFragmentManager()
.findFragmentById(R.id.fragment1);
fragment2 = (Fragment2)getFragmentManager()
.findFragmentById(R.id.fragment2);
fragment1.setHoneyListener(this);
fragment2..setHoneyListener(this);
}
@Override
public void sendMessage(CharSequence msg) {
fragment2.setMessage(msg);
}
@Override
public String getNextMessage() {
return null;
}
</pre>
2.3.1 프래그먼트 사용 시 주의사항
다음은 프래그먼트 사용 시 주의해야 할 사항들입니다.
● 프래그먼트 클래스를 XML에 지정하면 교체가 안 됩니다.
● 프래그먼트는 FrameLayout의 ID를 지정하고 FrameTransaction을 사용해서
add, replace해야 합니다.
● 프래그먼트 사이의 데이터 전송에는 매개변수로 번들Bundle 객체를 사용합니다.
● FragmentTransaction을 사용할 때 반드시 commit()을 사용해야 합니다.
● FragmentTransation을 사용해서 프래그먼트를 추가할 때 애니메이션은 add,
replace를 지정하기 이전에 선언해야 합니다.
● FragmentTransaction의 addToBackStack() 메소드를 지정하지 않으면, Back
CHAPTER 02 다양한 단말기에 호환 가능한 앱 개발 가이드 17
Key 사용 시 해당 액티비티가 종료됩니다.
● 프래그먼트 하나가 다른 프래그먼트를 직접 컨트롤하도록 구현해서는 안 됩니다.
● 프래그먼트 내용을 변경하는 코드는 모두 해당 프래그먼트 클래스 내에 있어야
합니다.
● 프래그먼트와 액티비티의 통신을 위해 프래그먼트에서 리스너 인터페이스를 제
공하고, 이것을 액티비티에서 구현해서 사용합니다.
● 프래그먼트를 내장하고 있는 액티비티와 콜백 인터페이스를 통해서 앱 내부의
프래그먼트와 통신합니다.
● 이벤트 발생 시 콜백 인터페이스를 통해 자신을 호스팅하는 엑티비티에 내용을
전달하도록 구현합니다.
이상으로 책의 내용을 간단히 기록해 보았다.
어찌보면 책의 내용을 모두 기록한 것이 아니니, 소개 내용 자체가 부족할 수 있겠지만,
책 차제에는 충분한 설명, 코드 예제, 설명에 해당하는 그림등 이해하는데 부족함 없이 내용이 들어 있다.
끝으로
이북이 장점이 Free PDF라서 DRM이 없기에, PC에서 스마트폰에서 넣고 다니면서 볼 수 있기에
매우 좋은 듯하다.
이렇게 eBook으로 소개되는 책이 점점 더 많이 늘어 나길 기대해 본다.
'Android' 카테고리의 다른 글
Using the new Build System (0) | 2012.11.19 |
---|---|
세로 SeekBar 예제 소스 (0) | 2012.11.16 |
쓸만한 위젯 lib (0) | 2012.11.16 |
MIV에 대해서 (0) | 2011.07.21 |
Application Class에 대해서 (0) | 2011.07.15 |
설정
트랙백
댓글
글
MIV는 Mobile In Vechicel의 약자로 자동차에 모발일 기술이 접목되어 자동차 상태 및 제어를 스마트폰에서 할 수 있도록 하는 기술이다.
'Android' 카테고리의 다른 글
Using the new Build System (0) | 2012.11.19 |
---|---|
세로 SeekBar 예제 소스 (0) | 2012.11.16 |
쓸만한 위젯 lib (0) | 2012.11.16 |
[책] 스마트폰과 태블릿 호환을 위한 안드로이드 앱 프로그래밍 (0) | 2012.09.16 |
Application Class에 대해서 (0) | 2011.07.15 |
설정
트랙백
댓글
글
- Application Class는 Context를 상속받는다.
- Application Class는 singletone 형태로 모든 컨포넌트와 클래스에서 접근이 용이하다.
- Application Class를 상속 받아서 정의하는 것과 사용이 매우 간단하다.
- 다른 SingleTone은 공통의 인스턴스로 사용하는 것을 보장하지 않는다.
- Process가 다르면 Application Class라 할지라도 다른 인스턴스를 갖게된다.
[생성]
Application Class를 상속 받아서 클래스를 만든다.
Class MyClass extended Applicaiton {
}
[정의]
androidmenifast.xml에 등록한다.
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:name=".MyClass"
>
----
[사용]
인스턴스를 확보해서 사용하면 된다.
MyClass ACN = (MyClass)getApplicationContext();
'Android' 카테고리의 다른 글
Using the new Build System (0) | 2012.11.19 |
---|---|
세로 SeekBar 예제 소스 (0) | 2012.11.16 |
쓸만한 위젯 lib (0) | 2012.11.16 |
[책] 스마트폰과 태블릿 호환을 위한 안드로이드 앱 프로그래밍 (0) | 2012.09.16 |
MIV에 대해서 (0) | 2011.07.21 |
RECENT COMMENT