This file contains hidden or 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
Parser parser = new Parser(); | |
parser.execute(urlString); | |
parser.onFinish(new Parser.OnTaskCompleted() { | |
//what to do when the parsing is done | |
@Override | |
public void onTaskCompleted(ArrayList<Article> list) { | |
//list is an Array List with all article's information | |
//set the adapter to recycler view | |
mAdapter = new ArticleAdapter(list, R.layout.row, MainActivity.this); | |
mRecyclerView.setAdapter(mAdapter); |
This file contains hidden or 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 Parser extends AsyncTask<String, Void, String> implements Observer { | |
private XMLParser xmlParser; | |
private static ArrayList<Article> articles = new ArrayList<>(); | |
private OnTaskCompleted onComplete; | |
public Parser() { | |
xmlParser = new XMLParser(); | |
xmlParser.addObserver(this); | |
} |
This file contains hidden or 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
#!flask/bin/python | |
from flask import Flask, jsonify, abort, request, make_response, url_for | |
from flask.ext.httpauth import HTTPBasicAuth | |
app = Flask(__name__, static_url_path = "") | |
auth = HTTPBasicAuth() | |
@auth.get_password | |
def get_password(username): | |
if username == 'miguel': |
NewerOlder