본문 바로가기

Android

Sticky broadcast intent 원문 : http://newbiehc.blogspot.kr/2011/03/sticky-intent-sticky-broadcast-intent.htmlSticky intent (또는 Sticky broadcast intent)Sticky intent 는 말 그대로 끈적끈적한 intent 를 말합니다. ^^; 끈적끈적해서 자신의 역할을 수행한 뒤에도 메모리에 딱 달라붙어서 사라지지 않고 남아있는 것이죠. 보통의 broadcast 된 intent는 자신과 관련된 모든 Broadcast receiver 를 거치고 나면 임무 완료되어 ‘즐거운 퇴근길에 올라’ 메모리 상에서 제거됩니다. 하지만 Sticky intent는 임무 완료 후에도 메모리에 남아 있는다는 사실! (정확하진 않지만 해당 event에 대한 다음 .. 더보기
Android uid 위치 (linux에서의 /etc/passwd 대신) /android/system/core/include/private/android_filesystem_config.h 45#define AID_ROOT 0 /* traditional unix root user */ 46 47#define AID_SYSTEM 1000 /* system server */ 48 49#define AID_RADIO 1001 /* telephony subsystem, RIL */ 50#define AID_BLUETOOTH 1002 /* bluetooth subsystem */ 51#define AID_GRAPHICS 1003 /* graphics devices */ 52#define AID_INPUT 1004 /* input devices */ 53#define AID_AUDIO .. 더보기
Intent 보내기 제한 (restriction) of Android /android/frameworks/base/core/res/AndroidManifest.xml 72 73 protected-broadcast 로 속성을 주면 system process 만 이 intent 를 보낼 수 있음 더보기
What is onPreExecute, doInBackground, onPostExecute 원문 : http://arabiannight.tistory.com/entry/%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9CAndroid-AsyncTask-%EC%82%AC%EC%9A%A9%EB%B2%95 안드로이드/Android AsyncTask 사용법 안드로이드 AsyncTask 사용법에 대해 알아 보겠습니다. 안드로이드에는 UI 를 총괄하는 메인Thread가 존재 한고 있는데요.([안드로이드/Android Android에서 Thread(쓰레드) 란 무엇 인가?]) 메인Thread 외에는 일반Thread들이 안드로이드 UI 화면을 처리할 수 없습니다. 그렇기 때문에 메인Thread와 일반Thread 를 잘 핸들링 해서 사용해야 하는데, 여간 번거로운 일이 아닙니다. .. 더보기
android adb 에서 sh : shell script file 이 실행 안될때 실행법 # sh ./sigquit.system_server.sh & or # /system/bin/sh ./sigquit.system_server.sh & 아래와 같이 error 가 날때는 root@gracelte:/data/local/tmp # sh ./sigquit.system_server.sh & [1] 13625'oot@gracelte:/data/local/tmp # ./sigquit.system_server.sh[3]: sleep: syntax error: Invalid argument '10.0./sigquit.system_server.sh[6]: syntax error: 'while' unmatched [1] + Done (1) sh ./sigquit.system_server.sh Ubunt.. 더보기
adb unauthorized issue 아래 이슈로 한동안 고생했었다. onegun@onegun-Samsung-Desktop-System:~/newHDD/temp/adb_key/android$ adb devicesList of devices attached ce05160541c33c3a01 unauthorized 증상은 adb shell 로 연결해도 계속 위와같이 나오면서 smartphone 에는 인증창이 안뜬다. 원인은 아래 있는 adbkey 파일이 없어서 RSA fail 이 나서 인증 진행이 안된 것임. # ls /root/.android/ -altotal 56drwxr-xr-x 5 root root 4096 7월 21 17:16 .drwx------ 10 root root 4096 10월 7 2015 ..-rw------- 1 root .. 더보기
com.android.internal ... com.android.internal.R resourcesOS 의 현재 resource 상태를 저장하고 있는듯. 얻어다 쓰는 방법http://mpigulski.blogspot.kr/2011/03/accessing-comandroidinternalr-resources.html 예) mUseUsbNotification = !massStorageSupported && mContext.getResources().getBoolean( com.android.internal.R.bool.config_usbChargingMessage); 아래와 같이 xml 로 item 이 지정되어 있고,그것을 get set 해서 쓰는듯 하다.base/core/res/res/values-watch/config.xml:56: falseb.. 더보기
registerReceiver private void setIntentFilter() { IntentFilter intentF = new IntentFilter(); intentF.addAction("android.net.conn.CONNECTIVITY_CHANGE"); intentF.addAction(Intent.ACTION_BATTERY_CHANGED); registerReceiver(BroadcastReceiver, intentF); // 리시버 등록} 하나 등록private static final String ACTION_OPEN_IN_APPS = "com.android.server.usb.ACTION_OPEN_IN_APPS"; final Receiver receiver = new Receiver(); context.regis.. 더보기
Android low memory killer disable 하기 출처 : http://varun-anand.com/mem_mgmt.htmlDISABLING ANDROID MEMORY MANAGEMENT SYSTEMLow memory killer was added as a kernel extension to the Android. The main source code is located at "/drivers/staging/android/lowmemorykiller.c". One of the interesting things to observe is the directory "staging" where the source code resides. Google added some of the kernel extensions such as wakelocks, lowmemk.. 더보기
linux 개발을 위한 source insight tab 설정하기 원문 : http://jaram.tistory.com/202 alt + t를 누름1. Tab width를 4 로 설정2. Expand tab을 enable로 설정3. Auto Indent는 취향에 맡게 simple에 체크 둘다 해주는거... tab --> space로 일괄 변경1. 소스 전체 선택2. alt+ e3. special --> tab --> space 누름 정해진 tab width만큼으로 모두 변경됨 내가 쓰는 simple 한 치환 방법 tab 을 복사한 후Ctrl+h 를 눌러서 치환 문자열에 복사한 tab 을 붙여넣기 하고대체 문자열에 스페이스 4번 입력후 all 더보기
Android init.rc 분석 기본 문법http://www.dreamy.pe.kr/zbxe/CodeClip/164851 설명http://egloos.zum.com/shadowxx/v/10770478http://blog.naver.com/PostView.nhn?blogId=multiedit&logNo=40147752143 예제http://forum.falinux.com/zbxe/index.php?mid=android&sort_index=readed_count&order_type=asc&document_srl=781528 class name 을 등록하고 아래와 같이 class 를 start stop 시킬 수 있다.즉, class_start 를 호출하면 해당 class name 을 등록한 모든 service 들이 시작된다.. 더보기
fstab & partition images type 의 emmc -> 는 row data 를 뜻함.즉, filesystem 없이 blk 단위로 read/write 하는 partition 임. # /dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc default recoveryonly/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc default recoveryonly/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 default recoveryonly/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 default wait,leng.. 더보기
Android log command, logwrapper 출처 : http://elinux.org/Android_Logging_System Android log message 를 만든다. log -p e -t onegun test message25402 01-08 09:27:26.210 15852 15852 E onegun : test message Process 가 출력하는 stdout 이나 stderr 즉, terminal 로 출력될 내용들을 android log 로 보내서 로깅되도록 한다. logwrapper -x ./test_program_name -testprogram_argstag : binarypriority : LOG_INFO 더보기
logcat 사용법 정리 [adb] logcat [] ... [] ... The following table describes the logcat command line options: -c Clears (flushes) the entire log and exits. 전체로그를 삭제하고 빠져나옵니다. -d Dumps the log to the screen and exits. 저장된 로그를 화면에 출력하고 종료한다. -f Writes log message output to . The default is stdout. -g Prints the size of the specified log buffer and exits. 로그버퍼의 사이즈를 출력 -n Sets the maximum number of rotated logs to . T.. 더보기
ubuntu / windows PC 와 android phone 간 file explorer 파일 관리 - QtADB Ubuntu / windows PC 와 Android 간에 adb interface 를 이용해서 파일을 탐색기 형태로 자유롭게 전송하는 프로그램이다.개발 및 test 에 아주 용이하다. 다운로드 경로https://qtadb.wordpress.com/download/ 아래 apk file 을 Android Phone 에 설치한 후 실행한다.이후 start service 버튼을 눌러준다.아래 프로그램을 Ubuntu 에서 실행 한후, 첫 화면에서 adb 가 설치되어 있는 path 의 경로를 지정해 준다. 이후 아래와 같이 창이 뜨면서 file 을 주고 받을 수 있다. 더보기
Android platform open source 배포(공개) 사이트 정리 - samsung galaxy 시리즈의 platform 소스 코드 배포 사이트http://opensource.samsung.com/ 더보기
e2fsprogs arm cross-compile for android e2fsprogs 의 filefrag Tool 을 arm 에서 사용하기 위해 build 시도. 0. 소스코드 다운로드 http://sourceforge.net/projects/e2fsprogs/?source=dlp 1. arm build toolchain 경로를 path 에 추가.이건 .configure 에서 CC 로 지정한 build tool 을 direct 로 호출해 버리기 때문임.export PATH=/home/onegun/2_hdisk/storage/utils_ubuntu/build_toolchains/MOST-build-toolchain/arm-2009q1/bin/:$PATH 2. ./configure 로 make 파일 생성./configure --target=arm-linux --host=ar.. 더보기
use fallocate in Android system Android 4.4 기준으로 /system/lib/libc.so에는 fallocate funcation 을 지원하지 않는다. 여타 다른 gcc build 환경을 사용했을때는 모르지만,(arm-2009q1 build 환경을 사용한 app 은 fallocate 함수를 사용하는데 문제가 없었다.)Android 자체 build system 을 사용할때는 fallocate 함수를 사용할 수 없다. 이 문제를 해결하기 위해/proc/kallsyms 를 확인한 결과kernel 은 sys_fallocate 를 지원하는 것으로 보인다. 따라서 아래와 같이 direct 로 system call 을 호출하였다. #define FALLOC_FL_KEEP_SIZE 0x01return syscall(__NR_fallocate,.. 더보기
gdb 로 Android nexus5 debugging 하기 - GDB server 를 사용해야 하는 이유.: Android local 에서 gdb 를 직접 실행하면 필요한 symbol 정보 매칭이 안되어서 attach 한 process 가 SIGV error 를 내면서 종료가 됩니다. - cross compile 로 arm 용 gdb / gdb server 구하기 http://searchme.tistory.com/37 ※ 이 디버깅 방법에서 gdb 는 사용하지 않습니다. - adb push 로 PC에서 Android device 에 gdbserver 다운로드 하기 # adb push ./gdbserver /data/local/tmp/ - arm-gnu-eabi toolchain 받기git clone https://android.googlesource.com/pl.. 더보기
Get(다운로드) android L-preview source code. 구글이 android L-preview 에 대한 source code branch 를 공개하였습니다.이 포스팅에서는 L-preview 를 포함한 google android source code 다운받는 법을 한글로 간단히 기술하겠습니다. 다만, 아직 L-preview 의 source code 는 완전하지 않은것으로 보입니다.구글이 공개한 Nexus5 의 바이너리에서는 SQLite 가 3.7.14 버전이었던데 비해아직 git 에서 받은 소스코드에는 이전 버전인 3.7.11 이 올라와 있습니다. https://android.googlesource.com/platform/manifest 사이트에 접속하면 많은 브랜치 명들을 볼 수 있습니다. 왼쪽에 more 를 누르고 나오는 branch 명 중에서 원하는 것을.. 더보기
Install android L preview on Nexus 5, step by step Go to below site.아래 사이트에 들어갑니다. http://developer.android.com/preview/setup-sdk.html Click the Download link of Nexus5 and download binary.Nexus 5 의 Download link 를 눌러서 바이너리를 다운받습니다. un-compress the tgz file.tgz 파일의 압축을 해제 합니다. tar zxvf hammerhead-lpv79-preview-ac1d8a8e.tgz Press volume down and power key same time and go to download mode.Nexus 를 volume down 과 power key 를 눌러서 download mode 로 진입 합.. 더보기
[linux platform] LD_PRELOAD 를 이용한 android 에서의 library 교체 library 를 수정하는 개발을 할때,매번 package 로 묶어서 전체 이미지를 다운로드 하는것은 많은 시간을 소모하게 한다. 아래 방법을 사용하면, 내가 build 한 library 만 바꾸면서system reboot 이나 전체 image download 없이 디버깅을 할때 아주 유용한 방법이다. adb shell 에서 다음과 같이 입력하면,원래 설치되어 있는 library 파일이 아닌, 내가 지정한 library 파일을 load 해서 실행된다. - LD_PRELOAD 의 입력방법1. 모든 프로그램이 내가 만든 library 를 사용하기 원할때..LD_PRELOAD = "preload 되기 원하는 so 파일 경로" 2. 특정 프로그램만 내가 만든 library 를 사용하기 원할때..LD_PRELOA.. 더보기
android 와 기기간 파일을 자유롭고 빠르게 공유하자. Send Anywhere 라는 프로그램 입니다.근래에 폰 to 폰 혹은 폰 to PC 공유 어플중 가장 좋네요. 완전 신세계 입니다. 사용법은 파일을 보내면 일련의 숫자를 보내주는데,웹이나 App 에서 그 숫자를 누르면 자동으로 전송하게 되어 있습니다. 웹 사이트는 아래 주소 입니다.https://send-anywhere.com/ 더보기
Android Terminal Emulator 을 이용한 linux kernel debugging 기법 오늘은 Android Terminal Emulator App 을 소개하고자 한다. linux kernel 개발을 할때 간혹 디버깅 용도로 sysfs 를 쓰는 경우가 있다. usb 도 연결 안되서 adb shell 도 못쓰고,무언가 kernel 과 간접적으로 read / write 를 할때 이러한 방법을 사용하고 하는데,이때마다 App 을 만들어서 경로와 write data 를 변경하는 것은 매우 번거로운 짓이다. 이때 해당 App 을 이용해서, 화면에서 직접 terminal 을 접근해서 재어 할 수 있다. 단, control 하려는 sysfs node 는 미리 chmod 로 권한을 풀어두는 것이 좋을 것이다. App 은 일단 link 한다. http://www.appsapk.com/android-term.. 더보기