Android 채팅 소스 02

Programming/Android 2013. 8. 20. 17:45 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

package com.tistory.tansanc.Test130805;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends Activity {
	String msg;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	public void mOnClick(View v) {
		EditText editText1 = (EditText) findViewById(R.id.editText1);
		msg = editText1.getText().toString();
		MessageSendThread mst = new MessageSendThread();
		mst.start();
	}

	class MessageSendThread extends Thread {
		public void run() {
			Socket socket = null;
			PrintWriter out = null;
			BufferedReader in = null;

			try {
				socket = new Socket("115.20.247.141", 2013);
				out = new PrintWriter(socket.getOutputStream(), true);
				in = new BufferedReader(new InputStreamReader(
						socket.getInputStream()));

				out.println(msg);
				String receiveString = in.readLine();
				Message message = new Message();
				message.obj = receiveString;
				mHandler.sendMessage(message);

				out.close();
				in.close();
				socket.close();
			} catch (UnknownHostException e) {
			} catch (IOException e) {
			}
		}
	}

	Handler mHandler = new Handler() {
		public void handleMessage(android.os.Message msg) {
			String receiveString = (String)msg.obj;
			TextView textView1 = (TextView)findViewById(R.id.textView1)	;
			textView1.setText(textView1.getText() + "\n" + receiveString);
		}
	};
}


'Programming > Android' 카테고리의 다른 글

Android 채팅 서버 소스 01  (0) 2013.08.20
Android 채팅 소스 03  (0) 2013.08.20
Android 채팅 소스 01  (0) 2013.08.20
Android Download html  (0) 2013.08.20
Andoid 매트로돔  (0) 2013.08.19

Android 채팅 소스 01

Programming/Android 2013. 8. 20. 17:19 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

package com.tistory.tansanc.Test130805;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends Activity {
	String msg;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	public void mOnClick(View v) {
		EditText editText1 = (EditText) findViewById(R.id.editText1);
		msg = editText1.getText().toString();
		MessageSendThread mst = new MessageSendThread();
		mst.start();
	}

	class MessageSendThread extends Thread {
		public void run() {
			Socket socket = null;
			PrintWriter out = null;
			BufferedReader in = null;

			try {
				socket = new Socket("115.20.247.141", 2013);
				out = new PrintWriter(socket.getOutputStream(), true);
				in = new BufferedReader(new InputStreamReader(
						socket.getInputStream()));

				out.println(msg);

				out.close();
				in.close();
				socket.close();
			} catch (UnknownHostException e) {
			} catch (IOException e) {
			}
		}
	}
}


'Programming > Android' 카테고리의 다른 글

Android 채팅 소스 03  (0) 2013.08.20
Android 채팅 소스 02  (0) 2013.08.20
Android Download html  (0) 2013.08.20
Andoid 매트로돔  (0) 2013.08.19
Android 시계  (0) 2013.08.19

Android Download html

Programming/Android 2013. 8. 20. 16:43 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

package com.tistory.tansanc.Test130805;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.c21_downhtml);

		Button btn = (Button) findViewById(R.id.down);
		btn.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				String html;
				DownloadHtmlThread.start();
			}
		});
	}

	// * 자바의 네트워크 클래스 사용
	Thread DownloadHtmlThread = new Thread() {
		public void run() {
			StringBuilder html = new StringBuilder();
			try {
				URL url = new URL("http://www.google.com");
				HttpURLConnection conn = (HttpURLConnection) url
						.openConnection();
				if (conn != null) {
					conn.setConnectTimeout(10000);
					conn.setUseCaches(false);
					if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {
						BufferedReader br = new BufferedReader(
								new InputStreamReader(conn.getInputStream()));
						for (;;) {
							String line = br.readLine();
							if (line == null)
								break;
							html.append(line + '\n');
						}
						br.close();
					}
					conn.disconnect();
				}
			} catch (Exception ex) {
				Log.d("Exceoption", ex.toString());
			}
			Message msg = new Message();
			msg.obj = html.toString();
			mHandler.sendMessage(msg);
		};
	};
	Handler mHandler = new Handler() {
		public void handleMessage(android.os.Message msg) {

			String str = (String)msg.obj; 
			TextView result = (TextView) findViewById(R.id.result);
			result.setText(str);
		};
	};

	// */

	/*
	 * 아파치 클래스 사용 String DownloadHtml(String addr) { HttpGet httpget = new
	 * HttpGet(addr); DefaultHttpClient client = new DefaultHttpClient();
	 * StringBuilder html = new StringBuilder(); try { HttpResponse response =
	 * client.execute(httpget); BufferedReader br = new BufferedReader(new
	 * InputStreamReader(response.getEntity().getContent())); for (;;) { String
	 * line = br.readLine(); if (line == null) break; html.append(line + '\n');
	 * } br.close(); } catch (Exception e) {;} return html.toString(); } //
	 */
}


