[Android] Intent 활용 예제안드로이드 Intent 활용 예제 연락처 Intentview plainprint?// 연락처 조회 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("content://contacts/people" + String.valueOf(contact.getId()))); startActivity(intent); view plainprint?// 연락처 등록 Intent intent = new Intent(Intent.ACTION_INSERT, Uri.parse("content://contacts/people")); startActivity(intent); view plainprint?// 연락처 수정 Intent inte..
안드로이드 폰에서 SMS 메세지를 수신했을때 어플에서 수신된 SMS메세지를 처리 하고 싶다면BroadcastReceiver를 사용하면 된다. 우선 안드로이드 프로젝트를 하나 생성하자.그리고 SMS관련 receiver를 사용하기 위해 AndroidManifest.xml 파일에 권한과 receiver 정보를 추가 한다. 다음은 직접 SMS 메세지를 수신받아 처리할 SMSReceiver 클래스다. public class SMSReceiver extends BroadcastReceiver { static final String logTag = "SmsReceiver"; static final String ACTION = "android.provider.Telephony.SMS_RECEIVED"; @Overrid..
OpenGL ES 에서 텍스트를 사용할 수가 없다. 그래서 사용하는 방식이 안드로이드 Canvas로 비트맵에다가 텍스트를 그린 후에 그 비트맵을 가지고 OpenGL ES에서 텍스쳐로 로딩을 해서 텍스쳐로 사용한다. Bitmap bitmap = Bitmap.createBitmap(128 , 128, Bitmap.Config.ARGB_8888);Canvas canvas = new Canvas(bitmap); canvas.drawText(....매개변수 생략) //이 함수로 텍스트를 그린다. bitmap
public class LinkedList_Study { public static void main(String[] args) { mLinkedList list = new mLinkedList(); list.add("A"); list.add("B"); list.add("C"); list.listGet(); System.out.println("==================="); list.revGet(); } } class mLinkedList{ Node firstNode; Node node; public void add(String data){ if(firstNode != null){ while(node.nextNode != null){ node = node.nextNode; } Node newNod..
음성 인식 실행하기try{ Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Free Form Language Model Demo"); startActivityForResult(intent, REQUEST_SMS); } catch (ActivityNotFoundException ex) { Toast.makeText(NXTRemoteControl.this, "Activity..
이클립스에서 .java파일의 한글깨질 경우 처리 1. 기본 이클립스Preferences -> General -> Workspace: Text File encoding 을 Other => UTF-8 로 지정!! 2.Preferences -> General -> Content Types -> Text -> Java Source File: Default encoding => euc-kr 로 지정 후 Update!! 3. import 받은 파일 Properties는 => UTF-8 임
private String MOVIE_URL = "동영상 주소"; @Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.video); android.widget.VideoView vv = (android.widget.VideoView) findViewById(R.id.VideoView);MediaController mediaController = new MediaController(this);mediaController.setAnchorView(vv);// Set video link (mp4 format )Uri video = Uri.parse(MOV..