본문 바로가기

Android/Java Code

(9)
Java ArrayList ArrayList를 쓰다가 햇갈려서 참고하려고 적는다. ArrayList array = new ArrayList(); array.add("abc); for(String temp : array) { int index = array.indexOf("abc"); } 이런식으로 접근.. add(Object obj) clear() contains(Object obj) get(int index) isEmpty() indexOf(Object obj) remove(int index) remove(Object obj) size() 와 같은 함수사용이 있다.
스트리밍 서버 구현 및 안드로이드에서 보기 글 출처 : http://www.androidpub.com/800570#5 글 작성자 : 분홍쓰레빠 감시시스템을 안드로이드에서 확인하는 것을 구현하려고 무진장 찾아보았어요. 서버에서 돌아가는 감시카메라가 찍는 화면을 보려구요. 윈도우 미디어 인코더, 다윈 스트리밍 서버, VLC 등등 최근에는 웹캠을 소켓으로 연결해서 구현하는 것도 해보고 정말 오랫동안 찾아봤는데 최종적으로는 1. Wowza Media Server 를 간단히 구축해서 (개발자용은 무료지만 동시 접속 10명 등등 제한이) 2. Flash Media Live Encoder로 실시간 인코딩 하면 3. 안드로이드에서 볼수가 있더라고요!! 실무자 분들은 알고 계실지 모르지만 학생이라 많이 몰라서 찾고 해보는 것에 어려움이 많았어요. 글 올려도 답변..
키 입력 이벤트시 원하는 키 처리 키보드에서 Enter (Next나 다음 등) 키 처리를 연결해주는 방법이다. 이 처리가 안되는 onKeyListener() 이외에 EditText의 경우 onEditorActionListener() 를 사용할 수 있다. 그리고 setImeOptions() 함수를 통해 액션을 제어할 수 있다. // EditText Listener 등록 및 Next 버튼으로 보이기 EditText edittext = (EditText) findViewById(R.id.edittext); edittext.setOnEditorActionListener(this); edittext.setImeOptions(EditorInfo.IME_ACTION_NEXT) @Override public boolean onEditorAction(T..
Android - 화면 안꺼지게 하기 원하는 Activity의 Oncreate()함수에 아래 코드를 넣으시면 아무런 입력이 없어도 화면이 꺼지지 않습니다. getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); -------------------------------------------------- 여러 Activity 를 가지고 있을 경우에는 어떻게 해야 하지? 각 Activity마다 다 넣어줘야 하나? [출처] Android - 화면 안꺼지게 하기|작성자 xgraph http://blog.naver.com/xgraph?Redirect=Log&logNo=150081927021
Android Builder Class http://d.android.com/reference/android/os/Build.html 참고.. Build.VERSION.SDK 이런식으로 사용하면 되겠다. Nested Classes class Build.VERSION Various version strings. class Build.VERSION_CODES Enumeration of the currently known SDK version codes. Constants String BOARD The name of the underlying board, like "goldfish". String BRAND The brand (e.g., carrier) the software is customized for, if any. String CPU_AB..
시간표시 관련 튜토리얼 http://java.sun.com/docs/books/tutorial/i18n/format/simpleDateFormat.html Date today; String output; SimpleDateFormat formatter; formatter = new SimpleDateFormat(pattern, currentLocale); today = new Date(); output = formatter.format(today); System.out.println(pattern + " " + output); The following table shows the output generated by the previous code example when the U.S. Locale is specified: Cu..
Android Service 에서 Activity 실행 Context context = getApplicationContext(); Intent intent = new Intent(context, Action.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); 여기서 FLAG_ACTIVITY_NEW_TASK 이 플래그.. 이 플래그로 호출되면 동일한 Activity가 검색될 시 그 Activity창이 뜬다.
Android URI List 원문은 http://www.openintents.org/en/uris 여기 참조. List of URIs Show: Applications Intents URIs Extras This is a list of URIs that can be used in intents. View all fields. Add a new URI. Title URIs or MIME types Description A collection content://net.lp.collectionista.products/collections For internal use only: content://net.lp.collectionista.products.collections For example: content://net.lp.collect..