본문 바로가기

프로그래밍/Android55

eclipse Colors and Fonts 설정하기 .java 파일 Window - Preferences - General - Appearance - Colors and Fonts - Java Editor Text Font - Edit누르고 원하는 설정하기 .xml 파일 Window - Preferences - General - Appearance - Colors and Fonts - Basic - Text Font - Edit 누르고 원하는 설정하기 Tip. 한글 잘보이게 하기(공통사항) eclipse를 처음 설치하면 한글이 작아서 잘 안보인다. 이럴 때 Edit누른 후 스크립트 항목에서 '영어'말고 다른 것으로 바꿔주고 Apply하면 굳이 전체크기를 키울 필요 없이 한글만 잘보인다. 2014. 1. 19.
Android 해상도 얻어오기(Width, Height) API13부터 deprecated된 내용Activity를 상속받았을 때...Display display = getWindowManager().getDefaultDisplay(); int width = display.getWidth();int height = display.getHeight(); Activity를 상속받지 않았을 때 Context를 이용해서...WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);Display display = windowManager.getDefaultDisplay();int width = display.getWidth();int height = displ.. 2014. 1. 16.
ImageView 여백 없애기 ImageView imageView = (ImageView) findViewById(R.id....); imageView.setAdjustViewBounds(true); // 여백 없애기 끝. 2013. 6. 8.
SQLite select, insert, update, delete 1. select SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder(); queryBuilder.setTables("table_name"); Cursor cursor = queryBuilder.query(db, null, null, null, null, null, null); // public Cursor query (String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit) : table 질의를 수행할 테이블 이름 - columns : 자료를 받아올 필드. null을 입력.. 2013. 5. 23.
ListView의 ListItem Touch 막기 ListView를 사용시,public class ListAdapter extends BaseAdapter { private LayoutInflater mInflater; public ListAdapter(Context context) { mInflater = LayoutInflater.from(context); }... (중략) @Override public View getView(int position, View convertView, ViewGroup parent) { int resource = R.layout.list_item; convertView = (LinearLayout) mInflater.inflate(resource, null); convertView.setOnTouchListener(n.. 2013. 5. 22.