学習課題としてのニュース フィード アプリの構築。Google に接続して json ストリームを受信し、それを使用してニュース項目の ListView を設定できます。一つのことを除いて。「コンテンツ」フィールドは、多くの Unicode 文字を含む HTML だと思います。次のようになります。
"content":"\u003ctable border\u003d\"0\" cellpadding\u003d\"2\" cellspacing\u003d\"7\" style\u003d\"vertical-align:top\"\u003e\u003ctr\u003e\u003ctd width\u003d\"80\" align\u003d\"center\" valign\u003d\"top\"\u003e\u003cfont style\u003d\"font-size:85%;font- family:arial,sans-serif\"\u003e\u003ca href\u003d\"http://news.google.com/news/url? sa\u003dt\u0026amp;fd\u003dR\u0026amp;usg\u003dAFQjCNFxFgqMWvxBxPVu6p- aU3v0pJu2gQ\u0026amp;url\u003dhttp://www.usnews.com/news/newsgram/articles/2013/09/13/flash -floods-force-thousands-of-evacuations-in-colorado\"\u003e\u003cimg sr c\u003d\"//t0.gstatic.com/images? q\u003dtbn:ANd9GcSxoCFv79Ha0yUykBX1dB_2DZ4EKcS1ZNeqvOH1iadwNXYcCt24RarH73QM2SLhZlDneouYmLcD \" alt\u003d\"\" border\u003d\"1\" width\u003d\"80\" height\u003d\"80\"\u003e\u003cbr\u003e\u003cfont size\u003d\"-2\"\u003eU.S. News \u0026amp; World Report\u003c/font\u003e\u003c/a\u003e\u003c/font\u003e\u003c/td\u003e\u003ctd valign\u003d\"top\"\u003e\u003cfont style\u003d\"font-size:85%;font-family:arial,sans- serif\"\u003e\u003cbr\u003e\u003cdiv style\u003d\"padding-top:0.8em\"\u003e\u003cimg alt\u003d\"\" height\u003d\"1\" width\u003d\"1\"\u003e\u003c/div\u003e\u003cdiv\u003e\u003ca href\u003d\"http://news.google.com/news/url? sa\u003dt\u0026amp;fd\u003dR\u0026amp;usg\u003dAFQjCNHCJS1c-eurSg- 8tAt0PjZ4tiaLdA\u0026amp;url\u003dhttp://www.foxnews.com/weather/2013/09/15/colorado- braces-for-more-heavy-rain-deadly-floods/\"\u003e\u003cb\u003eMajor air rescue planned in flooded Colorado county\u003c/b\u003e\u003c/a\u003e\u003cbr\u003e\u003cfont size\u003d\"-1\"\u003e\u003cb\u003e\u003cfont color\u003d\"#6f6f6f\"\u003eFox News\u003c/font\u003e\u003c/b\u003e\u003c/font\u003e\u003cbr\u003e\u003cfont size\u003d\"-1\"\u003eResidents of Boulder County, Colorado are being asked to help guide helicopter pilots to their locations Monday as a major air rescue is being planned to take advantage of a clear weather forecast. \u0026quot;The pilots are going to go anywhere and everywhere they \u003cb\u003e...\u003c/b\u003e\u003c/font\u003e\u003cbr\u003e\u003cfont size\u003d\"-1\"\u003e\u003ca href\u003d\"http://news.google.com/news/url? sa\u003dt\u0026amp;fd\u003dR\u0026amp;usg\u003dAFQjCNHc6lIe9u_YShLkh7NV5WR9rO6YHQ\u0026amp; url\u003dhttp://www.therepublic.com/view/story/b663f09bbf48403c9041a86623fe428e/CO-- Colorado-Flooding-National-Guard\"\u003eNational Guard members trapped during evacuations from flooded Colorado town\u003c/a\u003e\u003cfont size\u003d\"-1\" color\u003d\"#6f6f6f\"\u003eThe Republic\u003c/font\u003e\u003c/font\u003e\u003cbr\u003e\u003cfont size\u003d\"-1\"\u003e\u003ca href\u003d\"http://news.google.com/news/url? sa\u003dt\u0026amp;fd\u003dR\u0026amp;usg\u003dAFQjCNFij70BTG-5dO69JM0BVO32S0S- aA\u0026amp;url\u003dhttp://www.cnn.com/2013/09/15/us/colorado-flooding/? hpt%3Dhp_t1\"\u003eColorado floods: More than 500 still unaccounted for as \u0026#39;devastating\u0026#39; rain looms\u003c/a\u003e\u003cfont size\u003d\"-1\" color\u003d\"#6f6f6f\"\u003eCNN International\u003c/font\u003e\u003c/font\u003e\u003cbr\u003e\u003cfont size\u003d\"-1\"\u003e\u003ca href\u003d\"http://news.google.com/news/url? sa\u003dt\u0026amp;fd\u003dR\u0026amp;usg\u003dAFQjCNE-gAC_OO- 9Ts2O4rbr8EoZZMIO6Q\u0026amp;url\u003dhttp://www.washingtonpost.com/national/residents- return-to-find-colorados-gore-tex-vortex-transformed-by-flooding/2013/09/15/83ce1dc0-1e72- 11e3-9ad0-96244100e647_story.html\"\u003eFlooded Colo. mountain towns reopening as cleanup effort begins despite more \u003cb\u003e...\u003c/b\u003e\u003c/a\u003e\u003cfont size\u003d\"-1\" color\u003d\"#6f6f6f\"\u003eWashington Post\u003c/font\u003e\u003c/font\u003e\u003cbr\u003e\u003cfont size\u003d\"-1\"\u003e\u003ca href\u003d\"http://news.google.com/news/url? sa\u003dt\u0026amp;fd\u003dR\u0026amp;usg\u003dAFQjCNE_Ko-9omCmhO1-z6P- kCXPSNANuQ\u0026amp;url\u003dhttp://kunc.org/post/after-rain-delay-colorado-flood-rescues- resume\"\u003eKUNC\u003c/a\u003e -\u003ca href\u003d\"http://news.google.com/news/url? sa\u003dt\u0026amp;fd\u003dR\u0026amp;usg\u003dAFQjCNEyuScNidVouVzOkoA6_lqZLOWR9Q\u0026amp; url\u003dhttp://nhpr.org/post/rescue-efforts-resume-flooded-colorado-more-rain- due\"\u003eNew Hampshire Public Radio\u003c/a\u003e\u003c/font\u003e\u003cbr\u003e\u003cfont size\u003d\"-1\"\u003e\u003ca href\u003d\"http://news.google.com/news/more? ncl\u003ddQHisuNx5u46LtMZh5z80DBxCCRjM\u0026amp;ned\u003dus\u0026amp;topic\u003dh\"\u003e\u 003cb\u003eall 1,507 news articles »\u003c/b\u003e\u003c/a\u003e\u003c/font\u003e\u003c/div\u003e\u003c/font\u003e\u003c/td\u0 03e\u003c/tr\u003e\u003c/table\u003e"
私が使用する JSON パーサーは、これを次のように表示します。
注:申し訳ありませんが、私は新しく、画像を投稿するのに十分な評判がありません. この画像は、記事のサムネイル画像 (私にとって最も重要) と、見出し、テキスト、および追加のリンクを示すスクリーン グラブであり、どれも実際には必要ありません。
Androidで「コンテンツ」から完成品に到達するにはどうすればよいですか? 完全なニュース記事へのリンクが既にあるので、本当に必要なのはサムネイルを見つけることだけです。しかし、教育的な観点から言えば、役立つ Android クラスはどこで探せばよいでしょうか。私が見つけることができる文書化されたものはあまりありません。