【发布时间】:2012-09-07 19:47:02
【问题描述】:
我正在尝试制作一个显示最新消息的 android 应用程序 在我的网站上,我对这两件事特别感到困惑?
1. 每次 手机会自动联网吗?
2.我将如何存储这些信息并随后将其用于设备上的更新?
我从谷歌找到了这段代码,我的方向正确吗?:
public abstract class BaseFeedParser implements FeedParser {
// names of the XML tags
static final String PUB_DATE = "pubDate";
static final String DESCRIPTION = "description";
static final String LINK = "link";
static final String TITLE = "title";
static final String ITEM = "item";
final URL feedUrl;
protected BaseFeedParser(String feedUrl){
try {
this.feedUrl = new URL(feedUrl);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
protected InputStream getInputStream() {
try {
return feedUrl.openConnection().getInputStream();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
【问题讨论】:
标签: android sqlite updates feed