안드로이드 개발 질문/답변
(글 수 45,052)
로그를 보면 어플 구동시간이 386ms 가 걸렸는데
다른 어플이 비해서 어플 구동 중간에 너무 잡다한것이 많이 뜨는거같은데요
이거 어플 구동시간 단축하는 방법 없나요 ?
02-16 21:20:35.102: INFO/ActivityManager(2448): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp= bnds=[125,234][235,372] }
02-16 21:20:35.180: INFO/Launcher(2739): onPause()
02-16 21:20:35.219: INFO/ActivityManager(2448): Start proc pid=28828 uid=10024 gids={1015, 3003}
02-16 21:20:35.282: WARN/Resources(2448): Converting to boolean: TypedValue{t=0x3/d=0xd8c "res/anim/accelerate_decelerate_interpolator.xml" a=2 r=0x10a0004}
02-16 21:20:35.282: WARN/Resources(2448): Converting to boolean: TypedValue{t=0x3/d=0xd8c "res/anim/accelerate_decelerate_interpolator.xml" a=2 r=0x10a0004}
02-16 21:20:35.298: INFO/Launcher(2739): onWindowFocusChanged(false)
02-16 21:20:35.341: INFO/global(2448): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.
02-16 21:20:35.403: INFO/global(2448): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.
02-16 21:20:35.450: WARN/Settings(28828): Setting android_id has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
02-16 21:20:35.454: WARN/Settings(28828): Setting android_id has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
02-16 21:20:35.458: ERROR/AndroidRuntime(28828): TimezoneGetter.getId() null
02-16 21:20:35.462: WARN/Settings(28828): Setting android_id has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
02-16 21:20:35.462: WARN/Settings(28828): Setting android_id has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
02-16 21:20:35.481: DEBUG/skia(28828): purging 15K from font cache [1 entries]
02-16 21:20:35.485: DEBUG/SKIA_FONT(28828): stored typeface in slot 0
02-16 21:20:35.485: DEBUG/SKIA_FONT(28828): SKIA_FONT fontfile: /data/data/com.android.settings/app_fonts/default/DroidSans.ttf
02-16 21:20:35.489: DEBUG/SKIA_FONT(28828): SKIA_FONT fontfile: /data/data/com.android.settings/app_fonts/default/DroidSans.ttf
02-16 21:20:35.489: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Sans, style = 0, uniqueID = 13
02-16 21:20:35.489: DEBUG/SKIA_FONT(28828): SKIA_FONT fontfile: /data/data/com.android.settings/app_fonts/default/DroidSans-Bold.ttf
02-16 21:20:35.489: DEBUG/SKIA_FONT(28828): SKIA_FONT fontfile: /data/data/com.android.settings/app_fonts/default/DroidSans-Bold.ttf
02-16 21:20:35.489: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Sans, style = 1, uniqueID = 14
02-16 21:20:35.489: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Serif, style = 0, uniqueID = 15
02-16 21:20:35.493: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Serif, style = 1, uniqueID = 16
02-16 21:20:35.493: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Serif, style = 2, uniqueID = 17
02-16 21:20:35.497: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Serif, style = 3, uniqueID = 18
02-16 21:20:35.497: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Sans Mono, style = 0, uniqueID = 19
02-16 21:20:35.497: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Sans Arabic, style = 0, uniqueID = 20
02-16 21:20:35.497: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Sans Hebrew, style = 0, uniqueID = 21
02-16 21:20:35.497: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Sans Thai, style = 0, uniqueID = 22
02-16 21:20:35.497: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Sans, style = 0, uniqueID = 23
02-16 21:20:35.501: DEBUG/SKIA_FONT(28828): load_system_fonts(), name = Droid Sans Fallback, style = 0, uniqueID = 24
02-16 21:20:35.501: DEBUG/SKIA_FONT(28828): load_system_fonts(), oldSansUID = 1, newSansUID = 13
02-16 21:20:35.501: DEBUG/SKIA_FONT(28828): load_system_fonts(), oldSansBoldUID = 2, newSansBoldUID = 14
02-16 21:20:35.551: ERROR/Activity(28828): HTTP failed : 200 0 java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
02-16 21:20:35.598: INFO/ActivityManager(2448): Displayed activity 386 ms (total 386 ms)
2011.02.16 23:27:15
BufferedInputStream 쪽에서 시간이 좀 걸린 것 같은데, 혹시 asset에서 파일을 읽어 오는 건가요?
asset에 있는 파일들은 zip으로 압축 된 apk파일에서 읽어 오는 것이기 때문에, 파일 하나씩 접근하면 접근할 때마다 시간이 좀 걸립니다.
속도가 느리거나 I/O쪽에 병목이 있는 일부 폰들에서는 더 심하고요. 몇가지 방법이 있겠지만, 그냥 최초 실행시에만 app data 영역에 기록 한 뒤에, 이걸 읽어오는 게 낫습니다.
그리고 경우에 따라 다르겠지만, 이 파일들을 아예 압축률0의 zip으로 묶어서 asset에 놨다가 압축을 푸는 게 더 빠를 수도 있습니다. (그만큼 파일 접근 시간이 오래 걸립니다.)



