WebView 안에서 자바스크립트 함수를 호출하여 액티비티 안의 함수를 호출할 수 있다. 새로운 액티비티를 호출하거나 데이터를 fetch할 때 사용된다. 자바스크립트 인터페이스 클래스 만들기 WebView 에 인터페이스 클래스 등록하기 Javascript에서 Android 함수 호출하기 1. 자바스크립트 인터페이스 클래스 만들기 WebView 에 등록할 인터페이스를 만든다. 인터페이스의 함수는 자바스크립트에서 호출할 때 사용된다. final class MyJavaScriptInterface { MyJavaScriptInterface() { } /** * This is not called on the UI thread. Post a runnable to invoke * loadUrl on the UI th..
Activity 제목부분에서 WebView 의 페이지 로딩 진행상황을 progress meter 로 표시해준다. 페이지 로드가 100% 완료되면 progress meter 는 사라진다. 소스구현 getWindow().requestFeature(Window.FEATURE_PROGRESS) 선언 public void onProgressChanged(WebView view, int progress) 구현 public class TestActivity extends Activity { WebView webview ; final Activity activity = this; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(sav..
WebView 를 커스터마이징 하는 포인트 WebChromeClient subclass 생성하고 세팅하기 This class is called when something that might impact a browser UI happens, for instance, progress updates and JavaScript alerts are sent here (see Debugging Tasks). WebViewClient subclass 생성하고 세팅하기 It will be called when things happen that impact the rendering of the content, eg, errors or form submissions. You can also intercept URL lo..
ttp://ajaxdump.com/?tqSDBVlK JQuery Mobile의 매력은 디자인에 고민할 필요가 없이 세련된 UI를 가질 수 있다. 물론 안드로이드 앱 개발시 기기별 파편화도 신경쓸 필요가 없다. PC용 웹브라우저에서 테스트해 보니 IE : CSS 가 잘 안먹힌다...한마디로 꽝 크롬 : 음...에러나는 기능이 발견된다... 파폭 : 아주 잘~ 돌아간다. 1. 기본 HTML 작성 타이틀 : jQuery Mobile Test jQueryMobile 시작 About jQueryMobile About jQueryMobile jQuery Mobile를 배워보자~ 얘는 다른 페이지에 보이고 싶다.. 꼬리말은 여기에 2. jQuery Mobile CSS, JavaScript 추가하기 아직까지 아무런 변..
안드로이드에서 제공되는 탭은 사용하기가 넘 불편하다...어쩔 수 없이 커스텁 탭을 만들어 사용해야 겠다. How To 커스텀 뷰 레이아웃 XML 정의하기 커스텀 뷰 구현하기 액티비티 레이아웃 XML 정의하기 custom tab Activity 만들기 AndroidManifest.xml 에 Activity 등록 * * * ■ 커스텀 뷰 레이아웃 XML 정의하기 하나의 리스트와 네개의 탭으로 이루어진 화면을 구성한다. ■ 커스텀 뷰 구현하기 - 탭을 클릭할 때 해당되는 데이터를 가져온다. View.OnClickListener 구현 package com.misun.samples.views;public class CustomTabs extends LinearLayout implements View.OnClick..
A NinePatchDrawable graphic is a stretchable bitmap image, which Android will automatically resize to accommodate the contents of the View in which you have placed it as the background. An example use of a NinePatch is the backgrounds used by standard Android buttons — buttons must stretch to accommodate strings of various lengths. A NinePatch drawable is a standard PNG image that includes an ex..
액티비티를 추가하는 방법...매니페스트 파일에 등록하는 것을 잊으면 안된다!!! 새로운 액티비티의 레이아웃 XML 정의 액티비티의 코드를 java 파일에 작성 새로 추가한 액티비티를 메니페스트에 등록 startActivity 메서드로 액티비티를 호출 1. 새로운 액티비티의 레이아웃 XML 정의 2. 액티비티의 코드를 java 파일에 작성 3. 새로 추가한 액티비티를 메니페스트에 등록 보안상의 이유로 응용 프로그램에 포함된 모든 액티비티는 반드시 매니페스트에 등록되어야 한다. android:name 패키지명을 포함한 풀 경로, 같은 패키지에 속해 있을 때는 앞에 '.' 을 찍는다 android:label 액티비티 타이블 바에 표시될 내용 4. startActivity 메서드로 액티비티를 호출 Intent ..
adb devices 연결되어 있는 장비 조사 adb install /root/Downloads/HangulKeyboard.apk apk 파일 설치하기 우분투 10.10 사용 http://developer.android.com/guide/developing/tools/adb.html abd(Android Debug Bridge) 에뮬레이터 인스턴스나 안드로이드 장비의 상태를 관리하는 툴 클라이언트-서버 프로그램 위치 : /platform-tools/ root@ubuntu:~/android-sdk-linux_86/platform-tools# ll 합계 5052 drwxr-xr-x 3 root root 4096 2011-01-17 19:16 ./ drwxrwxr-x 9 12275 5000 4096 2011-..
Chrome OS vs. Android: What's the difference? Amidst all the chatter about Android Gingerbread these days, another Google operating system is starting to gain an increasing amount of attention. We're talking, of course, about Google's Chrome OS -- the lightweight, Web-centric software announced by Google last summer and kept under development ever since. 크롬 OS - 경량, 웹 지향 소프트웨어 From the looks of ..
p.630 쓰레드 안드로이드는 멀티 스레드 지원 리눅스 : 멀티 스레드 운영체제 자바 : 가상 머신 치원에서 멀티 스레드 지원 주로 자바에의해 지원 자바의 스레드 생성 방법 2가지 Thread() Thread(Runnable runnable) Runnable 인터페이스 구현 객체 생성 Thread의 생성자로 전달 : 자바는 다중 상속을 지원하지 않기 때문에 위의 두가지 방법 제시 스레드 고유의 스택을 가지며 메인 스레드와는 별도로 CPU 시간을 할당받아 실행된다. run 메서드 : 스레드에서 할 작업 작성, 스레드의 진입점, 메인 메서드 start 메서드 : 스레드 동작에 필요한 자원을 할당한 후 run 메서드를 호출하여 스레드를 기동시킨다. 자바의 스레드는 기본적으로 메인 스레드와 동등한 자격을 가지며..
Density-independent pixel (dp) A virtual pixel unit that you should use when defining UI layout, to express layout dimensions or position in a density-independent way. The density-independent pixel is equivalent to one physical pixel on a 160 dpi screen, which is the baseline density assumed by the system for a "medium" density screen. At runtime, the system transparently handles any scaling of ..
■ JDK 설치하기 ■ 이클립스 클래식 버전 설치하기 ■ 안드로이드 SDK 설치하기 ■ 이클립스 플러그인 ADT(Android Development Tools) 설치하기 ■ 이클립스 플러그인 SVN 설치하기 ■ JDK 설치하기 http://www.oracle.com/technetwork/java/javase/downloads/index.html http://download-llnw.oracle.com/javase/6/docs/ Java SE 6 Documentation JDK 5 를 가지고 쓰다가 @override 가 안먹는 경우가 있었다. 그래서 JDK 6 설치.. ■ 이클립스 클래식 버전 설치하기 http://www.eclipse.org/downloads/ 에서 Eclipse IDE for Java..