목록Android (496)
오늘도 공부
출처 : 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버..
출처 : http://stackoverflow.com/questions/3693234/custom-imageview-with-drop-shadow Custom ImageView with drop shadow up vote3down votefavorite 6 Okay, I've been reading and searching around, and am now banging my head against the wall trying to figure this out. Here's what I have so far: package com.pockdroid.sandbox; import android.content.Context; import android.graphics.Canvas; import android...
http://stackoverflow.com/questions/3748568/how-can-i-launch-androids-email-activity-with-an-attachment-attached-in-the-emai http://stackoverflow.com/questions/2264622/android-multiple-email-attachment-using-intent-question http://blog.blackmoonit.com/2010/02/filebrowser-send-receive-intents.html public static void email(Context context, String emailTo, String emailCC, String subject, String emai..
출처 : http://sdw8001.tistory.com/5 리소스에서 bitmap을 읽어오고 화면에 출력한 후 touch를 이용해서 drag하는 예제 package com.jjihun.bitmaptest; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Rect; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.View;..
C2DM과 Notification 사용시 막히는 부분이 있어서 이렇게 질문 드립니다. 01.public class C2dm_BroadcastReceiver extends BroadcastReceiver { // -------- 1번 02. 03.NotificationManager mNotiManager; 04.public static String registration_id = null; 05.static String c2dm_name = ""; 06.static String c2dm_msg = ""; 07. 08. 09.public void onReceive(Context context, Intent intent) { 10. 11.mNotiManager = (NotificationManager)getS..
출처 : http://www.ibm.com/developerworks/opensource/library/x-android/index.html Working with XML on Android Build Java applications for mobile devices Michael Galpin, Software architect, eBay Michael Galpin is an architect at eBay. He is a frequent contributor to developerWorks and has also written for TheServerSide.com and the Java Developer's Journal, as well as his own blog. He has been progra..
출처 : http://www.cyworld.com/prizm0911/3284619 아래 xml파일을 res/values 에 생성. 1.-------------------------------------------------------------------------------------------- color.xml #959ca4 #646d79 #959ca4 #646d79 #686e77 #40474f #00000000 2.-------------------------------------------------------------------------------------------- 아래 xml파일을 res 에 해당 drawable 에 생성. 여기서는 위 1 번에서 설정된 색을 가져와서 셋팅하게됩니다...