목록IT (1349)
오늘도 공부
출처 : http://www.dingpong.net/tt/277 안드로이드의 EditText에 포커스가 가게 되면 기본적으로 폰에서 설정한 기본 언어에 대한 키보드로 노출이 됩니다. 그런데 ID 값과 같은 것을 입력 받아야 하는 EditText와 같은 경우에는 처음에 영문 키보드가 나오도록 하고 싶은 경우가 있을 수 있습니다. 그럴 경우 아래와 같은 라인을 추가하면 영문 키보드가 바로 나오도록 할 수 있습니다. android:inputType="textVisiblePassword" EditText의 XML에 위 라인을 추가하면 됩니다. 이것은 EditText에 password 모드를 설정하면 키보드가 영문으로 띄워지는 것을 생각해서 구현한 방법입니다. 검색을 해보면 privateOption 같은 것을 조..
출처 : http://www.mtalking.com/?p=403안드로이드 device 에서 3G나 WIFI 연결 정보를 알아볼때 사용 우선 AndroidManifest.xml에 " android.permission.ACCESS_NETWORK_STATE " permission이 필요하다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ConnectivityManager cManager; NetworkInfo mobile; NetworkInfo wifi; cManager=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); mobile = cManager.getNetworkInfo(ConnectivityManager.TY..
출처 : http://blog.tacticalnuclearstrike.com/2010/01/using-multipartentity-in-android-applications/ Using MultipartEntity in Android applications Posted on 2010/01/13 by Fredrik To be able to upload files from an Android application and use the Multipart content type you need to add some additional jar files to your application. The files needed are apache-mime4j, httpclient, httpcore and httpmime..
출처 : http://www.softwarepassion.com/android-series-get-post-and-multipart-post-requests/ Today I will describe shortly how to execute http GET and POST request on Android platform. The code is very simple and straightforward, for post request with attachement, you would have to add apache-mime4j-0.6.jar and httpmime-4.0.1.jar to your build path. HTTP GET try { HttpClient client = new DefaultHttp..
출처 : http://blog.daum.net/haha25/5387297
안드로이드 공부하시는 분들은 자신이 만든 어플리케이션이 멋지게 작동하는걸 원하실 겁니다. 그중에하나가 에니메이션이죠. 그런데 에니메이션 하면 보통 ViewFlipper 를 많이들 생각하실겁니다. 하지만 ViewFlipper는 뷰를 컨트롤하는거지 Activity간의 에니메이션을 컨트롤하지는 않습니다. 그래서 있는것이 overridePendingTransition 입니다. 사용 예) overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out); 인텐트로 넘어갈때 써주시면 됩니다. 다만 아셔야 할것이 있습니다. 이것은 안드로이드 버전과 관련이있더군요. 제가 1.5로 어플을 만드는데 처음에 이걸썻다가 오작동 혹은 오류가 뜨길래 잘못된 정보인줄 알..
http://www.anddev.org/tutorial_change_look_of_checkbox-t4553.html
File: res/layout/main.xml File: res/layout/item.xml File: res/drawable/item_selector.xml File: res/values/colors.xml #ff00 #f0f0 #f00f #ffff #f000 [출처] ListView 에서 아이템 클릭시 주황색 화면 변경하는 예제 (Jin 프로젝트) |작성자 심대
출처 : http://www.shop-wiz.com/document/android/google_map_example1 [설명] - GPS를 이용한 내위치값 받기 DDMS > Emulator Control > Location Controls > Manual(원하는 좌표값 입력후 "Send") manifest xml : 확인 이번에도 먼저 전체 소스를 보여 드리겠습니다. [설명] AndroidManifest.xml ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [설명] res/layout/main.xml ? 1 2 3 4 5 6 7 8 9 10 [설명] res/values/strings.xml ? 1 2 3 4 5 6 7 8 9 10 Hello World, Proj..
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..
* 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..