목록Android (496)
오늘도 공부
In this post I’ll show how you can take a screenshot of your current Activity and save the resulting image on /sdcard. The idea behind taking a screenshot actually is pretty simple: what we need to do is to get a reference of the root view and generate a bitmap copy of this view. Considering that we want to take the screenshot when a button is clicked, the code will look like this: findViewById(..
를 코드로 구현하기 StateListDrawable states = new StateListDrawable(); states.addState(new int[] {android.R.attr.state_pressed}, getResources().getDrawable(R.drawable.pressed)); states.addState(new int[] {android.R.attr.state_focused}, getResources().getDrawable(R.drawable.focused)); states.addState(new int[] { }, getResources().getDrawable(R.drawable.normal)); imageView.setImageDrawable(states);[출처] XM..
1. 환경설정 개요 (Preferences) 안드로이드 플랫폼은 Data를 저장하는 방법으로 환경설정(이하 Preferences), 파일, Local DB, 네트워크를 제공한다. 그 중 Preferences는 가장 간단하게 정보를 저장하는 방법(mechanism)을 제공하며, App이나 그 컴포넌트 (Activity, Service 등)의 환경 설정 정보를 저장/복원하는 용도로 사용된다. ▌Preferences의 형태▐ 안드로이드에서 Preferences는 ListView의 형태로 표현되며 쉬운 Preferences의 구현을 위해 PreferenceActivity 클래스를 제공한다. PreferenceActivity 클래스는 XML 기반의 Preference 정의 문서를 통해 App 파일 저장소에 Pre..
어디서 주은 PPT인데 나름 괜찮은 설명들이 있긴 하다.
출처 : http://blog.daum.net/maleny/89 최근에 인터넷을 배회하다가 저가의 타블렛 PC 하나를 발견하고 앱 개발 테스트용으로 사용하고 다니면서 E-BOOK 이나 읽을 용도로 구입했다. 자체 데이터 통신 기능도 없고 전화기능도 없고 당연히 DMB도 안되고 GPS 도 안되지만 KT 의 Egg 를 들고 다니니까 Wi-Fi 를 이용한 웹 서핑 등 여러가지 필요는 충족 시킬 수 있을 것이라 판단했다. 일단 인터넷 연결을 통한 여러가지 필요한 작업은 만족 스러웠고 AlphaBiz 의 Mobile Client 역활도 잘 수행한다. 다만 스마트폰의 사이즈에 맞게 앱을 만들엇기에 큰 기기에서는 화면이 영 개판 오분.. 하긴 이 타블렛을 산 이유도 이 개판 오분전을 잡기 위해서 이었지만. 문제는 이..
출처 : http://blog.rochdev.com/2011/05/update-ui-when-holding-button.html#!/2011/05/update-ui-when-holding-button.html I got this question recently so thought I would share one of the solutions. What we want is simply to update the user interface when holding down a button. The code should be pretty self-explanatory. The first thing we do is to create a custom button and override events. Then in t..
import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.util.Config; import android.util.TypedValue; import android.view.Display; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.KeyEvent; import android.widget.Button; import android.widget.TextView; public class Calculator extends Activity { EventListene..
App Widget 이란 Home Screen에 노출되는 miniature Application입니다. 보통 시계 어플등이 Widget 형태로 존재 하게 됩니다. App Widget을 구현에 필요 한것들 A. 꼭 필요 한것들 1. AppWidgetProviderInfo object - App Widget을 위한 MetaData, update frequecy 나 layout에 대한 정의. - XML 에 정의 되어야함. 2. AppWidgetProvider - Programming Interface - AppWidget이 Update/Enabled/Disabled/Delete되었을때, BroadCast를 받는 Receiver역할을 한다. 3. View Layout - AppWidget Design , And..
public static void showAsPopup(Activity activity) { //To show activity as dialog and dim the background, you need to declare android:theme="@style/PopupTheme" on for the chosen activity on the manifest activity.requestWindowFeature(Window.FEATURE_ACTION_BAR); activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND, WindowManager.LayoutParams.FLAG_DIM_BEHIND); LayoutParams params..
내부적으로 android:id를 이용을 하고 있어서 따로 커스트마이징을 해서 지정을 해줘야함..귀찮음.. package com.example.setupproject; import android.content.Context; import android.preference.SwitchPreference; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.Checkable; import android.widget.CompoundButton; import android.widget.Switch; public class MySwitchWidget extends S..
출처 : http://lsit81.tistory.com/33 며칠전 BitmapFactory.Options.inPurgeable에 대한 내용을 올렸는데요. BitmapFactory.Options에 대한 정리가 필요할 것 같아 주요 옵션에 대하여 정리를 해보았습니다. 1. Image Width, Height 정보만 가져오기. : BitmapFactory.Options.inJustDecodeBounds = true 이렇게 사용할 경우 Image를 메모리로 로드하지 않은 상태로 Image의 width, height 정보만을 가져올 수 있습니다. ? 1 2 3 4 5 6 BitmapFactory.Options opts = new BitmapFactory.Options(); opts.inJustDecodeBoun..
출처 : http://givenjazz.tistory.com/53 클래스파일: Create9Patch.class 안드로이드는 해상도가 다르다고 해도 같은 화면으로 보여주기 위해 이미지를 늘려주는 나인패치라는 포맷을 사용합니다. 주로 draw9patch라는 툴을 사용합니다만 이걸 만드는 작업이 여간 귀찮은 게 아닙니다. 9패치 만드는 게 너무 귀찮아서 간단히 만들었는데 생각보다 쓸만해서 공개합니다. 그냥 상하좌우 5픽셀 떨어진 곳부터 5픽셀짜리 나인패치를 그려주는 게 전부입니다. 그럼 어떻게 되느냐? 예제를 보면 더 이해가 빠르실 겁니다. 5픽셀짜리 영역을 만들면 위처럼 5픽을 자동으로 지정만 해줘도 그라데이션이 들어가 있는 버튼도 생각보다 깔끔하게 확대가 됩니다. 사용법은 이 글에 첨부된 Create9P..
퍼옴 : http://blog.naver.com/PostView.nhn?blogId=nimbusob&logNo=147715066&parentCategoryNo=&categoryNo=&viewDate=&isShowPopularPosts=false&from=postView 앞선 포스트 Android 개발가이드 - Bitmap.recycle()은 가급적 호출해 주는 편이 좋다. 에서는 명시적인 오브젝트 해제의 필요성을 알아보았다. VM 을 사용하는 언어에서 코딩함에도, c 스타일의 리소스 해제를 왜 해주어야 하는지에 대한 내용이었다. (안드로이드 프레임웍의 문제 및 특수성, 한정적인 VM Heap size 와 같은 이유 등) 그러나 안드로이드의 내부 동작으로 인해 Bitmap.recycle() 과는 별개로 v..
하나의 앱으로 여러 해상도를 지원하고자 할 때 이클립스에서의 layout, drawable 폴더 명을 달리 해줄 필요가 있다. 갤럭시S drawable-hdpi layout-hdpi 갤럭시S2 drawable-xhdpi-1280x720 layout-xhdpi-1280x720 갤럭시 노트 drawable-xhdpi-1280x800 layout-xhdpi-1280x800 갤럭시탭 10.1 drawable-xlarge-mdpi layout-xlarge-mdpi [출처] [Android 개발] Eclipse의 해상도별 layout, drawable 폴더 만들기(갤럭시 노트, 갤럭시 S2, 갤럭시S, 갤럭시 탭, 옵티머스 시리즈)|작성자 konori
이원희 maestro.wh@gmail.com, 변광민 yelllo wsun@gmail.com, 신정수 hello_mile2@ naver.com|삼성전자 소프트웨어 멤버십 정회원이며 현재 S펜 SDK를 사용한 프로젝트를 진행하고 있다. 안드로이드 플랫폼뿐만 아니라 모바일 생태계, 소프트웨어 엔지니어링, 병렬처리, 신호처리, 자연어 처리 등 다양한 분야에 관심을 가지고 관련 분야를 연구하고 있는 학생들이다. 2011년 11월 국내 출시된 갤럭시 노트는 출시 7개월이 지난 지금까지도 돌풍을 일으키고 있다. 특히 5.3인치의 큰 화면과 사용자의 필기압력을 256단계로 인식하는 노트 그리고 S펜만의 강점은 안드로이드 애플리케이션 개발자들에게 새로운 도전 기회를 부여하고 있다. S펜 SDK 문서 클래스 구조도 현재..
출처 : http://blog.naver.com/tyboss/70038694288 1. 첫번째 방법 2. 두번째 방법 3. 세번째 방법 (한파일에 기본 페이지와 엑셀 다운로드 설정할때) 4. 네번째 방법 (한글 제목에 브라우저별 처리) titleName = "한글제목"; titleName = new String(titleName.getBytes("KSC5601"), "8859_1"); if(clientBrowser.indexOf("MSIE 5.5")>-1 || clientBrowser.indexOf("MSIE 6.0") > -1 ){ response.setHeader("Content-Type", "doesn/matter;"); response.setHeader("Content-Disposition", "..
출처 : http://spoqa.github.com/2012/07/23/android-open-library.html 안드로이드 오픈 라이브러리 akaz안드로이드 개발을 하면서 곧바로 적용할만한 라이브러리들이 무엇이 있을지 항상 궁금했었는데, 이번 기회에 조사를 해 보았습니다. 앞으로 소개할 라이브러리가 조금이라도 프로젝트에 도움이 되었으면 합니다.Actionbar Sherlock 구글은 허니콤 이후부터 기존의 타이틀바를 대체한 액션바를 이용하도록 권고하였습니다만 프로요나 진저브레드같은 허니콤 이전의 플랫폼에서는 액션 바를 사용할 수 있는 방법이 없었습니다. 그렇지만 액션바 셜록을 이용하면 그 이전 버전의 안드로이드에서도 액션바를 사용할 수 있습니다. 또한 ICS스타일의 UI컴포넌트들도 제공하므로 ICS..
public int measureCellWidth( Context context, View cell ) { // We need a fake parent FrameLayout buffer = new FrameLayout( context ); android.widget.AbsListView.LayoutParams layoutParams = new android.widget.AbsListView.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); buffer.addView( cell, layoutParams); cell.forceLayout(); cell.measure(1000, 1000); int width = cell.getMeasure..
출처 : http://blog.daum.net/mailss/19 *ADT 17 버전 부터는 라이브러리 파일을 프로젝트 내 libs 폴더에 넣어야 제대로 인식한다. 빌드패스를 따로 잡아주지 않아도 자동으로 인식한다. 샘플 소스는 libs 폴더에 넣지 않았기 때문에 ADT 17버전에서는 실행시 Exception이 발생한다. libs 폴더로 jar 파일을 이동시키고 빌드패스를 수정하면 된다. 지난번 ViewPager에 대해서 간단한 예제를 만들어봤다. 이번에는 ViewPager에서 사용하는 다른 Adapter 및 다른 기능에 대해서 조금 설명하고자 한다. 1. Fragment를 사용하는adapterFragment는 Android 3.0 (허니콤)부터 추가된 기능이다. Fragment를 잘 모르시는 분이라면 조..
출처 : http://blog.naver.com/PostView.nhn?blogId=huewu&logNo=110116958816 Horizontal View Swiping with ViewPager[이 포스트는 Rich “geekyouup” Hyndman 에 의해 작성되었습니다. 인생을 조금 쉽게 만들기 위하여 노력하는 사람이지요. — Tim Bray] 여러분이 이제 막 안드로이드 어플리케이션 개발을 시작한 개발자이건, 능숙한 베테랑이건 상관 없이, 수평으로 스크롤 되는 View 를 만들 경우가 있습니다. 이미 많은 안드로이드 어플리케이션들이 이 기능을 활용하고 있습니다. 예를 들어 새로운 안드로이드 마켓 어플리케이션이나, 구글 닥스, 구글+ 등이 그렇지요. ViewPager 는 이런 기능을 구현하기 위..
출처 : http://marakana.com/s/android_fragments_tutorial,1250/index.html Overview Android runs on variety of devices, from phones with small screen sizes, to tablets and large-screen TV sets. Fragments in a nutshell represent a smaller part of a user interface that could take a whole screen, or be part of a larger UI. By creating and using fragments, your app can adapt to a variety of devices and s..
홈페이지 제작과 XE를 처음 접하는 초보님들을 위한 강좌를 소개합니다.조금만 시간을 투자하면 멋진 홈피를 갖게될 것이라고 확신합니다. 1. 제로보드 xe 공식매뉴얼입니다http://www.xpressengine.com/manual http://xe.xpressengine.net/?mid=wiki&act=dispWikiTreeIndex(구 매뉴얼) http://xe.xpressengine.net/?mid=wiki&act=dispWikiTitleIndex(구 매뉴얼) http://www.xpressengine.com/?_filter=search&vid=&mid=tip&category=&search_keyword=%EB%A7%A4%EB%89%B4%EC%96%BC&search_target=title(구 매뉴얼)..
The below snippet helps to implement three level list in android. First Group --Sub Group --- Child1 --- Child 2 --- Child 3 in this pattern..... main.xml: Home.java package com.threeelevellist.activities; import android.app.Activity;import android.content.Context;import android.graphics.Color;import android.os.Bundle;import android.view.View;import android.view.ViewGroup;import android.widget.B..
############################################################### contents = myDB.repWord(contents, "&", "&amt;"); contents = myDB.repWord(contents, "", ">"); contents = myDB.repWord(contents, " ", " "); contents = myDB.repWord(contents, "\"", """); contents = myDB.repWord(contents, "\n", " "); ############################################################### public String repWord(String b..
http://psdreview.com/best-free-android-icon-sets-for-developers-and-designers/
출처 : http://aroundck.tistory.com/732 http://developer.android.com/guide/topics/ui/actionbar.html - ActionBar는 Android 3.0 ( API Level 11 ) 부터 도입된 녀석. - ActionBar 의 주된 목적은. 1. Action bar 는 Application 이름, User 위치 표시. 2. 일관된 navigation 이나 view 의 갱신 등에 사용한다. 3. user 가 자주 쓰는 action 을 만들어 제공한다. - ActionBar 는 API Level 11 미만인 녀석과 호환이 안 되기 때문에, 하위호환성을 위해서는 ActionBar 를 Activity 의 Layout 에 정의하는 것이 좋다. - ..
http://blog.naver.com/PostView.nhn?blogId=ho_c&logNo=80113944196
출처 : http://cuteelfluv.cafe24.com/xe/index.php?mid=etc&page=2&document_srl=11846 SoftReference 를 이용한 Object Cache 활용하기 2011.12.19 14:34:03 0 Comments 1494 Readed 정말 좋은 자료라 퍼왔습니다. 이미지 캐싱에는 정말 많은 문제가 있는데 SoftReference 를 활용한 방법도 좋은 해결책이 될 것 같습니다. ============================================================================================================================== 저는 자바로 어플리케이션 개발을 시작한지 이제 일..
Android HttpClient GET, POST example HttpClient / Android 2 2012/02/29 07:37 http://blog.naver.com/cwisky/80154344088 res/layout/httpclientdemo.xml http://서버 IP:8888/WebApp/serverProc.jsp package android.test.app; import java.net.URI; import java.util.*; import org.apache.http.*; import org.apache.http.client.*; import org.apache.http.client.entity.*; import org.apache.http.client.methods.*; imp..
##sequence 사용 #Oracle CREATE SEQUENCE orders_seq START WITH 1000 INCREMENT BY 1 NOCACHE NOCYCLE; ##AutoIncrement 사용 #Mysql : auto_increment CREATE TABLE animals ( id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (id) ) #Mssql : identity create table test( no int identity(1,1) NOT NULL, name varchar(256) NULL ) #Informix : serial create table t ( id serial, image clob ) p..