Www Tomil Sax

<info>http://www.YOBO.com/song/index/8319</info <image>http://www.YOBO.com/artist/index/2304</image> <extension application-"http://www.YOBO.com">

<artistpage>http: / /www . YOBO . com/artist./ index/2304</artistpage> <albumpage>http://www.YOBO.corn/album/index/14 079</albumpage> <trackpage>http://www.YOBO.com/song/index/8319</trackpage>

\ ftfttfffi h.ifii&ut&mmxspFts^wrt^, t&ws«zmiuzmmm»!

WtitmiifT XSPF foiWl• fllJill-JlJA-H^^Bi, f,Vj AAndroid hffife, ft fflKfig^a^fET.

■i'm xspf miaimi)-^ yoboapi tf-lfal&n■■UHii''-}%Mtir fjil..M Java dom MM xml aMil] sax -xm^ xspf.

y< r/mffi xml dom sax, ^gtsffiafsjwttfflwi:*«». a h£ju sax m uf XML so®. 12 ft^s—t*».* n

DefaultHandler fl<Jii?rrS (Parser), . &JftftMJU

public void parse(> throws Exception (

SAXParserFactory spr = SAXParserFactory.newTnstance();

SAXParser sp spf.newSAXParser();

XMLReader xr = sp.getXMLReader();

xr.setContentHandler(this);

InputStream is = null;

URL url = new URL(playlistUrl);

URLConnection uc url.openConnection();

is = uc.getInputStream();

playlist - new Playlist();

ready = false;

xr.parse(new InputSource(is)); )

¡f&fft URL iJUfcnfi&rtS. i\-m\ XMLReader Xi&ffl parse Mtiu startElement, endHlement, characters ¡¿Jl^MIM^WllWM f, K: ftM(JXML 1 (1 Ai#JI f.W^ll^^'rt^f^H'iM^ii'in], Mj W#^/YOBC).Android/src/us/imnet/iceskysl/xspf KM Parser.java.. m ^ PlayListActivity ^S^»®^. 'eWjfeffiKSttWifi-^ Activity ft, Ks

private void revParamsO { Intent startinglntent = get Intent-() ; if (startinglntent != null) { Bundle playlist startinglntent

.getBundleExtra("android.intent.extra.playlist") ; if (playlist == null) ( is valid - false; } else (

id = playlist.getString("id") ; name = pi a y11st.ge tSt ring("name"); type = playlist.getString("type") ; is valid = true; )

is valid false;

tt-f$i»flfc* 3 Ill T- type ífifcftSJé ftftfbft. «JíSjBKfícJKDC type -¿ftifil u

@Override public void onCreate(Bundle savedlnstanceState) 1 super.onCreate(savedlnstanceState); setContentView(R.layout.box) ; setTitie("YOBO: " + name); revPa rams();

this.bindService(new Intent(PlayListAct i vity.this, YPRService.class) , mConnection, Context.BIND AUTO_CREATE); String url build url(id,type); Parser parser = new Parser(url); try (

playlist - parser.getPlaylist(); } catch (Exception e) 1

e.printStackTrace{); }

parser.parse()$C j¿ W1fjIJÍJ ifllíf\l XML MfcW&W. XML fMnM

& parser, get PI ay I ist() ík $ $ ^ tffc ill] £, ill 1*1 15-13 f)f/j<o tm YOBO API (tí ft lift HJJ, ^fflliLW&r it

%mimaffiriHffj&HiftS* h-a, xsRFfó^M XML

Hi ifii ú&kf s« Jitt m « itii m * r. ií í'f a? s &« &sft iiii £ w # « » j-a m r. A:

^Ijlj-IÍII!><J^J:^f-^trUl»jSRlilirr<Jííft/ji:^ 10 Service

Sflli&flMiJH AI DL( Android Interface Definition Language)^ Service ®ll, £ J A1DL fft frittf http://deveioper.android.com/guide/deveIoping/tooIs/aidl.html I, AIDL ft'j fftJi/

mikism AiDLift, ^aisu+M/rtt. vm*m aw*

BTífcíRfi«*5 AIDLifl . Jg£®»f»«IJ. i¿!R/fl Service &gtflMStt9.

+1 -1

Post a comment