I have been trying to resolve this issue but it seems the QCMediaPlayer is not present on my phone. I can here the warning tone's of the speed limit, but i cannot hear the turn by turn info. Is there anyone who has its own implementation? Should I implement my own TTS for the maneuvers.
Error in MediaPlayer :
03-23 10:21:28.205 31213-31509/com.maps.navi E/ExtMediaPlayer-JNI: QCMediaPlayer could not be located....
03-23 10:21:28.205 31213-31509/com.maps.navi E/MediaPlayer-JNI: QCMediaPlayer mediaplayer NOT present
Attached is the logs that I got from my device.
03-23 10:15:47.955 23339-23339/? I/art: Late-enabling -Xcheck:jni 03-23 10:15:48.020 23339-23339/com.maps.navi W/ActivityThread: Application com.maps.navi can be debugged on port 8100... 03-23 10:15:48.058 23339-23339/com.maps.navi D/ContextHelper: convertTheme. context->name=com.maps.navi themeResourceId=2131361921 03-23 10:15:48.070 23339-23339/com.maps.navi I/PhoneWindow: [generateLayout] setColorNavigationBar => color=0x ff000001 03-23 10:15:48.076 23339-23339/com.maps.navi D/PhoneWindowEx: [PWEx][generateLayout] setNavigationBarColor2 : colors=0xff000000 03-23 10:15:48.076 23339-23339/com.maps.navi I/PhoneWindow: [setNavigationBarColor2] color=0x ff000000 03-23 10:15:48.223 23339-23339/com.maps.navi I/CliptrayUtils: CliptrayUtils created!! mTextView = android.support.v7.widget.AppCompatEditText{3a2613d0 VFED..C. ......ID 0,0-0,0 #7f0e0055 app:id/search_address} 03-23 10:15:48.240 23339-23339/com.maps.navi D/com.maps.navi.NaviController: controller get instance! 03-23 10:15:48.241 23339-23339/com.maps.navi D/com.maps.navi.NaviMainActivity: Using default GPS location. 03-23 10:15:48.266 23339-23339/com.maps.navi D/com.maps.navi.NaviMainActivity: Back stack count 0 03-23 10:15:48.430 23339-23339/com.maps.navi D/com.maps.navi.NaviMainActivity: Using GPS location. 03-23 10:15:48.441 23339-23339/com.maps.navi D/BubblePopupHelper: isShowingBubblePopup : false 03-23 10:15:48.445 23339-23429/com.maps.navi D/OpenGLRenderer: Render dirty regions requested: true 03-23 10:15:48.446 23339-23429/com.maps.navi I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.013_msm8974_LA.BF.1.1.1_RB1__release_AU ()
OpenGL ES Shader Compiler Version: E031.25.03.00
Build Date: 01/21/15 Wed
Local Branch: mybranch7061829
Remote Branch: quic/LA.BF.1.1.1_rb1.7
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.013
+ NOTHING 03-23 10:15:48.447 23339-23429/com.maps.navi I/OpenGLRenderer: Initialized EGL, version 1.4 03-23 10:15:48.464 23339-23429/com.maps.navi D/OpenGLRenderer: Enabling debug mode 0 03-23 10:15:48.477 23339-23339/com.maps.navi D/Atlas: Validating map... 03-23 10:15:48.592 23339-23339/com.maps.navi D/BubblePopupHelper: isShowingBubblePopup : false 03-23 10:15:48.592 23339-23339/com.maps.navi D/BubblePopupHelper: isShowingBubblePopup : false 03-23 10:15:49.777 23339-23339/com.maps.navi I/Choreographer: Skipped 77 frames! The application may be doing too much work on its main thread. 03-23 10:15:49.905 23339-23339/com.maps.navi I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#2bc7f1e1 time:70821643 03-23 10:15:49.961 23339-23525/com.maps.navi D/NetworkProtocol: NetworkProtocol::NetworkProtocol 03-23 10:15:50.165 23339-23586/com.maps.navi I/art: Note: end time exceeds epoch: 03-23 10:15:50.170 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature Offline Maps With ODML 03-23 10:15:50.170 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature Advanced Drive Navigation 03-23 10:15:50.170 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature Offline Car Routing 03-23 10:15:50.170 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature Offline Pedestrian Routing 03-23 10:15:50.170 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature Offline Transit Routing 03-23 10:15:50.170 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature Offline Geocoding 03-23 10:15:50.170 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature Offline Reverse Geocoding 03-23 10:15:50.170 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature Offline Place Search 03-23 10:15:50.170 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature Offline Category Search 03-23 10:15:50.171 23339-23525/com.maps.navi I/HERESDK: HERESDK Feature 3D Landmarks 03-23 10:15:50.485 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglChooseConfig:917>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglChooseConfig:917>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.486 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglChooseConfig:917>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglChooseConfig:917>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.487 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.488 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.488 23339-23607/com.maps.navi W/Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE 03-23 10:15:50.510 23339-23339/com.maps.navi I/CliptrayUtils: CliptrayUtils created!! mTextView = android.widget.TextView{1cd961a8 V.ED.... ......ID 0,0-0,0} 03-23 10:15:50.512 23339-23339/com.maps.navi D/com.maps.navi.NaviMainActivity: Map engine is initialized! 03-23 10:15:50.513 23339-23339/com.maps.navi D/com.maps.navi.NaviController: Clean NaviController 03-23 10:15:50.513 23339-23339/com.maps.navi D/com.maps.navi.NaviController: Initialize controller! 03-23 10:15:50.513 23339-23339/com.maps.navi D/com.maps.navi.NaviController: Initializing Map 03-23 10:15:50.513 23339-23339/com.maps.navi D/com.maps.navi.NaviController: Initialize Thread! 03-23 10:15:50.514 23339-23339/com.maps.navi D/com.maps.navi.NaviController: Thread started! 03-23 10:15:50.533 23339-23339/com.maps.navi D/libc-netbsd: [getaddrinfo]: hostname=xxxxx; servname=(null); cache_mode=(null), netid=0; mark=0 03-23 10:15:50.533 23339-23339/com.maps.navi D/libc: getaddrinfo called from pid =23339 03-23 10:15:50.533 23339-23339/com.maps.navi D/libc-netbsd: [getaddrinfo]: ai_addrlen=0; ai_canonname=xxxxx; ai_flags=4; ai_family=0 03-23 10:15:50.534 23339-23339/com.maps.navi D/libc-netbsd: [getaddrinfo]: hostname=xxxxx; servname=(null); cache_mode=(null), netid=0; mark=0 03-23 10:15:50.534 23339-23339/com.maps.navi D/libc: getaddrinfo called from pid =23339 03-23 10:15:50.534 23339-23339/com.maps.navi D/libc-netbsd: [getaddrinfo]: ai_addrlen=0; ai_canonname=xxxxx; ai_flags=1024; ai_family=0 03-23 10:15:50.574 23339-23339/com.maps.navi D/libc: dnsproxy getaddrinfo returns 0 03-23 10:15:50.574 23339-23339/com.maps.navi I/System.out: propertyValue:false 03-23 10:15:50.597 23339-23339/com.maps.navi D/com.maps.navi.NaviMainActivity: onGetMapPackages 03-23 10:15:50.731 23339-23607/com.maps.navi I/TextToSpeech: Sucessfully bound to com.lge.tts.sfplus 03-23 10:15:50.785 23339-23339/com.maps.navi I/art: Thread[1,tid=23339,WaitingForJniOnLoad,Thread*=0xb4827800,peer=0x7608ab28,"main"] recursive attempt to load library "/system/lib/libhook_jni.so" 03-23 10:15:50.795 23339-23339/com.maps.navi E/MediaProfilesEx-JNI: register_com_lge_media_MediaProfilesEx 03-23 10:15:50.797 23339-23339/com.maps.navi E/MediaRecorderEx-JNI: register_com_lge_media_MediaRecorderEx 03-23 10:15:50.797 23339-23339/com.maps.navi D/AudioSystemEx: register_com_lge_media_LGAudioSystem 03-23 10:15:50.797 23339-23339/com.maps.navi E/SurfaceControlEx: register_com_lge_view_SurfaceControlEx 03-23 10:15:50.798 23339-23339/com.maps.navi I/art: Thread[1,tid=23339,WaitingForJniOnLoad,Thread*=0xb4827800,peer=0x7608ab28,"main"] recursive attempt to load library "/system/lib/libhook_jni.so" 03-23 10:15:50.798 23339-23339/com.maps.navi D/LGMtpDatabaseJNI: register_android_mtp_LGMtpDatabase 03-23 10:15:50.799 23339-23339/com.maps.navi I/art: Thread[1,tid=23339,WaitingForJniOnLoad,Thread*=0xb4827800,peer=0x7608ab28,"main"] recursive attempt to load library "/system/lib/libhook_jni.so" 03-23 10:15:50.801 23339-23339/com.maps.navi D/LGMtpServerJNI: register_android_mtp_LGMtpServer 03-23 10:15:50.802 23339-23339/com.maps.navi I/art: Thread[1,tid=23339,WaitingForJniOnLoad,Thread*=0xb4827800,peer=0x7608ab28,"main"] recursive attempt to load library "/system/lib/libhook_jni.so" 03-23 10:15:50.802 23339-23339/com.maps.navi E/MediaPlayerEx-jni: register_com_lge_view_MediaPlayerEx 03-23 10:15:50.803 23339-23339/com.maps.navi I/art: Thread[1,tid=23339,WaitingForJniOnLoad,Thread*=0xb4827800,peer=0x7608ab28,"main"] recursive attempt to load library "/system/lib/libhook_jni.so" 03-23 10:15:50.928 23339-23339/com.maps.navi D/com.maps.navi.NaviTransformListener: iZoom Level 15.0 iRange NONE 03-23 10:15:50.928 23339-23339/com.maps.navi D/com.maps.navi.NaviTransformListener: currentRange LEVEL_5 03-23 10:15:50.929 23339-23339/com.maps.navi D/com.maps.navi.NaviTransformListener: Zoom Level 15.0 Range NONE 03-23 10:15:50.989 23339-23339/com.maps.navi I/TextToSpeech: Connected to ComponentInfo{com.lge.tts.sfplus/com.lge.tts.sfplus.LGSFTTSService} 03-23 10:15:50.998 23339-23339/com.maps.navi D/com.maps.navi.NaviTransformListener: onMapTransformStart 03-23 10:15:51.000 23339-23339/com.maps.navi D/com.maps.navi.NaviTransformListener: onMapTransformEnd 15.0 03-23 10:15:51.000 23339-23339/com.maps.navi D/com.maps.navi.NaviTransformListener: iZoom Level 15.0 iRange LEVEL_5 03-23 10:15:51.000 23339-23339/com.maps.navi D/com.maps.navi.NaviTransformListener: currentRange LEVEL_5 03-23 10:15:51.001 23339-23339/com.maps.navi D/com.maps.navi.NaviTransformListener: onMapTransformEnd not requesting to service 15.0 03-23 10:15:51.030 23339-23627/com.maps.navi I/TextToSpeech: Set up connection to ComponentInfo{com.lge.tts.sfplus/com.lge.tts.sfplus.LGSFTTSService} 03-23 10:15:53.654 23339-23339/com.maps.navi D/com.maps.navi.NaviMainActivity: onGetMapPackagesComplete OPERATION_SUCCESSFUL 03-23 10:21:13.953 31213-31213/com.maps.navi I/HERESDK: HERESDK Feature Drive Navigation 03-23 10:21:14.007 31213-31213/com.maps.navi D/com.maps.navi.NaviTransformListener: onMapTransformStart 03-23 10:21:14.318 31213-31213/com.maps.navi D/com.maps.navi.navigation.NaviNavigationController: maneuverListener 03-23 10:21:17.816 31213-31229/com.maps.navi V/AudioSystem: ioConfigChanged() event 0, ioHandle 2 03-23 10:21:17.816 31213-31229/com.maps.navi V/AudioSystem: ioConfigChanged() new output samplingRate 48000, format 0x5 channel mask 0x3 frameCount 960 latency 50 03-23 10:21:17.817 31213-31230/com.maps.navi V/AudioSystem: ioConfigChanged() event 0, ioHandle 4 03-23 10:21:17.817 31213-31230/com.maps.navi V/AudioSystem: ioConfigChanged() new output samplingRate 48000, format 0x1 channel mask 0x3 frameCount 960 latency 80 03-23 10:21:17.818 31213-31509/com.maps.navi V/MediaPlayer[Native]: setListener 03-23 10:21:17.818 31213-31509/com.maps.navi E/ExtMediaPlayer-JNI: QCMediaPlayer could not be located.... 03-23 10:21:17.818 31213-31509/com.maps.navi E/MediaPlayer-JNI: QCMediaPlayer mediaplayer NOT present 03-23 10:21:17.818 31213-31509/com.maps.navi V/MediaPlayer[Native]: MediaPlayer::setAudioStreamType 03-23 10:21:17.821 31213-31509/com.maps.navi V/MediaPlayer[Native]: MediaPlayer::setVolume(0.900000, 0.900000) 03-23 10:21:17.821 31213-31509/com.maps.navi D/MediaPlayer: setDataSource by path 03-23 10:21:17.821 31213-31509/com.maps.navi D/MediaPlayer: setDataSource by fd 03-23 10:21:17.824 31213-31509/com.maps.navi V/MediaPlayer[Native]: setDataSource(140, 0, 576460752303423487) 03-23 10:21:17.888 31213-31229/com.maps.navi V/MediaPlayer[Native]: message received msg=8, ext1=0, ext2=0 03-23 10:21:17.888 31213-31229/com.maps.navi V/MediaPlayer[Native]: notify(8, 0, 0) callback on disconnected mediaplayer 03-23 10:21:17.891 31213-31509/com.maps.navi V/MediaPlayer[Native]: setVideoSurfaceTexture 03-23 10:21:17.891 31213-31509/com.maps.navi V/MediaPlayer[Native]: prepare 03-23 10:21:17.908 31213-31230/com.maps.navi V/MediaPlayer[Native]: message received msg=5, ext1=0, ext2=0 03-23 10:21:17.908 31213-31230/com.maps.navi V/MediaPlayer[Native]: New video size 0 x 0 03-23 10:21:17.909 31213-31230/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:17.909 31213-31230/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:17.909 31213-31230/com.maps.navi V/MediaPlayer[Native]: message received msg=1, ext1=0, ext2=0 03-23 10:21:17.909 31213-31230/com.maps.navi V/MediaPlayer[Native]: prepared 03-23 10:21:17.909 31213-31230/com.maps.navi V/MediaPlayer[Native]: signal application thread 03-23 10:21:17.909 31213-31230/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:17.909 31213-31230/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:17.909 31213-31509/com.maps.navi V/MediaPlayer[Native]: prepare complete - status=0 03-23 10:21:17.909 31213-31509/com.maps.navi E/MediaPlayer: Should have subtitle controller already set 03-23 10:21:17.909 31213-31509/com.maps.navi V/MediaPlayer[Native]: start 03-23 10:21:17.914 31213-31229/com.maps.navi V/MediaPlayer[Native]: message received msg=6, ext1=0, ext2=0 03-23 10:21:17.917 31213-31213/com.maps.navi E/MediaPlayer: Should have subtitle controller already set 03-23 10:21:17.919 31213-31509/com.maps.navi V/MediaPlayer[Native]: getDuration_l 03-23 10:21:17.919 31213-31213/com.maps.navi D/com.maps.navi.navigation.NaviNavigationController: audioFeedbackListener onAudioStart 03-23 10:21:17.920 31213-31229/com.maps.navi V/MediaPlayer[Native]: unrecognized message: (6, 0, 0) 03-23 10:21:17.920 31213-31229/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:17.920 31213-31229/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:17.920 31213-31213/com.maps.navi V/MediaPlayer[Native]: getCurrentPosition 03-23 10:21:17.922 31213-31213/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:18.872 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:18.923 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:18.973 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:19.024 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:19.074 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:19.090 31213-1150/com.maps.navi V/MediaPlayer[Native]: message received msg=2, ext1=0, ext2=0 03-23 10:21:19.090 31213-1150/com.maps.navi V/MediaPlayer[Native]: playback complete 03-23 10:21:19.090 31213-1150/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:19.091 31213-1150/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:19.091 31213-1150/com.maps.navi V/MediaPlayer[Native]: message received msg=7, ext1=0, ext2=0 03-23 10:21:19.091 31213-1150/com.maps.navi V/MediaPlayer[Native]: unrecognized message: (7, 0, 0) 03-23 10:21:19.091 31213-1150/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:19.091 31213-1150/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:19.105 31213-31213/com.maps.navi V/MediaPlayer[Native]: getCurrentPosition 03-23 10:21:19.109 31213-31213/com.maps.navi V/MediaPlayer[Native]: isPlaying: 0 03-23 10:21:19.125 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 0 03-23 10:21:19.125 31213-31509/com.maps.navi V/MediaPlayer[Native]: setListener 03-23 10:21:19.127 31213-31509/com.maps.navi V/MediaPlayer[Native]: disconnect 03-23 10:21:19.131 31213-31509/com.maps.navi V/MediaPlayer[Native]: destructor 03-23 10:21:19.132 31213-31509/com.maps.navi V/MediaPlayer[Native]: disconnect 03-23 10:21:19.133 31213-31213/com.maps.navi D/com.maps.navi.navigation.NaviNavigationController: audioFeedbackListener onAudioEnd 03-23 10:21:27.175 31213-31213/com.maps.navi D/com.maps.navi.navigation.NaviNavigationController: maneuverListener 03-23 10:21:28.202 31213-31509/com.maps.navi V/MediaPlayer[Native]: constructor 03-23 10:21:28.205 31213-31509/com.maps.navi V/MediaPlayer[Native]: setListener 03-23 10:21:28.205 31213-31509/com.maps.navi E/ExtMediaPlayer-JNI: QCMediaPlayer could not be located.... 03-23 10:21:28.205 31213-31509/com.maps.navi E/MediaPlayer-JNI: QCMediaPlayer mediaplayer NOT present 03-23 10:21:28.205 31213-31509/com.maps.navi V/MediaPlayer[Native]: MediaPlayer::setAudioStreamType 03-23 10:21:28.206 31213-31509/com.maps.navi V/MediaPlayer[Native]: MediaPlayer::setVolume(0.900000, 0.900000) 03-23 10:21:28.206 31213-31509/com.maps.navi D/MediaPlayer: setDataSource by path 03-23 10:21:28.207 31213-31509/com.maps.navi D/MediaPlayer: setDataSource by fd 03-23 10:21:28.207 31213-31509/com.maps.navi V/MediaPlayer[Native]: setDataSource(167, 0, 576460752303423487) 03-23 10:21:28.212 31213-31230/com.maps.navi V/MediaPlayer[Native]: message received msg=8, ext1=0, ext2=0 03-23 10:21:28.212 31213-31230/com.maps.navi V/MediaPlayer[Native]: notify(8, 0, 0) callback on disconnected mediaplayer 03-23 10:21:28.212 31213-31509/com.maps.navi V/MediaPlayer[Native]: setVideoSurfaceTexture 03-23 10:21:28.212 31213-31509/com.maps.navi V/MediaPlayer[Native]: prepare 03-23 10:21:28.232 31213-31229/com.maps.navi V/MediaPlayer[Native]: message received msg=5, ext1=0, ext2=0 03-23 10:21:28.232 31213-31229/com.maps.navi V/MediaPlayer[Native]: New video size 0 x 0 03-23 10:21:28.232 31213-31229/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:28.232 31213-31229/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:28.232 31213-31229/com.maps.navi V/MediaPlayer[Native]: message received msg=1, ext1=0, ext2=0 03-23 10:21:28.232 31213-31229/com.maps.navi V/MediaPlayer[Native]: prepared 03-23 10:21:28.232 31213-31229/com.maps.navi V/MediaPlayer[Native]: signal application thread 03-23 10:21:28.232 31213-31229/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:28.232 31213-31509/com.maps.navi V/MediaPlayer[Native]: prepare complete - status=0 03-23 10:21:28.232 31213-31229/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:28.232 31213-31509/com.maps.navi E/MediaPlayer: Should have subtitle controller already set 03-23 10:21:28.233 31213-31213/com.maps.navi E/MediaPlayer: Should have subtitle controller already set 03-23 10:21:28.233 31213-31213/com.maps.navi D/com.maps.navi.navigation.NaviNavigationController: audioFeedbackListener onAudioStart 03-23 10:21:28.233 31213-31509/com.maps.navi V/MediaPlayer[Native]: start 03-23 10:21:28.237 31213-31230/com.maps.navi V/MediaPlayer[Native]: message received msg=6, ext1=0, ext2=0 03-23 10:21:28.246 31213-31230/com.maps.navi V/MediaPlayer[Native]: unrecognized message: (6, 0, 0) 03-23 10:21:28.246 31213-31230/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:28.247 31213-31230/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:28.247 31213-31509/com.maps.navi V/MediaPlayer[Native]: getDuration_l 03-23 10:21:28.248 31213-31213/com.maps.navi V/MediaPlayer[Native]: getCurrentPosition 03-23 10:21:28.250 31213-31213/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:29.200 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:29.250 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:29.301 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:29.352 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:29.402 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 1 03-23 10:21:29.417 31213-31229/com.maps.navi V/MediaPlayer[Native]: message received msg=2, ext1=0, ext2=0 03-23 10:21:29.417 31213-31229/com.maps.navi V/MediaPlayer[Native]: playback complete 03-23 10:21:29.417 31213-31229/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:29.417 31213-31229/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:29.417 31213-31229/com.maps.navi V/MediaPlayer[Native]: message received msg=7, ext1=0, ext2=0 03-23 10:21:29.417 31213-31229/com.maps.navi V/MediaPlayer[Native]: unrecognized message: (7, 0, 0) 03-23 10:21:29.417 31213-31229/com.maps.navi V/MediaPlayer[Native]: callback application 03-23 10:21:29.417 31213-31229/com.maps.navi V/MediaPlayer[Native]: back from callback 03-23 10:21:29.417 31213-31213/com.maps.navi V/MediaPlayer[Native]: getCurrentPosition 03-23 10:21:29.417 31213-31213/com.maps.navi V/MediaPlayer[Native]: isPlaying: 0 03-23 10:21:29.453 31213-31509/com.maps.navi V/MediaPlayer[Native]: isPlaying: 0 03-23 10:21:29.453 31213-31509/com.maps.navi V/MediaPlayer[Native]: setListener 03-23 10:21:29.453 31213-31509/com.maps.navi V/MediaPlayer[Native]: disconnect 03-23 10:21:29.456 31213-31509/com.maps.navi V/MediaPlayer[Native]: destructor 03-23 10:21:29.456 31213-31509/com.maps.navi V/MediaPlayer[Native]: disconnect
Thanks!
Generally, the MobileSDK by HERE is using the system TTS engine that's setup on your Android. So please make sure your Android has a TTS engine installed and set (often this is Google TTS, some OEMs don't set a engine like my Sony Z5, or some have another one, like LG with sfplus for example).
Once Android has the TTS capabilities, the flow should look like following on HERE SDK side:
Check the already installed TTS Skins of the HERE SDK:
List localInstalledSkins = VoiceCatalog.getInstance().getLocalVoiceSkins();
If you voice you want is already downloaded locally, jump directly to 4. otherwise continue with next step.
Get the voice catalog from the HERE Servers:
VoiceCatalog.getInstance().downloadCatalog(VoiceCatalog.OnDownloadDoneListener)
In the listener callback you can query the list of available language for download via:
List packages = VoiceCatalog.getInstance().getCatalogList();
Download a VoiceSkin you wanna play:
VoiceCatalog.getInstance().downloadVoice(skin_id_from_catalog_you_want_to_use, VoiceCatalog.OnDownloadDoneListener)
Make sure the listener returns with success before you continue with next steps.
Set the downloaded voice skin for navigation:
NavigationManager.getInstance().setVoiceSkin(VoiceCatalog.getInstance().getLocalVoiceSkin(skin_id_you_want_to_use))
Kick off guidance
You can get my full project source from the HERE servers:
http://tcs.ext.here.com/sdk_examples/TtsAndNavigation.zip
Related
Situation
I am using a VideoView which I show when I want to play a video. After playing the video I hide it again. So I do not recreate the VideoView each time.
Exception
Every once in a while the app crashes when I try to start playing a video (sometimes after I have already played several videos using the VideoView before).
I get the stacktrace you can find below. I have tried almost everything but without luck. Maybe you struggled with this issue as well or even know the reason?
02-23 15:10:52.362 22834-22890/com.app.example D/dalvikvm: GC_EXPLICIT freed 189K, 27% free 11296K/15368K, paused 0ms+0ms, total 10ms
02-23 15:10:52.422 22834-22890/com.app.example D/dalvikvm: GC_EXPLICIT freed 189K, 27% free 11296K/15368K, paused 0ms+0ms, total 10ms
02-23 15:12:19.832 22834-22890/com.app.example W/PGA: [22890] egl: eglDestroySurface (0x5583a7a0, 0x7956ad40)
02-23 15:12:19.832 22834-22890/com.app.example W/PGA: [22890] egl: eglDestroySurface (0x5583a7a0, 0x7956ad40) returned
02-23 15:12:19.872 22834-22843/com.app.example E/MediaPlayer: error (1, -2147483648)
02-23 15:12:20.182 22834-22834/com.app.example D/AndroidRuntime: Shutting down VM
02-23 15:12:20.182 22834-22834/com.app.example W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x64d77b20)
02-23 15:12:20.182 22834-22847/com.app.example W/AudioSystem: AudioFlinger server died!
02-23 15:12:20.182 22834-22847/com.app.example W/IMediaDeathNotifier: media server died
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example E/MediaPlayer: error (100, 0)
02-23 15:12:20.182 22834-22847/com.app.example W/AudioSystem: AudioPolicyService server died!
02-23 15:12:20.322 22834-22834/com.app.example I/Process: Sending signal. PID: 22834 SIG: 9
02-23 15:12:20.322 22834-22834/com.app.example D/AndroidRuntime: procName from cmdline: com.app.example
02-23 15:12:20.322 22834-22834/com.app.example E/AndroidRuntime: in writeCrashedAppName, pkgName :com.app.example
02-23 15:12:20.322 22834-22834/com.app.example D/AndroidRuntime: file written successfully with content: com.app.example StringBuffer : ;com.app.example
02-23 15:12:20.322 22834-22834/com.app.example E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.example, PID: 22834
java.lang.RuntimeException: failure code: -32
at android.media.MediaPlayer.invoke(MediaPlayer.java:664)
at android.media.MediaPlayer.getInbandTrackInfo(MediaPlayer.java:1692)
at android.media.MediaPlayer.scanInternalSubtitleTracks(MediaPlayer.java:1851)
at android.media.MediaPlayer.access$600(MediaPlayer.java:529)
at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:2198)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
Your problem seems to have been encountered by others.
One solution would be this
mVideoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
#Override
public void onCompletion(MediaPlayer mp) {
if( mp != null ) {
mp.setDisplay(null);
mp.reset();
mp.setDisplay(mMovieView.getHolder());
}
}
});
Another would be to update SDK
Or recreating the VideoView for each media content source
All of them suggest it is happening on Android KitKat 4.4.x.
Is there a way to get current count of running/ waiting requests on OkHTTP library?
I found something like this but it's returns total count of requests.
Log.d(TAG, String.format("Hit count=%d.", getOkHttpClient().getCache().getHitCount()));
Log.d(TAG, String.format("Network count=%d.", getOkHttpClient().getCache().getNetworkCount()));
Log.d(TAG, String.format("EoRequestSpec count=%d.", getOkHttpClient().getCache().getRequestCount()));
I have idea to use Interceptor but would like to know a better way.
EDIT:
I have added log output of my test app. You can see that there is 1 active connection but getConnectionCount() and getHttpConnectionCount() both returns 0.
03-23 15:28:12.559: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:29] Sending request http://xyz.xyz.xyz.xyz/my_first_script.php on null
03-23 15:28:13.037: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:13.038: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
03-23 15:28:13.537: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:13.540: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
03-23 15:28:13.728: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:44] Received response for http://xyz.xyz.xyz.xyz/my_first_script.php in 1176,8ms
03-23 15:28:13.728: I/LoggingInterceptor(23131): X-Powered-By: PHP
03-23 15:28:13.728: I/LoggingInterceptor(23131): Content-type: text/html
03-23 15:28:13.728: I/LoggingInterceptor(23131): Transfer-Encoding: chunked
03-23 15:28:13.728: I/LoggingInterceptor(23131): Date: Mon, 23 Mar 2015 14:28:13 GMT
03-23 15:28:13.728: I/LoggingInterceptor(23131): Server: my_server
03-23 15:28:13.728: I/LoggingInterceptor(23131): OkHttp-Selected-Protocol: http/1.1
03-23 15:28:13.728: I/LoggingInterceptor(23131): OkHttp-Sent-Millis: 1427120892821
03-23 15:28:13.728: I/LoggingInterceptor(23131): OkHttp-Received-Millis: 1427120893720
03-23 15:28:13.735: D/MainActivity(23131): [com.myapp.android.MainActivity$6.onResponse:281]
03-23 15:28:13.737: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:29] Sending request http://xyz.xyz.xyz.xyz/my_second_script.php
03-23 15:28:14.056: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:14.058: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
03-23 15:28:14.536: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:14.538: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
03-23 15:28:15.036: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:15.038: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
03-23 15:28:15.536: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:15.538: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
03-23 15:28:15.873: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:44] Received response for http://xyz.xyz.xyz.xyz/my_second_script.php
03-23 15:28:15.873: I/LoggingInterceptor(23131): X-Powered-By: PHP
03-23 15:28:15.873: I/LoggingInterceptor(23131): Content-type: application/json; charset=UTF-8;
03-23 15:28:15.873: I/LoggingInterceptor(23131): Content-Length: 276
03-23 15:28:15.873: I/LoggingInterceptor(23131): Date: Mon, 23 Mar 2015 14:28:15 GMT
03-23 15:28:15.873: I/LoggingInterceptor(23131): Server: my_server
03-23 15:28:15.873: I/LoggingInterceptor(23131): OkHttp-Selected-Protocol: http/1.1
03-23 15:28:15.873: I/LoggingInterceptor(23131): OkHttp-Sent-Millis: 1427120893743
03-23 15:28:15.873: I/LoggingInterceptor(23131): OkHttp-Received-Millis: 1427120895870
03-23 15:28:15.876: D/MainActivity(23131): [com.myapp.android.MainActivity$5.onResponse:251]
03-23 15:28:15.905: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:29] Sending request http://xyz.xyz.xyz.xyz/my_second_script.php
03-23 15:28:16.036: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:16.039: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
...
03-23 15:28:27.536: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:27.538: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
03-23 15:28:27.706: D/MainActivity(23131): [com.myapp.android.MainActivity$9.run:364] Canceling a call.
03-23 15:28:27.711: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:44] Received response for in 11804,4ms
03-23 15:28:27.714: W/MainActivity(23131): [com.myapp.android.MainActivity$8.onFailure:337] (sendWaitForNewDeviceRequestOverOkHttp)
03-23 15:28:27.714: W/MainActivity(23131): java.io.IOException: Canceled
03-23 15:28:27.714: W/MainActivity(23131): at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:159)
03-23 15:28:27.714: W/MainActivity(23131): at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
03-23 15:28:27.714: W/MainActivity(23131): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
03-23 15:28:27.714: W/MainActivity(23131): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
03-23 15:28:27.714: W/MainActivity(23131): at java.lang.Thread.run(Thread.java:856)
03-23 15:28:27.717: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:29] Sending request http://xyz.xyz.xyz.xyz/my_second_script.php
03-23 15:28:28.036: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:28.037: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
...
03-23 15:28:31.036: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:31.037: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
03-23 15:28:31.231: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:44] Received response for http://xyz.xyz.xyz.xyz/my_second_script.php
03-23 15:28:31.231: I/LoggingInterceptor(23131): X-Powered-By: PHP
03-23 15:28:31.231: I/LoggingInterceptor(23131): Content-type: application/json; charset=UTF-8;
03-23 15:28:31.231: I/LoggingInterceptor(23131): Content-Length: 276
03-23 15:28:31.231: I/LoggingInterceptor(23131): Date: Mon, 23 Mar 2015 14:28:30 GMT
03-23 15:28:31.231: I/LoggingInterceptor(23131): Server: my_server
03-23 15:28:31.231: I/LoggingInterceptor(23131): OkHttp-Selected-Protocol: http/1.1
03-23 15:28:31.231: I/LoggingInterceptor(23131): OkHttp-Sent-Millis: 1427120907727
03-23 15:28:31.231: I/LoggingInterceptor(23131): OkHttp-Received-Millis: 1427120911228
03-23 15:28:31.234: D/MainActivity(23131): [com.myapp.android.MainActivity$5.onResponse:251]
03-23 15:28:31.243: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:29] Sending request http://xyz.xyz.xyz.xyz/my_second_script.php
03-23 15:28:31.536: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:31.537: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
...
03-23 15:28:35.536: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=0.
03-23 15:28:35.538: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=0.
03-23 15:28:35.842: I/LoggingInterceptor(23131): [com.myapp.android.networking.interceptor.LoggingInterceptor.intercept:44] Received response for http://xyz.xyz.xyz.xyz/my_second_script.php
03-23 15:28:35.842: I/LoggingInterceptor(23131): X-Powered-By: PHP
03-23 15:28:35.842: I/LoggingInterceptor(23131): Content-type: application/json; charset=UTF-8;
03-23 15:28:35.842: I/LoggingInterceptor(23131): Content-Length: 1149
03-23 15:28:35.842: I/LoggingInterceptor(23131): Date: Mon, 23 Mar 2015 14:28:35 GMT
03-23 15:28:35.842: I/LoggingInterceptor(23131): Server: my_server
03-23 15:28:35.842: I/LoggingInterceptor(23131): OkHttp-Selected-Protocol: http/1.1
03-23 15:28:35.842: I/LoggingInterceptor(23131): OkHttp-Sent-Millis: 1427120911246
03-23 15:28:35.842: I/LoggingInterceptor(23131): OkHttp-Received-Millis: 1427120915840
03-23 15:28:35.845: D/MainActivity(23131): [com.myapp.android.MainActivity$3.onResponse:170]
03-23 15:28:36.036: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=1.
03-23 15:28:36.038: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=1.
03-23 15:28:36.536: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:78] Connection count=1.
03-23 15:28:36.537: D/MainActivity(23131): [com.myapp.android.MainActivity$1$1.run:82] HTTP connection count=1.
...
Java doc of ConnectionPool class says:
Manages reuse of HTTP and SPDY connections for reduced network
latency. HTTP requests that share the same {#link
com.squareup.okhttp.Address} may share a {#link
com.squareup.okhttp.Connection}. This class implements the policy of
which connections to keep open for future use.
Since version 3 it possible to use queuedCallsCount and runningCallsCount
You need to check the ConnectionPool from the client instance.
int connections = getOkHttpClient().getConnectionPool().getConnectionCount();
int httpConnections = getOkHttpClient().getConnectionPool().getHttpConnectionCount();
My Activity is queuing work to an IntentService. When i debug, the code seems to run ok. when i run, i get the logcat results shown below. i added a thread.sleep(1000);, but no change in behavior. My assumption, based on the IntentService documentation is that if the IS is still active, it will queue the 2nd request and if it is inactive, it will restart. Therefore, it's ok to issue back-to-back startService() requests without concern for timing or callbacks with status.
two different intents, bundles and arrays:
final int[] arSim1Config = new int[10];
arSim1Config[0] = 2;
arSim1Config[1] = 101;
arSim1Config[2] = (int)simStartTs;
arSim1Config[3] = simStopTs;
arSim1Config[4] = 20;
arSim1Config[5] = 70;
arSim1Config[6] = 40;
arSim1Config[7] = 8000;
arSim1Config[8] = 5000;
arSim1Config[9] = 17000;
// launch simulator threads using test parameters
Intent inStartSim = new Intent(this, SimService.class);
inStartSim.setAction("genData");
Bundle simBundle = new Bundle();
simBundle.putIntArray("simConfigAr",arSim1Config);
inStartSim.putExtras(simBundle);
startService(inStartSim);
final int[] arSim2Config = new int[10];
arSim2Config[0] = 2;
arSim2Config[1] = 102;
arSim2Config[2] = (int)simStartTs;
arSim2Config[3] = simStopTs;
arSim2Config[4] = 5;
arSim2Config[5] = 110;
arSim2Config[6] = 95;
arSim2Config[7] = 12000;
arSim2Config[8] = 5000;
rSim2Config[9] = 13000;
// launch simulator threads using test parameters
Intent inStartSim2 = new Intent(this, SimService.class);
inStartSim2.setAction("genData");
Bundle simBundle2 = new Bundle();
simBundle2.putIntArray("simConfigAr",arSim2Config);
inStartSim2.putExtras(simBundle2);
startService(inStartSim2);
logcat:
01-30 17:11:34.706 4075-4075/com.smartmedtek.prj.smartmed03 I/art﹕ Not late-enabling -Xcheck:jni (already on)
01-30 17:11:34.821 4075-4075/com.smartmedtek.prj.smartmed03 W/ActivityThread﹕ Application com.smartmedtek.prj.smartmed03 is waiting for the debugger on port 8100...
01-30 17:11:34.831 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ Sending WAIT chunk
01-30 17:11:34.844 4075-4082/com.smartmedtek.prj.smartmed03 I/art﹕ Debugger is active
01-30 17:11:34.845 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ Debugger has connected
01-30 17:11:34.845 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.071 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.281 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.500 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.720 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.932 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.151 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.361 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.571 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.781 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.990 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:37.200 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:37.410 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:37.621 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ debugger has settled (1434)
01-30 17:11:37.979 4075-4075/com.smartmedtek.prj.smartmed03 D/MainActivity﹕ onCreate() No saved state available
01-30 17:11:38.049 4075-4095/com.smartmedtek.prj.smartmed03 D/OpenGLRenderer﹕ Render dirty regions requested: true
01-30 17:11:38.052 4075-4075/com.smartmedtek.prj.smartmed03 D/﹕ HostConnection::get() New Host Connection established 0xa6bdaf50, tid 4075
01-30 17:11:38.055 4075-4075/com.smartmedtek.prj.smartmed03 D/Atlas﹕ Validating map...
01-30 17:11:38.296 4075-4095/com.smartmedtek.prj.smartmed03 D/﹕ HostConnection::get() New Host Connection established 0xa5f0a230, tid 4095
01-30 17:11:38.319 4075-4095/com.smartmedtek.prj.smartmed03 I/OpenGLRenderer﹕ Initialized EGL, version 1.4
01-30 17:11:38.363 4075-4095/com.smartmedtek.prj.smartmed03 D/OpenGLRenderer﹕ Enabling debug mode 0
01-30 17:11:38.387 4075-4095/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:11:38.387 4075-4095/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5f2a460, error=EGL_SUCCESS
01-30 17:11:38.451 4075-4096/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.02172712E9
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.02172717E9
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.02172722E9
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:11:54.971 4075-4096/com.smartmedtek.prj.smartmed03 E/AndroidRuntime﹕ FATAL EXCEPTION: IntentService[SimService]
Process: com.smartmedtek.prj.smartmed03, PID: 4075
java.lang.NullPointerException: Attempt to get length of null array
at com.smartmedtek.prj.smartmed03.SimService.onHandleIntent(SimService.java:117)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
01-30 17:11:55.057 4075-4075/com.smartmedtek.prj.smartmed03 I/Choreographer﹕ Skipped 995 frames! The application may be doing too much work on its main thread.
01-30 17:12:20.776 4075-4075/com.smartmedtek.prj.smartmed03 D/MainActivity﹕ onCreate() No saved state available
01-30 17:12:20.905 4075-4095/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:12:20.905 4075-4095/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5f2a460, error=EGL_SUCCESS
01-30 17:12:21.184 4075-4095/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:12:21.184 4075-4095/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5f9a9c0, error=EGL_SUCCESS
01-30 17:16:55.107 4075-4096/com.smartmedtek.prj.smartmed03 I/Process﹕ Sending signal. PID: 4075 SIG: 9
01-30 17:16:55.732 4123-4123/com.smartmedtek.prj.smartmed03 D/MainActivity﹕ onCreate() Restoring previous state
01-30 17:16:55.786 4123-4138/com.smartmedtek.prj.smartmed03 D/OpenGLRenderer﹕ Render dirty regions requested: true
01-30 17:16:55.846 4123-4123/com.smartmedtek.prj.smartmed03 D/﹕ HostConnection::get() New Host Connection established 0xa6c7d660, tid 4123
01-30 17:16:55.915 4123-4123/com.smartmedtek.prj.smartmed03 D/Atlas﹕ Validating map...
01-30 17:16:55.984 4123-4138/com.smartmedtek.prj.smartmed03 D/﹕ HostConnection::get() New Host Connection established 0xa6c7d950, tid 4138
01-30 17:16:56.084 4123-4138/com.smartmedtek.prj.smartmed03 I/OpenGLRenderer﹕ Initialized EGL, version 1.4
01-30 17:16:56.111 4123-4138/com.smartmedtek.prj.smartmed03 D/OpenGLRenderer﹕ Enabling debug mode 0
01-30 17:16:56.138 4123-4138/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:16:56.138 4123-4138/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa6caccc0, error=EGL_SUCCESS
01-30 17:16:56.471 4123-4138/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:16:56.472 4123-4138/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa6cacdc0, error=EGL_SUCCESS
01-30 17:16:56.545 4123-4140/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:16:56.545 4123-4140/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.022045268E9
01-30 17:16:56.545 4123-4140/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.022045318E9
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.022045368E9
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:16:56.551 4123-4140/com.smartmedtek.prj.smartmed03 E/AndroidRuntime﹕ FATAL EXCEPTION: IntentService[SimService]
Process: com.smartmedtek.prj.smartmed03, PID: 4123
java.lang.NullPointerException: Attempt to get length of null array
at com.smartmedtek.prj.smartmed03.SimService.onHandleIntent(SimService.java:117)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
01-30 17:21:56.621 4123-4140/com.smartmedtek.prj.smartmed03 I/Process﹕ Sending signal. PID: 4123 SIG: 9
01-30 17:11:34.706 4075-4075/com.smartmedtek.prj.smartmed03 I/art﹕ Not late-enabling -Xcheck:jni (already on)
01-30 17:11:34.821 4075-4075/com.smartmedtek.prj.smartmed03 W/ActivityThread﹕ Application com.smartmedtek.prj.smartmed03 is waiting for the debugger on port 8100...
01-30 17:11:34.831 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ Sending WAIT chunk
01-30 17:11:34.844 4075-4082/com.smartmedtek.prj.smartmed03 I/art﹕ Debugger is active
01-30 17:11:34.845 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ Debugger has connected
01-30 17:11:34.845 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.071 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.281 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.500 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.720 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:35.932 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.151 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.361 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.571 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.781 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:36.990 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:37.200 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:37.410 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ waiting for debugger to settle...
01-30 17:11:37.621 4075-4075/com.smartmedtek.prj.smartmed03 I/System.out﹕ debugger has settled (1434)
01-30 17:11:37.979 4075-4075/com.smartmedtek.prj.smartmed03 D/MainActivity﹕ onCreate() No saved state available
01-30 17:11:38.049 4075-4095/com.smartmedtek.prj.smartmed03 D/OpenGLRenderer﹕ Render dirty regions requested: true
01-30 17:11:38.052 4075-4075/com.smartmedtek.prj.smartmed03 D/﹕ HostConnection::get() New Host Connection established 0xa6bdaf50, tid 4075
01-30 17:11:38.055 4075-4075/com.smartmedtek.prj.smartmed03 D/Atlas﹕ Validating map...
01-30 17:11:38.296 4075-4095/com.smartmedtek.prj.smartmed03 D/﹕ HostConnection::get() New Host Connection established 0xa5f0a230, tid 4095
01-30 17:11:38.319 4075-4095/com.smartmedtek.prj.smartmed03 I/OpenGLRenderer﹕ Initialized EGL, version 1.4
01-30 17:11:38.363 4075-4095/com.smartmedtek.prj.smartmed03 D/OpenGLRenderer﹕ Enabling debug mode 0
01-30 17:11:38.387 4075-4095/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:11:38.387 4075-4095/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5f2a460, error=EGL_SUCCESS
01-30 17:11:38.451 4075-4096/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.02172712E9
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.02172717E9
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.02172722E9
01-30 17:11:38.452 4075-4096/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:11:54.971 4075-4096/com.smartmedtek.prj.smartmed03 E/AndroidRuntime﹕ FATAL EXCEPTION: IntentService[SimService]
Process: com.smartmedtek.prj.smartmed03, PID: 4075
java.lang.NullPointerException: Attempt to get length of null array
at com.smartmedtek.prj.smartmed03.SimService.onHandleIntent(SimService.java:117)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
01-30 17:11:55.057 4075-4075/com.smartmedtek.prj.smartmed03 I/Choreographer﹕ Skipped 995 frames! The application may be doing too much work on its main thread.
01-30 17:12:20.776 4075-4075/com.smartmedtek.prj.smartmed03 D/MainActivity﹕ onCreate() No saved state available
01-30 17:12:20.905 4075-4095/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:12:20.905 4075-4095/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5f2a460, error=EGL_SUCCESS
01-30 17:12:21.184 4075-4095/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:12:21.184 4075-4095/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa5f9a9c0, error=EGL_SUCCESS
01-30 17:16:55.107 4075-4096/com.smartmedtek.prj.smartmed03 I/Process﹕ Sending signal. PID: 4075 SIG: 9
01-30 17:16:55.732 4123-4123/com.smartmedtek.prj.smartmed03 D/MainActivity﹕ onCreate() Restoring previous state
01-30 17:16:55.786 4123-4138/com.smartmedtek.prj.smartmed03 D/OpenGLRenderer﹕ Render dirty regions requested: true
01-30 17:16:55.846 4123-4123/com.smartmedtek.prj.smartmed03 D/﹕ HostConnection::get() New Host Connection established 0xa6c7d660, tid 4123
01-30 17:16:55.915 4123-4123/com.smartmedtek.prj.smartmed03 D/Atlas﹕ Validating map...
01-30 17:16:55.984 4123-4138/com.smartmedtek.prj.smartmed03 D/﹕ HostConnection::get() New Host Connection established 0xa6c7d950, tid 4138
01-30 17:16:56.084 4123-4138/com.smartmedtek.prj.smartmed03 I/OpenGLRenderer﹕ Initialized EGL, version 1.4
01-30 17:16:56.111 4123-4138/com.smartmedtek.prj.smartmed03 D/OpenGLRenderer﹕ Enabling debug mode 0
01-30 17:16:56.138 4123-4138/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:16:56.138 4123-4138/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa6caccc0, error=EGL_SUCCESS
01-30 17:16:56.471 4123-4138/com.smartmedtek.prj.smartmed03 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-30 17:16:56.472 4123-4138/com.smartmedtek.prj.smartmed03 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa6cacdc0, error=EGL_SUCCESS
01-30 17:16:56.545 4123-4140/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:16:56.545 4123-4140/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.022045268E9
01-30 17:16:56.545 4123-4140/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.022045318E9
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/strmId val:﹕ 101.0
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/TS val:﹕ 1.022045368E9
01-30 17:16:56.546 4123-4140/com.smartmedtek.prj.smartmed03 D/ramp val:﹕ 70.0
01-30 17:16:56.551 4123-4140/com.smartmedtek.prj.smartmed03 E/AndroidRuntime﹕ FATAL EXCEPTION: IntentService[SimService]
Process: com.smartmedtek.prj.smartmed03, PID: 4123
java.lang.NullPointerException: Attempt to get length of null array
at com.smartmedtek.prj.smartmed03.SimService.onHandleIntent(SimService.java:117)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
01-30 17:21:56.621 4123-4140/com.smartmedtek.prj.smartmed03 I/Process﹕ Sending signal. PID: 4123 SIG: 9
I am trying to show one image from web service by consuming it.Well its working
fine.If i test my project with android versions like 2 - 3 versions its working fine.But it is not supporting over 4.0 and above. Why?
How to overcome this issue?
Following is my code,
Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(img_url).getContent());
imgvw.setImageBitmap(bitmap);
Logcat
03-23 14:59:17.696: I/System.out(386): Intent { cmp=com.example.png/.tab_cameraActivity }
03-23 14:59:17.696: I/System.out(386): LB 3
03-23 14:59:17.716: D/AndroidRuntime(386): Shutting down VM
03-23 14:59:17.716: W/dalvikvm(386): threadid=1: thread exiting with uncaught exception (group=0x40014760)
03-23 14:59:17.736: E/AndroidRuntime(386): FATAL EXCEPTION: main
03-23 14:59:17.736: E/AndroidRuntime(386): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.png/com.example.png.tab_cameraActivity}: android.os.NetworkOnMainThreadException
03-23 14:59:17.736: E/AndroidRuntime(386): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.app.ActivityThread.startActivityNow(ActivityThread.java:1577)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:130)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:342)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:680)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.widget.TabHost.setCurrentTab(TabHost.java:349)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:149)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:556)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.view.View.performClick(View.java:3100)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.view.View$PerformClick.run(View.java:11644)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.os.Handler.handleCallback(Handler.java:587)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.os.Handler.dispatchMessage(Handler.java:92)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.os.Looper.loop(Looper.java:126)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.app.ActivityThread.main(ActivityThread.java:3997)
03-23 14:59:17.736: E/AndroidRuntime(386): at java.lang.reflect.Method.invokeNative(Native Method)
03-23 14:59:17.736: E/AndroidRuntime(386): at java.lang.reflect.Method.invoke(Method.java:491)
03-23 14:59:17.736: E/AndroidRuntime(386): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
03-23 14:59:17.736: E/AndroidRuntime(386): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
03-23 14:59:17.736: E/AndroidRuntime(386): at dalvik.system.NativeStart.main(Native Method)
03-23 14:59:17.736: E/AndroidRuntime(386): Caused by: android.os.NetworkOnMainThreadException
03-23 14:59:17.736: E/AndroidRuntime(386): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1077)
03-23 14:59:17.736: E/AndroidRuntime(386): at java.net.InetAddress.lookupHostByName(InetAddress.java:481)
03-23 14:59:17.736: E/AndroidRuntime(386): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:281)
03-23 14:59:17.736: E/AndroidRuntime(386): at java.net.InetAddress.getAllByName(InetAddress.java:249)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:69)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:304)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:292)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:274)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:217)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:76)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:153)
03-23 14:59:17.736: E/AndroidRuntime(386): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
03-23 14:59:17.736: E/AndroidRuntime(386): at com.example.png.tab_cameraActivity.getImagesDetails(tab_cameraActivity.java:73)
03-23 14:59:17.736: E/AndroidRuntime(386): at com.example.png.tab_cameraActivity.onCreate(tab_cameraActivity.java:57)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
03-23 14:59:17.736: E/AndroidRuntime(386): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)
03-23 14:59:17.736: E/AndroidRuntime(386): ... 18 more
You are getting exception.
NetworkOnMainThreadException: The exception that is thrown when an application attempts to perform a networking operation on its main thread.
so you have to use AsyncTask.
Here is example of AsyncTask.
http://android-developers.blogspot.in/2009/05/painless-threading.html
Chances are that you execute this code inside the UI Thread. This is prohibited in Android HoneyComb and above. You should consider using an AsyncTask or an Android Service to perform this request. Different options are available to help you with that. As a contributor of RoboSpice, I believe this library would help.
This question already has answers here:
Phonegap app crashes when switched orientation even with AndroidManifest changes
(2 answers)
Closed 3 years ago.
I'm currently developing a small demo in PhoneGap to test out some functionalities. I want to use the PhoneGap-OrientationLock plugin available from Github to be able to dynamically change my screen orientation from JavaScript, I've updated the plugin to use it in Cordova.
My problem right now is that it crashes as soon as I want to change my screen orientation. Even if I try something as simple as setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); (without using PhoneGap technically) from my onCreate method, my application just quits to the launcher with the following debug log:
08-20 08:57:17.083: D/DroidGap(21383): DroidGap.onCreate()
08-20 08:57:17.193: D/CordovaWebView(21383): Origin to allow: http://127.0.0.1*
08-20 08:57:17.193: I/CordovaLog(21383): Found log level DEBUG
08-20 08:57:17.193: I/CordovaLog(21383): Changing log level to DEBUG(3)
08-20 08:57:17.193: I/CordovaLog(21383): Found preference for fullscreen=true
08-20 08:57:17.193: D/CordovaLog(21383): Found preference for fullscreen=true
08-20 08:57:17.193: I/CordovaLog(21383): Found preference for useBrowserHistory=false
08-20 08:57:17.193: D/CordovaLog(21383): Found preference for useBrowserHistory=false
08-20 08:57:17.223: D/DroidGap(21383): DroidGap.init()
08-20 08:57:17.223: D/CordovaWebView(21383): >>> loadUrl(file:///android_asset/www/index.html)
08-20 08:57:17.223: D/PluginManager(21383): init()
08-20 08:57:17.233: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.243: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.243: D/DroidGap(21383): onDestroy()
08-20 08:57:17.243: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.243: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.263: D/DroidGap(21383): DroidGap.onCreate()
08-20 08:57:17.263: D/CordovaWebView(21383): Origin to allow: http://127.0.0.1*
08-20 08:57:17.263: I/CordovaLog(21383): Found log level DEBUG
08-20 08:57:17.263: I/CordovaLog(21383): Changing log level to DEBUG(3)
08-20 08:57:17.263: I/CordovaLog(21383): Found preference for fullscreen=true
08-20 08:57:17.263: D/CordovaLog(21383): Found preference for fullscreen=true
08-20 08:57:17.263: I/CordovaLog(21383): Found preference for useBrowserHistory=false
08-20 08:57:17.263: D/CordovaLog(21383): Found preference for useBrowserHistory=false
08-20 08:57:17.273: D/DroidGap(21383): DroidGap.init()
08-20 08:57:17.273: D/CordovaWebView(21383): >>> loadUrl(file:///android_asset/www/index.html)
08-20 08:57:17.273: D/PluginManager(21383): init()
08-20 08:57:17.293: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.313: D/DroidGap(21383): onMessage(onPageStarted,file:///android_asset/www/index.html)
08-20 08:57:17.313: D/SoftKeyboardDetect(21383): Ignore this event
08-20 08:57:17.373: D/SoftKeyboardDetect(21383): Ignore this event
08-20 08:57:17.483: D/Cordova(21383): onPageFinished(file:///android_asset/www/index.html)
08-20 08:57:17.483: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:17.483: D/DroidGap(21383): onMessage(onNativeReady,null)
08-20 08:57:17.483: D/DroidGap(21383): onMessage(onPageFinished,file:///android_asset/www/index.html)
08-20 08:57:17.483: D/DroidGap(21383): onMessage(onPageStarted,about:blank)
08-20 08:57:17.503: D/dalvikvm(21383): GC_CONCURRENT freed 326K, 9% free 7566K/8263K, paused 8ms+2ms, total 33ms
08-20 08:57:17.513: D/Cordova(21383): onPageFinished(about:blank)
08-20 08:57:17.513: D/DroidGap(21383): onMessage(onPageFinished,about:blank)
08-20 08:57:17.513: D/DroidGap(21383): onMessage(exit,null)
08-20 08:57:17.563: D/DroidGap(21383): onMessage(onPageStarted,file:///android_asset/www/index.html)
08-20 08:57:17.563: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:18.023: D/Cordova(21383): onPageFinished(file:///android_asset/www/index.html)
08-20 08:57:18.023: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:18.023: D/DroidGap(21383): onMessage(onNativeReady,null)
08-20 08:57:18.023: D/DroidGap(21383): onMessage(onPageFinished,file:///android_asset/www/index.html)
08-20 08:57:18.053: E/SQLiteLog(21383): (14) cannot open file at line 30174 of [00bb9c9ce4]
08-20 08:57:18.053: E/SQLiteLog(21383): (14) os_unix.c:30174: (2) open(/CachedGeoposition.db) -
08-20 08:57:18.053: D/WebKit(21383): ERROR:
08-20 08:57:18.053: D/WebKit(21383): SQLite database failed to load from /CachedGeoposition.db
08-20 08:57:18.053: D/WebKit(21383): Cause - unable to open database file
08-20 08:57:18.053: D/WebKit(21383): external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cpp(71) : bool WebCore::SQLiteDatabase::open(const WTF::String&, bool)
08-20 08:57:18.143: D/DroidGap(21383): onMessage(networkconnection,wifi)
08-20 08:57:18.183: D/DroidGap(21383): onMessage(spinner,stop)
08-20 08:57:18.223: W/IInputConnectionWrapper(21383): showStatusIcon on inactive InputConnection
08-20 08:57:18.263: D/DroidGap(21383): onDestroy()
08-20 08:57:18.263: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:18.263: D/CordovaWebView(21383): >>> loadUrlNow()
08-20 08:57:18.283: D/DroidGap(21383): onMessage(onPageStarted,about:blank)
08-20 08:57:18.303: D/Cordova(21383): onPageFinished(about:blank)
08-20 08:57:18.303: D/DroidGap(21383): onMessage(onPageFinished,about:blank)
08-20 08:57:18.303: D/DroidGap(21383): onMessage(exit,null)
08-20 08:57:19.483: D/DroidGap(21383): onMessage(spinner,stop)
08-20 08:57:19.513: D/DroidGap(21383): onMessage(spinner,stop)
08-20 08:57:20.023: D/DroidGap(21383): onMessage(spinner,stop)
So it looks like as soon as I call setRequestedOrientation like so:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
super.loadUrl("file:///android_asset/www/index.html");
}
My application calls onDestroy and goes back to the launcher. Am I just not understanding an Android concept? Anyone has a clue?
You should add android:configChanges="orientation|keyboardHidden" in the Android Manifest in the first <activity> that appears. I had the same problem, it crashed my app too.