URL url = new URL(_url);
URLConnection uc = url.openConnection();
uc.setConnectTimeout(CommonConstants.SOCKET_TIME_OUT);
uc.setReadTimeout(CommonConstants.SOCKET_TIME_OUT);

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(uc.getInputStream());

AND

twitter와 비슷하게 안드로이드에서 구현하려고 만든 샘플 프로그램

AysncTask 를 써서 구현했다.

근데 안비슷해 ㅜㅜ

AND


어플 개발하면서 페이지 로딩시 서버에 접속해서 데이터를 가져와 보여주는 경우
기다리라는 Process Dialog 를 보여준다.
생명주기에서 OnResume() 가 실행되고 나서야 View가 되기 때문에
초기화 작업 동안 보여주는 샘플 프로그램을 만들었다.

테스트 용으로 간단히 만든거라 프로젝트에 원하는대로 동작할지는 모르겠지만
암튼 우선은 완성?

AND

화면 바닥에 깔리는  툴바가 애니메이션후에 애니메이션 끝난 위치로 고정되게 하고 싶어
이리저리 검색과 테스트 결과

http://www.androidpub.com/361442 에서 고맙게도 글을 올려주신 분이 있어서

해결...

<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" 
    android:fillAfter="true">
    <translate android:fromYDelta="100" android:toYDelta="50"
        android:duration="500"  />
</set>

저 옵션만 주면 끝난다. 무한감사 ^^

출처 : 안드로이드펍 :  http://www.androidpub.com/361442  

AND




위의 그림에서 focus move 버튼을 click 마다 1->2->3->1 순서로
포커스를 이동해주고 싶어서 테스트 코딩을 했다.

--------------------------------------------------------------------------------
public final boolean requestFocus ()

Since: API Level 1

Call this to try to give focus to a specific view or to one of its descendants.
 A view will not actually take focus if it is not focusable (isFocusable()
returns false), or if it is focusable and it is not focusable in touch mode
(isFocusableInTouchMode()) while the device is in touch mode.
See also focusSearch(int), which is what you call to say that you
have focus, and you want your parent to look for the next one. This is
equivalent to calling requestFocus(int, Rect) with arguments
FOCUS_DOWN and null.

Returns
  • Whether this view or one of its descendants actually took focus.

-------------------------------------------------------------------------------
public final boolean requestFocusFromTouch ()

Since: API Level 1

Call this to try to give focus to a specific view or to one of its descendants.
This is a special variant of requestFocus() that will allow views that are
not focuable in touch mode to request focus when they are touched.

Returns
  • Whether this view or one of its descendants actually took focus.
See Also

 ----------------------------------------------------------------------------------------------------------------

EditText 에서는 위의 requestFocus로 실행시키면 포커스가 오고 button 같은 경우는 requestFocusFromTouch 로 하니 된다.

출처 : http://developer.android.com/reference/android/view/View.html#requestFocus()

 

AND


안드로이드를 사용하다보면 이미지를 보여할때 설치되 이미지를 볼 수 있는 뷰어가 한개 이상 설치되어 있다면
그 리스트를 보여준다. 전화걸기 화면을 보여주려면???

보여주고자 하는 Activity에 Intent-filter에 설정을 아래 처럼 해준다.

 <intent-filter>
               <action android:name="android.intent.action.VIEW" />
               <action android:name="android.intent.action.DIAL" />
               <category android:name="android.intent.category.DEFAULT" />
               <category android:name="android.intent.category.BROWSABLE" />
               <data android:scheme="tel" />             
            </intent-filter>

Activity에서 getData 해서 Uri를 String 로 보면 tel:000111222 이렇게 출력된다.


전화걸기 화면을 호출할때

 Intent callIntent = new Intent();
 callIntent.setAction(Intent.ACTION_VIEW);
 callIntent.setData(Uri.parse("tel:000111222"));
 startActivity(callIntent);  

이렇게 한다면 아래 filter설정만으로 호출이 되지만 보통 다른 사용자는 위의 여러 Action 호출하기 때문에
위의 것 처럼 설정하는게 좋을것 같다.

 <intent-filter>
               <action android:name="android.intent.action.VIEW" />
               <category android:name="android.intent.category.DEFAULT" />
               <data android:scheme="tel" />             
            </intent-filter>

AND



WVGA icon size : 72x72                    HVGA icon size : 48x48              QVGA icon size : 36x36
Pixel : 480 x 800                              Pixel : 320 x 480                       Pixel : 240 x 320
3.7in                                             3.2in                                      2.7in
densityDpi : 240                               densityDpi : 160                       densityDpi : 120



px
dp변환한다면 dp = px * 0.66625로 계산한다.(해상도480*800 기준)

DisplayMetrics displayMetrics = new DisplayMetrics();

((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);

WidthPixel = displayMetrics.widthPixels;

HeightPixel = displayMetrics.heightPixels;

pixel = dp * displayMetrics .density;



[출처]  안드로이드에서의 dp, dpi, px  | 작성자 너니나야 이야기
AND


 <receiver android:name="keyguardReceiver">
           <intent-filter>
             <action android:name="android.intent.action.USER_PRESENT" />
           </intent-filter>
    </receiver>

Sent when the user is present after device wakes up (e.g when the keyguard is gone).

This is a protected intent that can only be sent by the system.

키가드가 해제 되었을때 시스템에서 날려주는 action  다른 퍼미션은 필요없다.

AND


 <receiver android:name=".RegBroadcastRecevier"
    android:enabled="true"
    android:exported="false" >
 
           <intent-filter>
             <action android:name="android.intent.action.PACKAGE_CHANGED" />
             <action android:name="android.intent.action.PACKAGE_REMOVED" />
  <action android:name="android.intent.action.PACKAGE_ADDED" /> 
  <action android:name="android.intent.action.PACKAGE_INSTALL" />             
              <data android:scheme="package"  />
                     
   </intent-filter>
</receiver>
   
빨간색으로 설전돠 부분을 볼것 근대 Change는 안된다.
다시 문서를 봐야겠구나.
AND


<?xml version="1.0" encoding="utf-8"?>
<resources>
<plurals name="numberOfSongsAvailable">
<item quantity="one">One song found.</item>
<item quantity="other">%d songs found.</item>
</plurals>
</resources>


int count = getNumberOfsongsAvailable();
Resources res = getResources();
String songsFound = res.getQuantityString(R.plurals.numberOfSongsAvailable, count);

---------------------------------------------------------------------------------------------------

<string name="welcome_messages">Hello, %1$s! You have %2$d new messages.</string>
Resources res = getResources();
String text = String.format(res.getString(R.string.welcome_messages), username, mailCount);

<resources>
<string name="welcome_messages">Hello, %1$s! You have &lt;b>%2$d new messages&lt;/b>.</string>
</resources>
AND