Object [object Object] has no method 오류

참고하려는 js 메소드에 @JavascriptInterface 추가 http://theeye.pe.kr/archives/1609


TIPS) 안드로이드 통신 깨진글씨 구글에 검색하면 바로 한글 검색 된다. 신기....

반응형

WEBVIEW

#AndroidManifast.xml permission 지정

#java

WebSettings webSettings = mWebView.getSettings();

// 자바 스크립트 허용 webSettings.setJavaScriptEnabled(true); //webSettings.setAllowContentAccess(true); //webSettings.setAppCacheEnabled(true);

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ mWebView.setWebContentsDebuggingEnabled(true); }

mWebView.loadUrl(baseUrl + getResources().getResourceEntryName(R.raw.appointment));

그러나! alert는 뜨지 않는다.

#경로 InputStream remoteUrl = getResources().openRawResource(R.raw.appointment); // String htmlStr = readHtml(remoteUrl); // mWebView.loadData(html, "text/html", "utf-8"); // String mimeType = "text/html"; // String encoding = "UTF-8"; String baseUrl = "file:///android_res/raw/"; WebSettings webSettings = mWebView.getSettings();

#debug

chrome remote debug

#url chrome://inspect/#devices

- device : usb debug check - 해당 페이지로 들어가면 연결된 디바이스 목록이 뜬다. - 디버깅 명령 후 웹뷰로 들어가면 해당 페이지 목록이 뜬다. - 'inspect' 클릭하면 크롬 개발자 도구 처럼 창이 뜬다. - 디버깅 가능.

#source

- 해당 소스 추가

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ mWebView.setWebContentsDebuggingEnabled(true); }

#webview 작성시 꼭 볼것 https://developer.android.com/reference/android/webkit/WebView.html

#library마다 디자인 차이 조금 있음..

http://stackoverflow.com/questions/38053779/android-webview-how-to-change-javascript-alert-title-text-in-android-webview

반응형

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

[Android] Google Play 결제 라이브러리 사용하기  (0) 2019.10.01
WebView <-> 안드로이드 통신  (0) 2016.08.20
ANDROID | Fragment LiftCycle  (0) 2016.08.17
UI | android systemUI Handle  (0) 2016.08.17
UI | round shape  (0) 2016.08.08

Fragment LiftCycle

https://developer.android.com/guide/components/fragments.html

반응형

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

WebView <-> 안드로이드 통신  (0) 2016.08.20
ANDROID | WEBVIEW  (0) 2016.08.18
UI | android systemUI Handle  (0) 2016.08.17
UI | round shape  (0) 2016.08.08
android 원격 디버깅  (0) 2016.08.08

Using Immersive Full-Screen Mode

#ui https://developer.android.com/training/system-ui/immersive.html#sticky

ref) FullscreenFragment.java https://gist.github.com/gelldur/cf7ff0d0d026dbd743d0

#build code https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#CUPCAKE

반응형

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

WebView <-> 안드로이드 통신  (0) 2016.08.20
ANDROID | WEBVIEW  (0) 2016.08.18
ANDROID | Fragment LiftCycle  (0) 2016.08.17
UI | round shape  (0) 2016.08.08
android 원격 디버깅  (0) 2016.08.08
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="10dp" />
<solid android:color="@color/notify_background"/>
</shape>


반응형

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

WebView <-> 안드로이드 통신  (0) 2016.08.20
ANDROID | WEBVIEW  (0) 2016.08.18
ANDROID | Fragment LiftCycle  (0) 2016.08.17
UI | android systemUI Handle  (0) 2016.08.17
android 원격 디버깅  (0) 2016.08.08



Debugging considerations


When debugging applications that use USB accessory or host features, you most likely will have USB hardware connected to your Android-powered device. This will prevent you from having an adb connection to the Android-powered device via USB. You can still access adb over a network connection. To enable adb over a network connection:

  1. Connect the Android-powered device via USB to your computer.
  2. From your SDK platform-tools/ directory, enter adb tcpip 5555 at the command prompt.
  3. Enter adb connect <device-ip-address>:5555 You should now be connected to the Android-powered device and can issue the usual adbcommands like adb logcat.
  4. To set your device to listen on USB, enter adb usb.


STEP 1.  컴퓨터 - 기기 USB 연결 상태에서  TCPIP 모드 진입 

 adb -d tcpip 5555


STEP 2. USB 연결 해제 후

adb connect 해당기기 ip:5555



STEP 3.  android studio 에서 원격디버깅' 버튼 클릭



* 재빌드 시에는  step2부터 다시 반복 


참고) https://developer.android.com/guide/topics/connectivity/usb/index.html

반응형

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

WebView <-> 안드로이드 통신  (0) 2016.08.20
ANDROID | WEBVIEW  (0) 2016.08.18
ANDROID | Fragment LiftCycle  (0) 2016.08.17
UI | android systemUI Handle  (0) 2016.08.17
UI | round shape  (0) 2016.08.08

+ Recent posts