I got the weather information of Beijing from the following code, but I got the wrong one,displayed scrambled.And I also want to know,if I got the right info,how to display informtions in my activity.Thanks!
I want the follow result:
but the cod give me like this:
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim job1 As HttpJob
job1.Initialize("Job1", Me)
job1.Download("http://wthrcdn.etouch.cn/WeatherApi?city=北京")
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Log(Job.GetString)
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub
HTML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<resp>
<!---->
<city>北京</city>
<updatetime>17:52</updatetime>
<wendu>31</wendu>
<fengli>
<shidu>56%</shidu>
<fengxiang>东北风</fengxiang>
<sunrise_1>05:03</sunrise_1>
<sunset_1>19:37</sunset_1>
<sunrise_2/>
<sunset_2/>
<environment>
<yesterday>
<forecast>
<weather>
<weather>
<weather>
<weather>
<weather>
</forecast>
<zhishus>
</resp>
HTML:
** Service (httputils2service) Start **
JobName = Job1, Success = true
����������������X[oG�+N�J�*ga��N6�Z�R��OQT!{cSap��'v��
;\L�c�5_bx�_���ݧ�ف5Ƹ!iZ 1�gf���w.���LO8�n���}�|�t�Ot��F�α��}p����EϤ�F�����q����yE�}B�7�-ĵI�3�9:%Ẍc3�Xt�9����ǟ�>��W� �k-x��o��7�cS�ȴ������(��$�3�t�=�of�40l�����03���ԗسq���Ɓ��9�O�n�sBtzd{b����hr�̃��'pzlL�x��W���$)g;T�o��cR��<��6�'S6%P��!��~���r�w9S^��� �$.�`6�QшK0A \���X`�<.^��� _t���(� >�cQ�.�8�D�
��@_��$�dm���q��������a���He��b��?���9\�`��Q���kLjg���jpf]� =����f8Ҍ�.u��V�X�F��\S��{۔kem����/WRF6uя,�
�\=�]nq�F��L�y�E7cL��s�2{�/Ɩ���Jg��i�œ�sC�G1Ã�z�ND.�Dg����\�tպK-m1�p��z��T��t0d1�+�]�?����
z�J����|���d��9?R�?���v��*��%�:��3M|A����b��~?_����3xހ66�}"���N��k=�y��c����&��6A��+�y�WGp���S�cJԳy��)�1�6�C �E-!Gŏ����� >��̪�RU�j�a�,K������9\�ԃ|ZTg}r�%���
��1�G�&�DIK����"���j�=-��g��(�:\Nj���Kԛ�<����r5B;��^\h�����
d8A6�ʺ��lj?F]S���fwHh��6��^���rm������,mh��2_�����Cփ�^CM�v��2��g����Q�:��欲]P��f}t��lM20QW�x�������H*\ę.�TD�
���N�)��/�\�k�S����fZ��hRs,��l7�$%�ѬGD �J�5p ��j�~Y�*{�z4OB
H���jV[{ǔ�?yF�]��
`�Δ�5�yVKͪ9��J9,�T�V����3A�p ��N ���~o�NR�\Q�D������a|v���E���Z��k$