0

I Created a text view that is getting populated with the get data and I have added a sample json response url in the code. But I am not getting HTTP GET Response.

My Code is following:

allNotifications = (TextView)view.findViewById(R.id.getresponse);
    allNotifications.setText("hello");
    try {
        //URL url = new URL("http://192.168.2.5:5213/controller/moodoff/notifications/9681578989");
        URL url = new URL("http://echo.jsontest.com/key/value/one/two");
        HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
        InputStream is = urlConnection.getInputStream();
        InputStreamReader isr = new InputStreamReader(is);
        int data = isr.read();
        StringBuilder response = new StringBuilder("");
        if(data!=-1){
            response.append((char)data);
            data = isr.read();
        }
        allNotifications.setText("Hi:"+response.toString());
    }catch(Exception ee){allNotifications.setText(ee.getMessage());ee.printStackTrace();}

The Log is:

 09-29 12:45:21.826 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:45:22.748 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:45:22.750 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:45:22.750 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:45:22.750 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 192
09-29 12:45:34.125 895-943/? E/WifiStateMachine: syncGetLinkLayerStats called, stack: [Ljava.lang.StackTraceElement;@c8a7cd0
09-29 12:45:34.324 23660-23660/? E/WifiManager: mWifiServiceMessenger == null
09-29 12:45:34.753 23660-23660/? E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
09-29 12:45:34.830 10385-10431/? E/NativeCrypto: ssl=0x7f7b991a00 cert_verify_callback x509_store_ctx=0x7f7bafe9a0 arg=0x0
09-29 12:45:34.830 10385-10431/? E/NativeCrypto: ssl=0x7f7b991a00 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA
09-29 12:45:35.346 23660-23726/? E/YouTube: Invalid playback type; playback will not start.
09-29 12:45:35.614 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:45:36.590 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:45:36.592 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:45:36.592 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:45:36.592 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 193
09-29 12:45:36.810 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:45:37.741 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:45:37.743 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:45:37.744 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:45:37.744 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 194
09-29 12:45:39.534 10385-10480/? E/NativeCrypto: ssl=0x7f4e067380 cert_verify_callback x509_store_ctx=0x7f7a4fe220 arg=0x0
09-29 12:45:39.534 10385-10480/? E/NativeCrypto: ssl=0x7f4e067380 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_ECDSA
09-29 12:45:43.009 895-1422/? E/Sensors: handleToDriver handle(0)
09-29 12:45:43.010 895-1422/? E/Sensors: handleToDriver handle(0)
09-29 12:45:43.011 895-1422/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:45:43.026 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:45:43.043 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:45:46.772 895-5585/? E/Sensors: handleToDriver handle(0)
09-29 12:45:47.920 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:47.923 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:47.927 3154-3154/? E/SIMInfo: SimStatusChangeReceiver, ss=null
09-29 12:45:47.981 3154-23992/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:47.983 3154-23992/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:47.998 3154-23992/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:48.000 3154-23992/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:49.641 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:49.642 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:49.644 3154-3154/? E/SIMInfo: SimStatusChangeReceiver, ss=null
09-29 12:45:49.690 3154-24018/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:49.693 3154-24018/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:49.702 3154-24018/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:49.704 3154-24018/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:45:51.845 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:45:52.726 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:45:52.732 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:45:52.732 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:45:52.733 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 195
09-29 12:45:54.294 19176-19209/? E/NativeCrypto: ssl=0x7f7b57b300 cert_verify_callback x509_store_ctx=0x7f7b8b43a0 arg=0x0
09-29 12:45:54.294 19176-19209/? E/NativeCrypto: ssl=0x7f7b57b300 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA
09-29 12:46:06.832 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:46:07.783 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:46:07.785 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:46:07.785 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:46:07.785 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 196
09-29 12:46:14.900 895-906/? E/Sensors: handleToDriver handle(0)
09-29 12:46:14.902 895-906/? E/Sensors: handleToDriver handle(0)
09-29 12:46:14.902 895-906/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:46:15.824 895-1614/? E/Sensors: handleToDriver handle(0)
09-29 12:46:21.846 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:46:22.943 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:46:22.946 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:46:22.946 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:46:22.946 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 197
09-29 12:46:36.857 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:46:37.873 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:46:37.876 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:46:37.876 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:46:37.876 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 198
09-29 12:46:43.929 895-905/? E/Sensors: handleToDriver handle(0)
09-29 12:46:43.930 895-905/? E/Sensors: handleToDriver handle(0)
09-29 12:46:43.931 895-905/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:46:44.873 895-3286/? E/Sensors: handleToDriver handle(0)
09-29 12:46:51.888 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:46:52.957 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:46:52.960 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:46:52.960 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:46:52.960 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 199
09-29 12:47:06.901 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:47:07.999 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:47:08.002 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:47:08.002 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:47:08.002 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 200
09-29 12:47:12.990 895-1559/? E/Sensors: handleToDriver handle(0)
09-29 12:47:12.991 895-1559/? E/Sensors: handleToDriver handle(0)
09-29 12:47:12.991 895-1559/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:47:13.912 895-906/? E/Sensors: handleToDriver handle(0)
09-29 12:47:21.908 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:47:22.953 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:47:22.955 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:47:22.956 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:47:22.956 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 201
09-29 12:47:36.909 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:47:38.062 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:47:38.067 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:47:38.067 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:47:38.067 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 202
09-29 12:47:43.061 895-905/? E/Sensors: handleToDriver handle(0)
09-29 12:47:43.063 895-905/? E/Sensors: handleToDriver handle(0)
09-29 12:47:43.063 895-905/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:47:43.080 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:47:43.096 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:47:43.985 895-1613/? E/Sensors: handleToDriver handle(0)
09-29 12:47:46.508 10385-10428/? E/NativeCrypto: ssl=0x7f727c4580 cert_verify_callback x509_store_ctx=0x7f7bdbe2f0 arg=0x0
09-29 12:47:46.508 10385-10428/? E/NativeCrypto: ssl=0x7f727c4580 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA
09-29 12:47:51.945 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:47:52.916 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:47:52.919 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:47:52.919 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:47:52.919 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 203
09-29 12:48:06.932 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:48:07.925 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:48:07.929 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:48:07.929 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:48:07.930 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 204
09-29 12:48:12.086 895-905/? E/Sensors: handleToDriver handle(0)
09-29 12:48:12.092 895-905/? E/Sensors: handleToDriver handle(0)
09-29 12:48:12.092 895-905/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:48:13.013 895-1422/? E/Sensors: handleToDriver handle(0)
09-29 12:48:21.945 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:48:22.923 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:48:22.925 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:48:22.925 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:48:22.925 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 205
09-29 12:48:36.951 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:48:38.039 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:48:38.044 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:48:38.044 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:48:38.044 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 206
09-29 12:48:41.139 895-1558/? E/Sensors: handleToDriver handle(0)
09-29 12:48:41.140 895-1558/? E/Sensors: handleToDriver handle(0)
09-29 12:48:41.140 895-1558/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:48:42.070 895-1559/? E/Sensors: handleToDriver handle(0)
09-29 12:48:51.986 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:48:52.937 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:48:52.940 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:48:52.940 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:48:52.940 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 207
09-29 12:49:06.975 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:49:07.878 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:49:07.880 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:49:07.880 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:49:07.880 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 208
09-29 12:49:10.179 895-5661/? E/Sensors: handleToDriver handle(0)
09-29 12:49:10.181 895-5661/? E/Sensors: handleToDriver handle(0)
09-29 12:49:10.181 895-5661/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:49:11.103 895-3565/? E/Sensors: handleToDriver handle(0)
09-29 12:49:22.010 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:49:22.956 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:49:22.959 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:49:22.959 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:49:22.959 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 209
09-29 12:49:37.003 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:49:37.910 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:49:37.914 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:49:37.914 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:49:37.915 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 210
09-29 12:49:43.123 895-905/? E/Sensors: handleToDriver handle(0)
09-29 12:49:43.125 895-905/? E/Sensors: handleToDriver handle(0)
09-29 12:49:43.125 895-905/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:49:43.143 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:49:43.160 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:49:43.405 2531-27476/? E/memtrack_graphic: graphic_memtrack_get_memory error to open /sys/kernel/debug/ion/clients/2531: Permission denied
09-29 12:49:46.886 895-1501/? E/Sensors: handleToDriver handle(0)
09-29 12:49:52.037 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:49:53.037 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:49:53.040 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:49:53.041 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:49:53.041 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 211
09-29 12:50:07.050 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:50:08.044 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:50:08.047 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:50:08.047 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:50:08.047 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 212
09-29 12:50:15.084 895-3565/? E/Sensors: handleToDriver handle(0)
09-29 12:50:15.086 895-3565/? E/Sensors: handleToDriver handle(0)
09-29 12:50:15.086 895-3565/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:50:16.011 895-5661/? E/Sensors: handleToDriver handle(0)
09-29 12:50:22.047 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:50:23.081 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:50:23.083 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:50:23.084 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:50:23.084 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 213
09-29 12:50:37.053 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:50:38.013 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:50:38.017 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:50:38.017 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:50:38.017 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 214
09-29 12:50:44.095 895-1614/? E/Sensors: handleToDriver handle(0)
09-29 12:50:44.097 895-1614/? E/Sensors: handleToDriver handle(0)
09-29 12:50:44.097 895-1614/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:50:45.081 895-5663/? E/Sensors: handleToDriver handle(0)
09-29 12:50:52.080 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:50:53.018 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:50:53.021 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:50:53.021 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:50:53.021 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 215
09-29 12:51:07.074 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:51:07.967 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:51:07.970 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:51:07.970 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:51:07.970 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 216
09-29 12:51:13.187 895-5661/? E/Sensors: handleToDriver handle(0)
09-29 12:51:13.189 895-5661/? E/Sensors: handleToDriver handle(0)
09-29 12:51:13.189 895-5661/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:51:14.106 895-905/? E/Sensors: handleToDriver handle(0)
09-29 12:51:22.107 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:51:23.054 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:51:23.056 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:51:23.056 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:51:23.057 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 217
09-29 12:51:33.052 29082-29100/? E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
09-29 12:51:37.102 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:51:38.019 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:51:38.021 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:51:38.021 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:51:38.021 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 218
09-29 12:51:44.157 895-3286/? E/Sensors: handleToDriver handle(0)
09-29 12:51:44.158 895-3286/? E/Sensors: handleToDriver handle(0)
09-29 12:51:44.158 895-3286/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:51:44.174 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:51:44.190 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:51:45.084 895-5663/? E/Sensors: handleToDriver handle(0)
09-29 12:51:46.091 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:46.092 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:46.094 3154-3154/? E/SIMInfo: SimStatusChangeReceiver, ss=null
09-29 12:51:46.120 3154-29330/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:46.121 3154-29330/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:46.129 3154-29330/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:46.130 3154-29330/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:49.048 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:49.049 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:49.051 3154-3154/? E/SIMInfo: SimStatusChangeReceiver, ss=null
09-29 12:51:49.082 3154-29373/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:49.083 3154-29373/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:49.090 3154-29373/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:49.091 3154-29373/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:50.761 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:50.764 3154-3154/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:50.767 3154-3154/? E/SIMInfo: SimStatusChangeReceiver, ss=null
09-29 12:51:50.801 3154-29399/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:50.802 3154-29399/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:50.808 3154-29399/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:50.809 3154-29399/? E/SIMInfo: info.mWapPush init error, not support in FW.
09-29 12:51:52.122 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:51:53.148 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:51:53.151 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:51:53.151 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:51:53.151 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 219
09-29 12:52:07.147 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:52:07.618 21240-21240/com.moodoff E/MultiWindowProxy: getServiceInstance failed!
09-29 12:52:07.800 19622-19622/? E/MultiWindowProxy: getServiceInstance failed!
09-29 12:52:08.191 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:52:08.193 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:52:08.193 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:52:08.193 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 220
09-29 12:52:13.177 895-1422/? E/Sensors: handleToDriver handle(0)
09-29 12:52:13.178 895-1422/? E/Sensors: handleToDriver handle(0)
09-29 12:52:13.178 895-1422/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:52:14.100 895-5663/? E/Sensors: handleToDriver handle(0)
09-29 12:52:22.148 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:52:23.299 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:52:23.313 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:52:23.313 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:52:23.313 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 221
09-29 12:52:37.151 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:52:38.184 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:52:38.202 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:52:38.202 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:52:38.202 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 222
09-29 12:52:42.196 895-3564/? E/Sensors: handleToDriver handle(0)
09-29 12:52:42.198 895-3564/? E/Sensors: handleToDriver handle(0)
09-29 12:52:42.198 895-3564/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:52:43.120 895-5663/? E/Sensors: handleToDriver handle(0)
09-29 12:52:52.165 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:52:53.246 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:52:53.249 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:52:53.249 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:52:53.249 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 223
09-29 12:53:07.176 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:53:08.278 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:53:08.282 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:53:08.282 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false

09-29 12:53:14.371 2131-2226/? E/CellLocation: create GsmCellLocation
09-29 12:53:22.207 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:53:23.360 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:53:23.365 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:53:23.365 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:53:23.365 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 225
09-29 12:53:37.201 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:53:38.163 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:53:38.166 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:53:38.166 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:53:38.166 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 226
09-29 12:53:45.182 895-3565/? E/Sensors: handleToDriver handle(0)
09-29 12:53:45.183 895-3565/? E/Sensors: handleToDriver handle(0)
09-29 12:53:45.184 895-3565/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
09-29 12:53:45.246 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:53:45.266 2131-2246/? E/CellLocation: create GsmCellLocation
09-29 12:53:48.946 895-1559/? E/Sensors: handleToDriver handle(0)
09-29 12:53:52.235 895-8341/? E/WifiMonitor: handleEvent unknown: 14  CTRL-EVENT-SCAN-STARTED 
09-29 12:53:53.362 895-1191/? E/WifiConfigStore: setLastSelectedConfiguration -1
09-29 12:53:53.364 895-1191/? E/WifiConfigStore:  writeKnownNetworkHistory() num networks:3 needWrite=false
09-29 12:53:53.364 895-1191/? E/WifiStateMachine: mIsFullScanOngoing: true, mSendScanResultsBroadcast: false
09-29 12:53:53.364 895-1191/? E/WifiStateMachine: mWifiOnScanCount: 227
7
  • you getting exception? Commented Sep 29, 2016 at 7:21
  • not sure but if network I think need add async task/running thread?? Commented Sep 29, 2016 at 7:22
  • put this code in thread Commented Sep 29, 2016 at 7:23
  • no exception as such. Commented Sep 29, 2016 at 7:23
  • Please add more debug information, what is happening? And what is what you expect to be happening? As you say a textview is getting populated but not getting a GET response? Commented Sep 29, 2016 at 7:23

3 Answers 3

1
new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    //URL url = new URL("http://192.168.2.5:5213/controller/moodoff/notifications/9681578989");
                    URL url = new URL("http://echo.jsontest.com/key/value/one/two");
                    HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
                    InputStream is = urlConnection.getInputStream();
                    InputStreamReader isr = new InputStreamReader(is);
                    int data = isr.read();
                    StringBuilder response = new StringBuilder("");
                    if(data!=-1){
                        response.append((char)data);
                        data = isr.read();
                    }
                    Log.i("TAG","Response:="+response.toString());
                    //allNotifications.setText("Hi:"+response.toString());
                }catch(Exception ee){allNotifications.setText(ee.getMessage());ee.printStackTrace();}
            }
        }).start();