'Programming > Android' 카테고리의 다른 글

Android 채팅 소스 02  (0) 2013.08.20
Android 채팅 소스 01  (0) 2013.08.20
Andoid 매트로돔  (0) 2013.08.19
Android 시계  (0) 2013.08.19
Andoid 알람 기능으로 라디오 mms 주소로 듣기  (0) 2013.08.16

Andoid 매트로돔

Programming/Android 2013. 8. 19. 17:21 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
package com.tistory.tansanc.Test130805;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;

public class MainActivity extends Activity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
		mDdok = mPool.load(this, R.raw.ddok, 1);
		MyView mv = new MyView(this, mHandler);
		setContentView(mv);
	}

	Handler mHandler = new Handler() {
		public void handleMessage(Message msg) {
			mPool.play(mDdok, 1, 1, 0, 0, 1);
		}
	};

	SoundPool mPool;
	int mDdok;

	class MyView extends View {
		Context context;
		Handler mDdokHandler;

		public MyView(Context context, Handler mDdokHandler) {
			super(context);
			this.context = context;
			this.mDdokHandler = mDdokHandler;
			mHandler.sendEmptyMessage(0);
		}

		float degree = 0;
		float inc = 1;

		@Override
		protected void onDraw(Canvas canvas) {
			// TODO Auto-generated method stub

			Paint Pnt = new Paint();
			Pnt.setAntiAlias(true);
			Pnt.setColor(Color.RED);
			Pnt.setStrokeWidth(20);

			canvas.translate(canvas.getWidth() / 2, canvas.getHeight() / 4 * 3);
			if (degree > 45) {
				inc = -1;
				mDdokHandler.sendEmptyMessage(0);
			} else if (degree < -45) {
				inc = 1;
				mDdokHandler.sendEmptyMessage(0);
			}
			canvas.rotate(degree);
			canvas.drawLine(0, 0, 0, -canvas.getHeight() / 2, Pnt);
			super.onDraw(canvas);
		}

		Handler mHandler = new Handler() {
			public void handleMessage(Message msg) {
				degree = degree + inc;
				invalidate();
				mHandler.sendEmptyMessageDelayed(0, 50);
			}
		};
	}
}

'Programming > Android' 카테고리의 다른 글

Android 채팅 소스 01  (0) 2013.08.20
Android Download html  (0) 2013.08.20
Android 시계  (0) 2013.08.19
Andoid 알람 기능으로 라디오 mms 주소로 듣기  (0) 2013.08.16
Android 라디오 mms 주소로 듣기  (1) 2013.08.16

Android 시계

Programming/Android 2013. 8. 19. 16:59 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
package com.tistory.tansanc.Test130805;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;

public class MainActivity extends Activity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		MyView mv = new MyView(this);
		setContentView(mv);
	}
}

class MyView extends View {
	Context context;

	public MyView(Context context) {
		super(context);
		this.context = context;
		mHandler.sendEmptyMessage(0);
	}

	float degree = -30;

	@Override
	protected void onDraw(Canvas canvas) {
		// TODO Auto-generated method stub

		Paint Pnt = new Paint();
		Pnt.setAntiAlias(true);
		Pnt.setColor(Color.YELLOW);
		Pnt.setStrokeWidth(20);
		
		canvas.translate(canvas.getWidth()/2, canvas.getHeight()/2);
		canvas.rotate(degree);
		canvas.drawLine(0, 0, 400, 400, Pnt);
		Pnt.setColor(Color.RED);
		Pnt.setStrokeWidth(10);
		canvas.rotate(degree);
		canvas.drawLine(0, 0, 400, 400, Pnt);
		super.onDraw(canvas);
	}

	Handler mHandler = new Handler() {
		public void handleMessage(Message msg) {
			degree++;
			invalidate();
			mHandler.sendEmptyMessageDelayed(0, 100);
		}
	};
}

'Programming > Android' 카테고리의 다른 글

Android Download html  (0) 2013.08.20
Andoid 매트로돔  (0) 2013.08.19
Andoid 알람 기능으로 라디오 mms 주소로 듣기  (0) 2013.08.16
Android 라디오 mms 주소로 듣기  (1) 2013.08.16
Android Intro 로딩 Activity  (0) 2013.08.12
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

package com.example.alarm;

import java.util.Calendar;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;

public class MainActivity extends Activity {
	DatePicker mDate;
	TextView mTxtDate;
	TimePicker mTime;
	TextView mTxtTime;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		mDate = (DatePicker)findViewById(R.id.datepicker);
		mDate.init(mDate.getYear(), mDate.getMonth(), mDate.getDayOfMonth(),
				new DatePicker.OnDateChangedListener() {
					public void onDateChanged(DatePicker view, int year,
							int monthOfYear, int dayOfMonth) {
						mTxtDate.setText(String.format("%d/%d/%d", year,
								monthOfYear + 1, dayOfMonth));
					}
				});

