background attribute 접근

Mobile Programming/Android Tip 2013. 9. 21. 21:55

이런식으로 attr에 접근이 가능하더라.


        android:background="?android:attr/selectableItemBackground"



Emulator 단축키

Mobile Programming/Android Tip 2012. 2. 17. 14:33

Emulator Keyboard Mapping

The table below summarizes the mappings between the emulator keys and and the keys of your keyboard.

Table 2. Emulator keyboard mapping

Emulated Device KeyKeyboard Key
Home HOME
Menu (left softkey) F2 or Page-up button
Star (right softkey) Shift-F2 or Page Down
Back ESC
Call/dial button F3
Hangup/end call button F4
Search F5
Power button F7
Audio volume up button KEYPAD_PLUS, Ctrl-5
Audio volume down button KEYPAD_MINUS, Ctrl-F6
Camera button Ctrl-KEYPAD_5, Ctrl-F3
Switch to previous layout orientation (for example, portrait, landscape) KEYPAD_7, Ctrl-F11
Switch to next layout orientation (for example, portrait, landscape) KEYPAD_9, Ctrl-F12
Toggle cell networking on/off F8
Toggle code profiling F9 (only with -trace startup option)
Toggle fullscreen mode Alt-Enter
Toggle trackball mode F6
Enter trackball mode temporarily (while key is pressed) Delete
DPad left/up/right/down KEYPAD_4/8/6/2
DPad center click KEYPAD_5
Onion alpha increase/decrease KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)

Android 개발 Tip - 13. HashMap Loop

Mobile Programming/Android Tip 2011. 11. 28. 22:24

HashMap 은 keySet 과 valueSet으로 이루어져있다 .
필자는 주로 키가 같은경우에 같은 객체를 수정해야할 때 이용하는 편이다 . 

각각의 아이템을 볼때는 키값으로 get해주면 되지만 ,  
해당 해쉬맵을 전체적으로 loop 체크 할때는 다음과 같은 방법을 이용한다.


Iterator iterator = map.keySet().iterator();
 while (iterator.hasNext()) {
          String key = (String) iterator.next();
          Item item = map.get(key);
          Log.d(TAG, "name " + item.name );
 }