try this code. it will work .

Sign up to request clarification or add additional context in comments.

1 Comment

dipali: Thank you. I have used this code for editing, it is printing the data in console using Log.i, but not in the textview. What am i getting? I have added a comment above.
1
 new Thread(new Runnable() {
        public void run() {
            URL url = new URL("http://echo.jsontest.com/key/value/one/two");
            HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
            InputStream is = urlConnection.getInputStream();
            InputStreamReader isr = new InputStreamReader(is);
            int data = isr.read();
            StringBuilder response = new StringBuilder("");
            if(data!=-1){
                 response.append((char)data);
                 data = isr.read();
             }
        // code below need put back to main thread
            runOnUiThread(new Runnable() {

                    @Override
                    public void run() {
                        allNotifications.setText("Hi:"+response.toString());
                    }
                });

                }
            });
        }
    }).start();

4 Comments

allNotifications.setText("Hi:"+response.toString()); Should be on the UIThread otherwise it will go wrong :)
I miss press button haha
Thank You. I think this could be the solution to the current issue i am stuck on. Can you let me know how to get the UI thread as i have not spawned any new thread. Do i need to do Thread.currentThread and how?
Suppose it will be work if add into the runOnUiThread.if cannot then you may try out the async task. developer.android.com/reference/android/os/AsyncTask.html
0

Looks like you need to call urlConnection.connect() before calling getInputStream()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.