This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Result { | |
@SerializedName("section") | |
@Expose | |
private String section; | |
@SerializedName("title") | |
@Expose | |
private String title; | |
@SerializedName("abstract") | |
@Expose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.ProgressDialog; | |
import android.os.AsyncTask; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.widget.ListView; | |
import com.squareup.okhttp.OkHttpClient; | |
import com.squareup.okhttp.Request; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.xml.sax.Attributes; | |
import org.xml.sax.SAXException; | |
import org.xml.sax.helpers.DefaultHandler; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* Created by Igor on 12.11.2015. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
11-13 19:34:08.028 12353-12379/com.igor.jomedia I/System.out: <rss xmlns:cbc="http://www.cbc.ca/rss/cbc" version="2.0"> | |
11-13 19:34:08.028 12353-12379/com.igor.jomedia I/System.out: <channel> | |
11-13 19:34:08.029 12353-12379/com.igor.jomedia I/System.out: <title><![CDATA[CBC | Top Stories News ]]></title> | |
11-13 19:34:08.029 12353-12379/com.igor.jomedia I/System.out: <link>http://www.cbc.ca/news/?cmp=rss</link> | |
11-13 19:34:08.029 12353-12379/com.igor.jomedia I/System.out: <description> | |
11-13 19:34:08.029 12353-12379/com.igor.jomedia I/System.out: <![CDATA[ | |
11-13 19:34:08.029 12353-12379/com.igor.jomedia I/System.out: FOR PERSONAL USE ONLY | |
11-13 19:34:08.029 12353-12379/com.igor.jomedia I/System.out: ]]> | |
11-13 19:34:08.030 12353-12379/com.igor.jomedia I/System.out: </description> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
String url = "http://www.cbc.ca/cmlink/rss-topstories"; | |
OkHttpClient client; | |
String xml = ""; | |
final String LOG_TAG = "myLogs"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
String url = "http://www.cbc.ca/cmlink/rss-topstories"; | |
OkHttpClient client; | |
String xml = ""; | |
final String LOG_TAG = "myLogs"; | |
String temp = ""; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
XmlPullParser xpp = prepareXpp(); | |
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) { | |
String tagname = xpp.getName(); | |
switch (xpp.getEventType()) { | |
// начало документа | |
case XmlPullParser.START_DOCUMENT: | |
Log.d(LOG_TAG, "START_DOCUMENT"); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
String url = "http://www.cbc.ca/cmlink/rss-topstories"; | |
OkHttpClient client; | |
String xml = ""; | |
final String LOG_TAG = "myLogs"; | |
ListView listView; | |
//Adapter adapter; | |
XmlPullParserFactory factory; | |
List<Feed> news = new ArrayList<>(); | |
private Feed feed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.WAKE_LOCK" /> | |
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> | |
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> | |
<permission | |
android:name="${applicationId}.permission.C2D_MESSAGE" |