나는 내 웹 사이트에서 최신 소식 을 표시하는 안드로이드 응용 프로그램을 만들려고 노력하고 있습니다. 특히이 두 가지에 대해 혼란 스럽습니다.업데이트로 뉴스 응용 프로그램 만들기
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);
}
}
}