목록Android/Tip&Tech (399)
올해는 머신러닝이다.
dev.paran.com/
출처 : http://cafe.naver.com/ccjmaster.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=1158& 오늘은 반복되는 배경 이미지를 만들어 보겠습니다. 간단히 말해, 이런 간단한 이미지를 가지고 패턴이 반복되는 배경을 만드는 것입니다. 생각보다 간단합니다. 보시다시피 Main Class에는 손 댈 일이 없습니다. 먼저, drawable 폴더에 xml을 하나 만들어주시구요, pattern에 사용할 이미지도 넣어주셔야겠죠? 자, 이제 background.xml을 열고 다음과 같이 작성합니다. bitmap 속성을 주셔야하는데, 이것을 대문자로 주시면 적용되지 않습니다. 마찬가지로 @drawable/pattern, 이렇게 반복시켜 줄 이미지를 선택하신 다음..
출처 : http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/ Separating Lists with Headers in Android 0.9 Monday August 18, 2008 at 4:42 PM Earlier today the latest Android 0.9 SDK was released, and it’s packed full of wonderful changes. As you play around, you might see ListViews split into sections using separating headers. (Example shown on the right is the browser se..
Anyone that is in need of it .. attached here is the Motorola Atrix4G addon for the Android SDK .. also the instructions for installation and execution. http://www.mediafire.com/?73hkz09wr0l1kqe Installing and Using Motorola SDK Add-ons A Motorola SDK add-on, when added to the Android™ SDK, allows you to run and debug your applications on an emulated Motorola handset. Note that while the device ..
제작하는 한 어플리케이션에 버튼은 총 몇개나 등장할까요? 버튼의 이벤트를 등록하려면 또 똑같은 코딩을 몇번을 해야 할 지 모릅니다. 그래서 준비한 강쉪의 특별 소스. '모든 뷰를 등록하자'입니다. Android SDK는 java코딩만으로도 충분히 xml의 역할을 대신 할 수 있지만, 바로 눈으로 보이는 구조와 편리함, 연동성을 생각한다면 불가피하게 xml을 사용 할 수 밖에 없습니다. Android SDK가 1.0부터 발전을 거듭해와 현재 나온 2.2 버전까지 달라진 메소드는 없지만 사라지거나 새로 생긴것들이 많습니다. 이번 주제와도 비슷한 예를 들자면 xml의 버튼에 라고 사용하신다면 java에선 public void ClickHandler(View target){ Intent i = new Inten..
width height w/h % 대표기종 320 480 66.67% 아이폰3Gs, Android G1 640 960 66.67% 아이폰4 ==========================================================아이폰 480 800 60.00% 갤럭시S, 넥서스원, Desire 480 854 56.21% 모토로이 540 960 56.25% 아트릭스 ==========================================================안드로이드 3.0 1280 720 ... 이후 넥서스프리미엄 출시이후(예정) ==========================================================안드로이드 4.0
출처 : http://blog.naver.com/vortex2s?Redirect=Log&logNo=10102806271 안드로이드를 개발하다보면 Dialog같은 메시지 창을 자주 쓰게 되는데 기본으로 주어지는 것은 AlertDialog와 Toast밖에는....ㅠㅠ AlertDialog는 이쁘지 않고 몬가 불만족스럽고 Toast는 간단한 메시지를 띄워서 보여주기 좋은데..이것도 마찬가지로..ㅠㅠ불만이 많다.. 개발을 하다보면 나만의 메시지창을 만들어 보고 싶다는 생각을 하게 되는데 그럴때를 위해 Popup View로 이쁘게 만들면^^나만의 메시지창을 띄울수 있다. 예제 소스와 간단한 주석으로 나만의 Popup View를 만들어 보자. 먼저 PopView를 생성하도록하자. public class PopVie..
This is way i used and its working fine too. Hope, this would help somebody. Thanks.
안드로이드 작업을 하다보면 메니페스트 파일에 넣어야하는 User-permission 을 잊거나 생각이 안날경우가 있따. 그래서 일단 적어 놓는다. 밑에 추가할것 ㅋ //위치정보 확인함 //위치정보 확인함 //wifi 연결을 확인함 //wifi 체인지를 확인함 //네트웍이 연결된것을 확인할수 있게함 //부팅완료를 확인할수있게함 // 인터넷을 사용함 // 외장메모리 사용 //녹음이 가능하게 함 ACCESS_CHECKIN_PROPERTIES 체크인데이터베이스의_속성테이블로_액세스 ACCESS_COARSE_LOCATION 코스_로케이션_액세스_(Cell-ID/WiFi) ACCESS_FINE_LOCATION 파인로케이션_액세스(GPS) ACCESS_LOCATION_EXTRA_COMMANDS 로케이션_옵션_커맨드_..
루팅폰에 system/sd 폴더는 퍼미션이 r/w로 되어있다는 것에 착안 거기에 파일을 생성하고 생성이 제대로 되면 루팅폰이라는걸 판단하는 코드 Process p; try { // Preform su to get root privledges p = Runtime.getRuntime().exec("su"); // Attempt to write a file to a root-only DataOutputStream os = new DataOutputStream(p.getOutputStream()); os.writeBytes("echo \"Do I have root?\" >/system/sd/temporary.txt\n"); // Close the terminal os.writeBytes("exit\n"); o..
private Uri imageUri; public void takePhoto(View view) { Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); File photo = new File(Environment.getExternalStorageDirectory(), "Pic.jpg"); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo)); imageUri = Uri.fromFile(photo); startActivityForResult(intent, TAKE_PICTURE); } @Override public void onActivityResult(int requestCode,..
Look at my answer here for widgets/app. You can use shapecount.xml res/layout/tabicon.xml
출처 : http://blog.naver.com/kippee?Redirect=Log&logNo=130058382142 일반적으로 Java에서 하는 방법과 동일하게 SAX 에서 제시하는 절차를 적용하면 된다 실제 Android에서 적용한 사례를 보면 해당 Site(http://www.google.com/base/feeds) 에 질의할 Query를 조립하고 public ReviewFetcher(String loc, String description, String rat, int start, int numResults) { Log.v(Constants.LOGTAG, " " + ReviewFetcher.CLASSTAG + " location = " + loc + " rating = " + rat + " star..
출처 : 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..
출처 : 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..
출처 : http://fanpro.springnote.com/pages/5306953 xml에 color설정하는 법http://developer.android.com/intl/fr/guide/topics/resources/available-resources.html res/values/colors.xml이라는 파일을 만들고 아래와 같이 지정하면 된다. #77000000 #00000000 이렇게 지정한 color는 android:textColor="@color/dim" 과 같은 식으로 사용이 가능하다. xml에 color state list 설정하는 법http://androidappdocs-staging.appspot.com/reference/android/content/res/ColorStateList...
테이블 결합 함수 데이터 베이스 2009/12/03 13:24 http://blog.naver.com/findaday/94643786 1. 내부 조인(INNER JOIN) 내부조인 (Inneer Join) 은 단순히 연결만 한 개념이 아니라 결과값이 일치하는 것만 join을 한 것이다. 기준이 되는 테이블과 일치하는 값만 join 하여 return 한다고 생각을 하면 된다. 2. 전체외부조인 (FULL JOIN) 오른쪽 외부조인과 왼쪽 외부조인을 합친 개념이다. 왼쪽/오른쪽 테이블의 값이 일치하든 일치 하지 않든 모두 가져오는 조인이다. 다만 Cross join 과 다른 점은 Full join 은 빈 값을 null 로 리턴한다는 것이고 Crosss join 은 양쪽 테이블을 그냥 단순히 연결시켜 준다는 ..
http://tigerwoods.tistory.com/12 안드로이드 Study 목차가기 이번에는 위젯들을 화면에 배치 하는데 필요한 container에 관한 내용입니다. 다음과 같이 3부분으로 나누어서 포스팅 하려고 합니다. Part 1. LinearLayout Part 2. RelativeLayout Part 3. TableLayout + ScrollView 그중 Part 3. TableLayout에 대한 정리 입니다. 3. TableLayout (Grid Model) TableLayout 컨테이너는 HTML과 같이 방식으로 쓰인다. 즉, 위젯을 테이블에 배치하고, 테이블의 행과 열의 간격을 조정하여 위젯의 크기를 결정하는 방식이다. Table 구성하기 TableLayout은 TableRow와 같이 ..
GridView의 background에 white color를 설정 하면 흰색의 테두리가 나타난다. 이것은 list selector에 padding이 지정되어 있어서 나타나는 문제인데 단순히 Padding 같은 layout조정으로는 해결이 되지 않는다. 해결을 하기위해서는 GridView의 속성 중에서 listSelector를 수정해야 한다. GridView는 AbsListVIew를 상속받게 되어 있는데 AbsListView에 기본으로 지정되어 있는 listSeletor에 padding이 들어가 있어서 GridView에 여백이 생기게 된다. GridView에 여백을 없에기 위해서는 GridView에 listSelector속성에 padding을 제거한 selector를 지정하면 됩니다. 위의 소스를 lis..
안드로이드 디바이스의 경우 크게 3가지의 해상도 범주를 가지고 있는데, LDPI(저해상도), MDPI(중해상도), HDPI(고해상도)입니다. Density값은 LDPI가 120, MDPI가 160, HDPI가 240입니다. (각각 인치당 픽셀수를 이야기합니다.) 아래 표 (Table.1)를 참고하시면 결국 현재 디자인 하신 그림 파일의 기준은 HDPI를 기준으로 되어있는 것이고, LDPI를 위해서는 당연히 120/240 = 1/2, MDPI를 위해서는 당연히 160/240 = 3/4로 길이당 픽셀수가 감소하는 셈입니다. 모든 해상도를 지원하시려면 하나의 그림 파일을 HDPI, MDPI, LDPI에 맞춰서 3개로 만들어서 개발자에게 넘기시면 됩니다. Table 1. Screen sizes and densi..
출처 : http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange Application Resources >Handling Runtime Changes In this document Retaining an Object During a Configuration Change Handling the Configuration Change Yourself See also Providing Resources Accessing Resources Faster Screen Orientation Change Some device configurations can change during runtime (such as ..
http://blog.daum.net/hopefullife/98
Android... 멈추지 않는 변화 [Intro] SDK 1.5 R1 버전이 발표된지 꽤 오래전 일입니다만, 무슨 바람이 들었는지 몰라도 재빨리 바뀐 부분을 캐치했어야 하는데 그러지 못했습니다. 이제서야 부랴부랴 Android Development Tool도 뭔가 바뀌어 버린것을 알았고, SDK들도 뭔가 바뀌어 버린 것을 알았습니다. 이전에 만들어 두었던 프로젝트들도 1.5버전에 맞추어서 실행 하려던 찰나... 아차! 이게 뭡니까... AbsoluteLayout is deprecated 아... 이렇게 허망하게 없애 버리다니... 없애는게 이해가 안가는것은 아닙니다. 디바이스마다 화면이 다르니 절대 좌표로 박으면 호환성 유지가 안되는건... 뭐 충분히 생각 할 수 있는 부분입니다. 그냥 이번에 1.5버..