2016-09-29 3 views
0

Создал текстовое представление, которое заполняется данными получения, и я добавил образец кода ответа json в код. Но я не получаю HTTP GET Response.Не получать http GET Response

Мой код выглядит следующим образом:

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();} 

Бревно:

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 
+0

Вы получаете исключение? – dipali

+0

не уверен, но если сеть, я думаю, нужно добавить async task/running thread ?? – kyorilys

+0

положить этот код в нить – dipali

ответ

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(); 
+1

allNotifications.setText ("Hi:" + response.toString()); Должен быть на UIThread, иначе он пойдет не так :) – QVDev

+0

Я прошу нажать кнопку haha ​​ – kyorilys

+0

Спасибо. Я думаю, что это может быть решением текущей проблемы, на которой я застрял. Можете ли вы дать мне знать, как получить поток пользовательского интерфейса, поскольку я не создал ни одного нового потока. Нужно ли мне делать Thread.currentThread и как? – Santanu

0

Похоже, вам нужно позвонить urlConnection.connect() перед вызовом getInputStream()

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(); 

попробовать этот код. это будет работать .

+0

dipali: Спасибо. Я использовал этот код для редактирования, он печатает данные на консоли с помощью Log.i, но не в текстовом виде. Что я получаю? Я добавил комментарий выше. – Santanu