		// 시간 선택기
		mTime = (TimePicker) findViewById(R.id.timepicker);
		mTxtTime = (TextView) findViewById(R.id.txttime);
		mTime.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {
			public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
				mTxtTime.setText(String.format("%d:%d", hourOfDay, minute));
			}
		});

		// 24시간제 토글
		findViewById(R.id.btntoggle24).setOnClickListener(
				new View.OnClickListener() {
					public void onClick(View v) {
						mTime.setIs24HourView(!mTime.is24HourView());
					}
				});
	}

	public void mOnClick(View v) {

		String result = String.format("%d/%d/%d %d:%d", mDate.getYear(),
				mDate.getMonth() + 1, mDate.getDayOfMonth(),
				mTime.getCurrentHour(), mTime.getCurrentMinute());
		Toast.makeText(MainActivity.this, result + "로 알람이 설정 되었습니다.", 0).show();

		// 알람 매니저에 등록할 인텐트를 만듬

		Intent intent = new Intent(this, AlarmReceiver.class);

		PendingIntent sender = PendingIntent.getBroadcast(this, 0, intent, 0);

		// 알람을 받을 시간을 5초 뒤로 설정

		Calendar calendar = Calendar.getInstance();

		calendar.setTimeInMillis(System.currentTimeMillis());

		calendar.add(Calendar.SECOND, 50);

		// 알람 매니저에 알람을 등록

		AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);

		am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);

	}

}



package com.example.alarm;

import android.app.PendingIntent;
import android.app.PendingIntent.CanceledException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;

public class AlarmReceiver extends BroadcastReceiver {
	public void onReceive(Context context, Intent intent) {
		Toast.makeText(context, "It's time to start", Toast.LENGTH_LONG).show();
		Intent i = new Intent(Intent.ACTION_VIEW);
		Uri uri = Uri.parse("mms://114.108.140.39/magicfm_live");
		i.setDataAndType(uri, "video/mp4");
		
		PendingIntent pi = PendingIntent.getActivity(context, 0, i,
				PendingIntent.FLAG_ONE_SHOT);
		try {
			pi.send();
		} catch (CanceledException e) {
			e.printStackTrace();
		}

	}
}







    

    

    
        
            
                

                
            
        

        
        
    





'Programming > Android' 카테고리의 다른 글

Andoid 매트로돔  (0) 2013.08.19
Android 시계  (0) 2013.08.19
Android 라디오 mms 주소로 듣기  (1) 2013.08.16
Android Intro 로딩 Activity  (0) 2013.08.12
Android 전화번호부 목록 ListView에 띄우기  (0) 2013.08.09

Android 라디오 mms 주소로 듣기

Programming/Android 2013. 8. 16. 17:28 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

package com.tistory.tansanc.Test130805;

import java.io.IOException;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnPreparedListener;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class MainActivity extends Activity implements OnPreparedListener {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

	}

	MediaPlayer player;

	public void mOnClick(View v) {

		try {
			Intent it = new Intent(Intent.ACTION_VIEW);
			Uri uri = Uri.parse("mms://114.108.140.39/magicfm_live");
			it.setDataAndType(uri, "video/mp4");
			startActivity(it);
		} catch (IllegalArgumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SecurityException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalStateException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void onPrepared(MediaPlayer player) {
		Log.d("Start onPrepared", "Start onPrepared");
		player.start();
	}
}

Android Intro 로딩 Activity

Programming/Android 2013. 8. 12. 17:28 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

public class IntroPage extends Activity
{
	private ProgressDialog pDialog;

	Handler myHandler = new Handler();
	Runnable myRunnable = new Runnable()
	{
		// 이미지 뷰를 띄운 후 2초후에 로그인 페이지로 이동
		public void run()
		{
			pDialog.dismiss();
			Intent i = new Intent(IntroPage.this, Main.class);
			startActivity(i);
			overridePendingTransition(R.anim.fade, R.anim.hold);
			finish();
		}
	};

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		// TODO Auto-generated method stub
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.intro);
		pDialog = ProgressDialog.show(this, "", "연결 중....");
		myHandler.postDelayed(myRunnable, 2000);
	}
}
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
package com.tistory.tansanc.Test130805;

import java.util.ArrayList;

