开发者

android httpget read from a website to sqlite columns

I have this line of text:

id:1234 dateandtime: 03/10/2011 14:30 first开发者_运维问答number:2222 secondnumber:3333 centernumber: 4444
refrancenumber:5555 webaddress: www.example.com

And I'm using this code to read it off my website that I have for testing

//Encode and set entity
postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs, HTTP.UTF_8));
//Execute and get the response - remove all html tag
addressString = hc.execute(postMethod, res).replaceAll("<(.|\n)*?>","");

My problem is that this code reads it as one paragraph I want to separate them so I can insert each one of them in its own column in an sqlite database.

Note: the 1234, 03/10/2011 14:30, 2222, 3333, 4444, 5555, and the www.example.com each will be stored in a separate sqlite column.

Any suggestions?


I would recommend reading about the String.split(String regularExpression) function: documentation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