목록Android/Tip&Tech (399)
올해는 머신러닝이다.
간단하게 2개를 돌려서 테스트해 본결과 별로 차이는 안 나지만(크게 안돌려서 그런듯) 하지만 확실하게 알수 있는 건 AsyncTask로 돌리는 게 확실히 부드럽고 성능이 좋은 것 같음.. 테스트 소스는 입니다요. 이제부턴 AsyncTask를 주로 이용해야 할듯^^
출처 : http://theeye.pe.kr/entry/downloading-remote-image-file-by-asynchronous-on-android 안드로이드에서 원격지에 이미지를 읽어오는 방식은 다양한 방식이 있습니다. 하지만 안드로이드 자체의 문제인지 3G환경 이하에서 이미지를 제대로 못 읽어오거나 현재의 동작에 영향을 주지 않는 별도의 쓰레드에서 동작하게 하는것은 쉽지 않습니다. 간단하게 사용할 수 있는 비동기 이미지 다운로더를 공개합니다. 구글 안드로이드 블로그에서 봤었던 다운로더에 제가 단순하게 만든 캐싱 기능을 추가하였습니다. ImageDownloader.java public class ImageDownloader { public static final int IMGAE_CACHE_L..
출처 : http://drcarter.tistory.com/97 이미지 효과로 이미지 크기의 절반을 반대 되는 이미지를 만들고, 그 반대된 이미지에 대해서는 반사 된 듯한 효과를 주는 소스 입니다. package com.android.reflection2; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.LinearGradient; import android.graphics.Matrix; import android.graphics.Paint; import android.grap..
private Bitmap overlayMark(Bitmap bmp1, Bitmap bmp2,int distanceLeft,int distanceTop) { Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth()+distanceLeft, bmp1.getHeight()+distanceLeft, bmp1.getConfig()); Canvas canvas = new Canvas(bmOverlay); canvas.drawBitmap(bmp1, distanceLeft, distanceTop, null); canvas.drawBitmap(bmp2, 0, 0, null); return bmOverlay;
출처 : http://trend21c.tistory.com/1046 안드로이드 2.2(프로요, froyo) 부터 모바일 웹에서 파일첨부가 가능하다는것 알고 계셨나요? http://blog.flickr.net/en/2010/09/23/new-browser-based-uploads-on-android-2-2/ http://blog.daum.net/ahahblog/13757408 특정 파일들에 한해서 안드로이드 2.2부터 모바일 브라우저를 통한 파일 업로드가 가능해졌습니다. 즉 을 지원하게 되었습니다. 개발자분들은 모바일을 위한 별다른 코드를 써야할 필요없이 기존 웹에서 업로드 기능 구현하던 그대로 구현하시면 됩니다. 이미 플리커부터 다음카페 등 속속 모바일 웹에서 파일 첨부를 기능을 포함한 사이트들이 늘어나..
article from : http://p-xr.com/android-tutorial-dynamicaly-load-more-items-to-the-listview-never-ending-list/ We pretty much all know the nice technique apps like GMail / Facebook use to dynamically load more items to the ListView then you scroll to the bottom. In this post i want to shed some light on how to make such a list ourselves! We can approach this from a few sides: The first option is ..
출처 : http://blog.sptechnolab.com/2011/03/09/android/android-upload-image-to-server/ Android: Upload image to Server Filed Under: Android by bhargav — 37 Comments March 9, 2011 [번역] Easy AdSense by Unreal I have searched lot on Internet that how to upload image from android device to server. As a result of that, I am posting this tutorial. At server side, I used PHP script. So, you need to learn ..
// VideoView에는 기본 버튼들이 정의되어 있어서 앞에 글에서처럼 // MediaPlayer을 이용해 만들었을 때 버튼을 만들고 정의하는 과정이 필요없다. // 하지만 VIdeoView로 객체를 만들어 동영상을 재생시키면 무슨 설정을 해도 전체화면으로 나오게 할 수 없다 // 때문에 VIdeoView를 상속받은 클래스를 만들어 사용해야 한다. // manifest에서 해당 activity에 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" // 옵션을 설정해도 해결되지 않아 만들게 되었다. class MyVideoView extends VideoView { public MyVideoView(Context context, AttributeS..
http://stackoverflow.com/questions/6520313/how-to-get-rtsp-links-android 에서 참조 package jp.ddo.gallop.android; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; import java.net.URLEncoder; import jp.ddo.gallop.android.youtube.*; import org.apache.http.HttpR..
package org.apache.android.media; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.webkit.URLUt..
출처 : http://croute.me/392 예전에 한번 버튼의 클릭이벤트에 대해서 고찰한적이 있었습니다. onClick()의 구현이 더 좋을까, OnClickListener 객체를 각각 생성해서 구현하는 것이 좋을까에 대한 내용이었습니다. 어쨋든 전 결론을 onClick()의 구현(implements)으로 내렸었죠. ( 버튼 클릭 이벤트 처리에 관한 고찰 : http://croute.me/326 ) 이번에는 저번과는 조금 다른 고찰입니다. 수많은 버튼을 사용해야 하는 경우, 하나씩 아이디를 onClick()에서 siwtch 문 안에 case로 정의내려 처리하기는 너무 곤욕이죠. 휴... 그래서 이런 방법을 생각해 보았습니다. 향상된 for문과 배열을 이용하는 방법. 접기 주의 깊게 향상된 반복문(En..
출처 : http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/ I have updated the quickaction implementation code so it can be used more efficient and the dialog will be automatically dismissed after pressing the action item. All the source codes now available via github so you can track the changes. Official Twitter application for Android has introduced new Android UI features a..
link from : http://www.siegmann.nl/epublib/android Android Epublib-core runs on Android. Reading, writing and manipulating epub files is fully supported. Requirements Slf4j-android. You can download this at http://www.slf4j.org/android/ Getting started Download epublib-core-latest.jar from https://github.com/downloads/psiegman/epublib/epublib-core-latest.jar Download slf4j-android Add both to yo..
http://dlucky.tistory.com/168
출처 : http://sankarganesh-info-exchange.blogspot.com/2011/04/dynamically-loading-datas-in-listview.html Dynamically Loading Data's (Adding Footer to ListView ) in ListView in Android Add a footer to List View and when the user clicks that Footer, you can show parse the next set of data and show it in the list. Step1: Create a Button Step2: Make it as Footer to the List View ListView myList; View ..
Monday, August 3, 2009 HTTP connection reuse in Android Alright, time for something new and hopefully useful, re-using HTTP connections in your application. I've yet to write an Android application that doesn't make any HTTP requests, and they tend to do it frequently. Since all of my applications are also heavily concurrent, passing around a default HttpClient instance will give you thread cont..
출처 : http://bluejames77.blog.me/80124862451 예전에 HttpClient을 쓴 법을 있는데.. 최신에 이것을 다시 쓸일이 있어 정리해봅니다. ^-^; 제가 짠 메소드인데 이것만 보면 아마 감이 딱 오시지 않을까 생각됩니다. private static String requestConvert ( String szFilePath, int nPageCount, String szThumbnailSize) { // 아래처럼 해서 넘길 값이 있다면 키와 밸류 형식으로 파라메타를 넘기게 됩니다 List qparams = new ArrayList(); qparams.add(new BasicNameValuePair("FilePath", szFilePath)); qparams.add(new ..
http://blog.naver.com/kippee/130068924726
private String writeXml(List messages){ XmlSerializer serializer = Xml.newSerializer(); StringWriter writer = new StringWriter(); try { serializer.setOutput(writer); serializer.startDocument("UTF-8", true); serializer.startTag("", "messages"); serializer.attribute("", "number", String.valueOf(messages.size())); for (Message msg: messages){ serializer.startTag("", "message"); serializer.attribute..
http://lomohome.com/316
출처 : http://bench87.tistory.com/38 외국사이트에서 퍼왔습니다. 스샷에 보이듯이 말풍선만 뛰울수 있습니다... 소스는 자꾸 안된다는 분이 많아서 제가 되도록 살짝 고쳤습니다.. Android MapView Balloons This project provides an easy way to annotate map overlay items with a simple information balloon when using the Android Maps external library (com.google.android.maps). It consists of BalloonOverlayView, a view representing the balloon that is displayed over ..
출처 : 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..