목록전체 글 (1327)
오늘도 공부
출처 : http://old.wikidocs.net/mybook/6049 listView의 내용을 드래그 앤 드롭으로 순서를 변경하고 싶을 때 사용한다. 안드로이드 폰의 "Music" 앱의 playlist를 보면 아이템 드래그 앤 드롭이 가능하다는 것을 확인 할 수 있다. 다만 안드로이드 기본 API로 제공되지 않기 때문에 직접 구현해야만 한다. 드래그 앤 드롭이 적용된 ListView예제는 안드로이드 기본 앱인 Music에서도 확인 가능하며 필자가 만든 "마이투두" 앱에서도 확인이 가능하다. 다음은 안드로이드의 Music 앱의 소스를 참고하여 만든 DndListView이다. 아래의 코드를 사용하기 위해서는 안드로이드 버전 1.5 이상부터 가능하다. /* * Copyright (C) 2008 The An..
StateListDrawable drawables = new StateListDrawable(); drawables.addState(new int[]{-android.R.attr.state_checked, -android.R.attr.state_focused }, backgroundOff); drawables.addState(new int[]{android.R.attr.state_checked }, backgroundOn); drawables.addState(new int[]{android.R.attr.state_focused }, backgroundOn); setBackgroundDrawable(drawables); StateListDrawable을 어떤 뷰까지 쓸 수 있는지는 모르겠는데 일단 버튼류는..
SELECT * FROM sqlite_master
출처 : http://stackoverflow.com/questions/3438276/change-title-bar-text-in-android you can Change the Title of each screen (i.e. Activity) by setting their Android:label => Custom - Title - barBut if you want to Customize title-bar in your way, i.e. Want to put Image icon and custom-text, then following code is running for me: main.xml titlebar.xml TitleBar.javapublic class TitleBar extends Activi..
Fixed header in a TableLayout As the previous post this will also cover TableLayout. As with borders, there are no attribute for defining a TableRow as a header row. With header row I mean a row that will not scroll with the rest of the data in the TableLayout (providing you have declared the table to be inside a ScrollView). Well, there is actually a way to work around this using a separate Tab..
출처 : http://www.ibm.com/developerworks/xml/library/x-andbene1/index.html Mobile devices and platforms boast more features and functionality with each new release, and often mere months separate significant announcements from the leading mobile vendors. The headlines are mostly about UI features (such as advanced multitouch capabilities and Adobe® Flash® technology) and hardware enhancements (suc..
출처 : http://adsgear.tistory.com/49 HTTP GET try { HttpClient client = new DefaultHttpClient(); String getURL = "http://www.google.com"; HttpGet get = new HttpGet(getURL); HttpResponse responseGet = client.execute(get); HttpEntity resEntityGet = responseGet.getEntity(); if (resEntityGet != null) { //do something with the response Log.w("RESPONSE",EntityUtils.toString(resEntityGet)); } } catch (Ex..
* mysql server의 character set 변경하기 mysql이 설치된 경로에 path\my.ini default-character-set=latin1 => default-character-set=utf8 등등 latin1이라고 되어 있는 부분을 utf8로 변경하시고 Reboot ^^ database alter database [databasename] charset=utf8 table alter table [tablename] charset=utf8 column ALTER TABLE [tablename] CHANGE [exists_columnname] [new_columnname] VARCHAR(10) CHARACTER SET utf8 대략 이런 형식이네.. 설정확인 mysql> show v..
출처 : http://tigerwoods.tistory.com/23 안드로이드 Study 목차가기 1. ViewFlipper의 용도 ViewFlipper는 Tab과 마찬가지로 화면에 표시 가능한 여러 view가 준비되어 있을 때 화면에 현재 표시된 view를 다른 view로 전환하기 위해 사용된다. Tab은 일반적으로 표현하려는 view간의 구분(TabWidget의 이름으로) 이 필요할 때 사용되며, ViewFlipper는 view간의 구분이 필요 없을 경우 많이 사용된다. ViewFlipper의 사용 예로는 안드로이드 폰의 초기화면과 같은 경우가 있다. 예를 들면, 많은 어플리케이션을 인스톨한 유저는 사용하는 모든 어플리케이션에 대한 icon을 하나의 view에 표시할 수 없고, 여러 개의 view를 ..
xmlns:android="http://schemas.android.com/apk/res/android"> android:id="@android:id/background"> android:radius="5dip" /> android:startColor="#ff9d9e9d" android:centerColor="#ff5a5d5a" android:centerY="0.75" android:endColor="#ff747674" android:angle="270" /> android:id="@android:id/secondar..