옛글/안드로이드 프로그래밍

    Android dpi Icon size (해상도 별 아이콘 사이즈)

    drawable-hdpi 72 * 72 drawable-ldpi 32 * 32 drawable-mdpi 48 * 48 drawable-xhdpi 96 * 96 drawable-xxhdpi 144 * 144

    Android set immersive mode

    public void setImmersiveMode(Window window) { window.getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); }

    Android get system default date format

    TextView textDate = new TextView(context); java.text.DateFormat df = DateFormat.getLongDateFormat(context); textDate.setText(df.format(new Date())); // Long format DateFormat.getLongDateFormat(context); // Default format DateFormat.getDateFormat(context); DateFormat.getMediumDateFormat(context); // Get Time format java.text.DateFormat.getTimeInstance().format(new Date());

    Android Readability API Goose Example

    /*-- AsyncTask --*/ private class GooseAsyncTask extends AsyncTask {@Override protected Void doInBackground(String... params) { String url = "https://medium.com/p/68aec3c94c3a"; Configuration config = new Configuration(); config.setLocalStoragePath(getApplicationContext().getCacheDir().getPath()); config.setEnableImageFetching(false); //Fetch image file Goose goose = new Goose(config); Article a..

    안드로이드 네비게이션 Back And Up (로고 클릭 시 부모액티비티로 이동)

    안드로이드 4.4 부터 위쪽의 로고를 클릭하면 상위 액티비티로 이동하게 됩니다. 이 부분에 대해서는 외국 자료를 찾아보아도, android.R.home ICON 클릭 시 finish()를 한다는 의견이 많습니다. 하지만 이건 올바르지 않습니다. 디자인 가이드에 따르면 이 부분을 정식명칙으로 'Back and up'이라고 부르며, 구글 플레이에서 확인 하시면 단순히 Back 버튼이 아닌, 논리 구조 상 상위 액티비티로 이동한다는 것을 알 수 있습니다. 이 부분을 쌩으로 코드로 짜시는 분도 계시는데, 안드로이드 에서 굉장히 잘 지원을 해주고 있습니다. 방법은, 로고에 '

    자바/안드로이드에서 정확한 변수의 이름!

    http://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.htmlhttp://leepoint.net/notes-java/data/variables/45local-inst-class.htmlInstance Variables (Non-Static Fields) Technically speaking, objects store their individual states in "non-static fields", that is, fields declared without thestatic keyword. Non-static fields are also known as instance variables because their values are uni..

    Why use fragment static constructor?

    http://stackoverflow.com/questions/14654766/creating-a-fragment-constructor-vs-newinstancehttp://stackoverflow.com/questions/12062946/why-do-i-want-to-avoid-non-default-constructors-in-fragments 대부분의 구글 예제 들이 static을 통한 newInstance()를 사용했다. 이 것은 'Factory method pattern' 과 관련이 있다. http://en.wikipedia.org/wiki/Factory_method_pattern static 을 사용하지 않으면, 안드로이드 Lint 가 발생한다. @SuppressLint("ValidFragmen..

    Eclipse clean and running in mac

    In terminal, go to path, eclipse/Eclipse.app/Contents/MacOs ./eclipse -clean