Monday, March 26, 2012

Next week's joys 3 - 26. 3 - 2. 4.

Ok, loading from the Internet works like a charm! I'll need to deal with HTML entities and rogue HTML in the feed, but these are just minor details.
Now for the next steps:
Next week Gourmet reader will be able to display the so-called FeedViews.
A FeedView is a page that takes different feeds and puts them together in chronological order. One example is of course the All FeedView, that displays every sinlge item from all the followed feeds. Then there could be News, Sport for sports fans, Maths for math research fellows etc.
The items will be color-coded by feed, of course customizable. That implies some settings interface, which I may not manage to complete.

Monday, March 19, 2012

Next week's joys 2 - 19. - 24.3.

Since I have done some extra work during past week and before, I thing this target is completely manageable, even though I'm to sit to like 3 tests next week.

Next week, Gourmet reader will be able to display a single feed from the Internet in a readable form.

I really hope there will be no problems this time. Maybe last week I just didn't hope enough!

The outcomes of past week

The week flew by, and unfortunately I had less time to do work than I expected (I forgot that I'd be gone all the weekend). However, it seems now that I've done enough to be able to meet my targets today!
Behold:
That's my blog, right! For now, there's some dummy coloring not even aiming to be readable (pretty much random), completely random headline sizes and not-so-nice black borders. But it works, and it doesn't die in pan when I interact with it!

Monday, March 12, 2012

Long have the resolutions lasted

Well, it seems that Android won't let me do network stuff in the main thread (although they said it was only "discouraged", which means "OK for testing" for me).
What does it mean? That I'll have to do all the ContentProvider and database stuff before I can display any piece of real information on the tablet screen. That implies pretty much work, which implies that it'll take a while. Although I have the architecture on a piece of paper, transforming it to code and doing it right will take a rather long while, so I'll need to redefine my targets. I'll just take some time to think it over and choose priorities. Then, I'll update this post with the new resolutions (like the new iPad, newer is always better; now just not to make a habbit of changing the resolutions).

Finally:
After quite some thought and design decissions, I've set up a new target for the week (I've completed most of the other tasks, so I can be generous).

Next week, Gourmet reader will be able to display data from the database. It will be dummy data randomly generated by the program itself.

Let's all hope now it doesn'!t go all wrong tommorrow...

Saturday, March 10, 2012

Next week's joys 1 - 12. - 17. 3.

My teacher says it's a good practice to give myself targets to focus on for the next week. Well, it's better late than never, so here come my new week's resolutions.

Next week, Gourmet reader will be able to read and display a single hardcoded RSS feed. It'll display the corresponding page next to the list (landscape) or in the Browser (portrait).

Now I just hope the homework from other subjects can complete themselves with as little of my help as possible. Happy new week!

The Object design

Well, after some deep thoughts I finally made out how the app architecture will work.
Warning:
This is about the programming stuff, if you're a user, you probably won't find it really interesting...
So, in Android, the Java implementation needs an activity class, that does all the fancy stuff. In my case, that will be the ReadFeed class extending Activity base class. UI-wise, it will contain a ListView and optionally, if the screen is large enough, a WebView to read the articles straight away.

For the ListView to work, you need a data container called an Adapter. I've called mine FeeedAdapterand it extends the BaseAdapter android class. The adapter handles data operations requested by the ListView (like "give me item no. 13") and the drawing of the list items. The drawing part is crucial for my app to work as I want it to.

The dataset for the FeedAdapter is represented by a FeedView - that is a view of a number of separate feeds aggregated together into one stream if information. Every single feed item has it's own instance of the FeedItem class. A FeedItem has all the information neccesary to display it in a FeedView - the URL, the color label, the estimated importance of the article for the reader... The FeedItems are gonna be stored in a Collection (HashMap for now).
Next, the FeedView has a Filter class instance to filter the items, assign labels and importances to them and to do the smart stuff (like learn what the user likes).

In the basement of the app, there will be the DataDownloader class, that will be providing all the Internet communication services for the app, like updating the feeds or downloading the images do display. The downloaded data will travel to a FeedParser, that will get the feed items and store them locally, in the DB. Once in a while, a clean-up will be run to delete old items and free some space.
Then there will be a ContentProvider to transfer the items from DB to the FeedView.

The SettingsActivity will be quite simple as of the architecture. There'll be a page for managing feeds and a page for simple settings, no really interesting stuff there.

So, that's how it'll work. Now just to get it to work, and I'm done!

Monday, March 5, 2012

First small steps for a man, but giant leaps for me.

I ought to be working on the project now, and a good way to start is to find out where to start. Some steps that need to be done:
  • lay out the app architecture
  • write a RSS parser to work as a content provider for the app
  • think of a not-too-awkward UI layout for reading feeds
Then the real Android stuff will kick in: Activities, Layouts, Fragments, ContentProviders, SQLite DB... But the three steps above really are the priority now, so I need to get them done. [Gotta catch'em all (or some of them at least) till Thursday and I have none by now, the joy of a week's skiing trip (a school skiing trip, to have a legal excuse) has come at last]. So get coding!

The Project

So, it has come to it (Credit: xkcd.com). Time to tell the world what I will be spending time with:

RSS is a great invention. You can keep all the new you're interested in in one app, the reader. There is a plenty of RSS readers in the known universe, some of them also for Android. But none really seems to be able to do all the things at once. Wiew all the feeds in a single stream, add tags to articles, color the articles for easier orientation in all the world's news, integration with ReadItLater, content based learning filters... Often you see long lists of headlines you might be interested in - but what if you miss something?  I think I can do better than that!

I proudly present to you the Gourmet Reader, the reader to use when you know what you want to read. As the food admirers consume only selected, especially tasty food, you'll get to read the articles that fit your taste. The key features I've already thought of:
  • feed views filtered by site or all feeds in one place
  • marking articles with colorful labels for visual orientation, emphasizing important articles
  • some learning filter to get to know you, give you only the important information and spare you all the ballast
  • integration with ReadItLater
 For the UI, I'll go for real simplicity. The app is gonna be for tablets primarily, but I hope to write it in a manner that will enable it to be used on smartphones, too. Android has the tools in place, so it should be more fun than pain.

Now the real work shall commence!