import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends Activity {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.c09_listview);

		// * 데이터 원본 준비
		ArrayList arContactList = new ArrayList();		
		arContactList = getContactList();
		ArrayList arGeneral = new ArrayList();
		for( int i = 0 ; i < arContactList.size() ; i++ )
		{
			arGeneral.add( arContactList.get(i).name );
		}
		// */

		/*
		 * 배열로 준비 String[] arGeneral = {"김유신", "이순신", "강감찬", "을지문덕"}; //
		 */

		// 어댑터 준비
		ArrayAdapter Adapter;
		Adapter = new ArrayAdapter(this,
				android.R.layout.simple_list_item_1, arGeneral);

		// 어댑터 연결
		ListView list = (ListView) findViewById(R.id.list);
		list.setAdapter(Adapter);
	}

	private ArrayList getContactList() {

		Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;

		String[] projection = new String[] {

		ContactsContract.CommonDataKinds.Phone.CONTACT_ID, // 연락처 ID -> 사진 정보
															// 가져오는데 사용

				ContactsContract.CommonDataKinds.Phone.NUMBER, // 연락처

				ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME }; // 연락처
																		// 이름.

		String[] selectionArgs = null;

		String sortOrder = ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME

		+ " COLLATE LOCALIZED ASC";

		Cursor contactCursor = managedQuery(uri, projection, null,

		selectionArgs, sortOrder);

		ArrayList contactlist = new ArrayList();

		if (contactCursor.moveToFirst()) {

			do {

				String phonenumber = contactCursor.getString(1).replaceAll("-",

				"");

				if (phonenumber.length() == 10) {

					phonenumber = phonenumber.substring(0, 3) + "-"

					+ phonenumber.substring(3, 6) + "-"

					+ phonenumber.substring(6);

				} else if (phonenumber.length() > 8) {

					phonenumber = phonenumber.substring(0, 3) + "-"

					+ phonenumber.substring(3, 7) + "-"

					+ phonenumber.substring(7);

				}

				Contact acontact = new Contact();

				acontact.setPhotoid(contactCursor.getLong(0));

				acontact.setPhonenum(phonenumber);

				acontact.setName(contactCursor.getString(2));

				contactlist.add(acontact);

			} while (contactCursor.moveToNext());

		}

		return contactlist;

	}

	public class Contact {
		long photoid;
		String phonenum;
		String name;
		
		public long getPhotoid() {
			return photoid;
		}
		public void setPhotoid(long photoid) {
			this.photoid = photoid;
		}
		public String getPhonenum() {
			return phonenum;
		}
		public void setPhonenum(String phonenum) {
			this.phonenum = phonenum;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		
		
	}


}

Layout XML

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<ListView
 android:id="@+id/list" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
 />
</LinearLayout>

 

Manifest 추가

 

<uses-permission android:name="android.permission.READ_CONTACTS" />

'Programming > Android' 카테고리의 다른 글

Android 라디오 mms 주소로 듣기  (1) 2013.08.16
Android Intro 로딩 Activity  (0) 2013.08.12
안드로이드 타자 연습 예제  (0) 2013.08.08
Android 다양한 Layout 사용법  (0) 2013.08.07
Could not find .apk  (0) 2013.05.24

안드로이드 타자 연습 예제

Programming/Android 2013. 8. 8. 18:33 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
package com.tistory.tansanc.Test130805;

import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.widget.EditText;
import android.widget.TextView;

// 액티비티 : 게임 뷰를 담는 껍데기.
public class MainActivity extends Activity {

	TextView tv1;
	TextView tv2;
	EditText mEdit;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.c07_contextmenu);
		mEdit = (EditText) findViewById(R.id.editText1);
		tv2 = (TextView) findViewById(R.id.textView2);
		tv1 = (TextView) findViewById(R.id.textView1);

		mEdit.addTextChangedListener(mWatcher);
	}

	TextWatcher mWatcher = new TextWatcher() {
		public void afterTextChanged(Editable s) {
		}

		public void beforeTextChanged(CharSequence s, int start, int count,
				int after) {
		}

		public void onTextChanged(CharSequence s, int start, int before,
				int count) {
			
			if (mEdit.getText().toString()
					.equalsIgnoreCase(tv1.getText().toString())) {
				tv2.setText("O");
			} else {
				tv2.setText("X");
			}
		}
	};
}

Layout

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="match_parent"
        android:layout_height="50sp"
        android:gravity="center"
        android:textSize="40sp"
        android:text="Hello" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:textSize="40sp"
        android:layout_height="50sp"
        android:ems="10" >

        <requestFocus />
    </EditText>

    <TextView
        android:id="@+id/textView2"
        android:layout_width="match_parent"
        android:layout_height="50sp"
        android:gravity="center"
        android:textSize="40sp"
        android:text="X" />
</LinearLayout>

'Programming > Android' 카테고리의 다른 글

Android Intro 로딩 Activity  (0) 2013.08.12
Android 전화번호부 목록 ListView에 띄우기  (0) 2013.08.09
Android 다양한 Layout 사용법  (0) 2013.08.07
Could not find .apk  (0) 2013.05.24
앱 시작 액티비티 변경  (0) 2013.05.18