Sunday, April 26, 2009

NewsRob 2.0

NewsRob 2.0 is just another release. Nothing earth shattering, completely backward compatible. 
It's the 10th major release and could have been NewsRob 1.10 if Android's versioning scheme would have supported that.

I would like to thank Matthias for helping out again. He beta tested the new release!

Locale integration is included and described here. Also the fix – recently mentioned here – made it into the release. Especially the latter was quite some work and I really hope that I didn't break things. Let me know if you experience otherwise.


NewsRob checks for a new version once a day when the UI is opened. As part of that request it transmits the current NewsRob version and the installed SDK (more about that in another post). I need this information to decide what versions I still need to support.
An interesting, or at least unexpected, insight I gathered was that 12% of the NewsRob users already use Cupcake.

I don't want to risk running Cupcake on my G1. I fear that I somehow will not be able to get back to the supported version, which is what most of you use. But I run Cupcake in the emulator and meanwhile fixed all issue I found so far.
Except one, when changing preferences on the settings screen, some of them change the schedule of synchronizations. With cupcake that sometimes works and sometimes it doesn't. If it works you will see a toast-message saying that a new schedule is in place. If you don't see a message it didn't work and the new schedule will only be activated after the next reboot. This is relevant for the "Auto-Sync" setting and the "Synchronization Interval".

I support Cupcake, as good as I can. So if you run into a bug, don't hesitate to report it.

I don't plan to release Cupcake-only functionality in the next two months though. I think that widgets or live folders would be a nice way to display the latest articles, but I will wait until Cupcake is rolled out widely before doing that.

Resume Show Article Now Has A Memory

As reported by Michelle NewsRob forgot the zoom settings and which part of an article was shown in the Show Article screen. When for example a SMS arrived a new dialogue from SMS popup would appear on top of the Show Article screen. After dealing with the SMS and the dismissal of the popup the NewsRob screen would be shown again, but the zoom settings were gone and the document was shown at the beginning again.
In this scenario NewsRob will now return into the same state it was left before the SMS dialog popped up.

Hiding Downloaded Assets

Images that are downloaded by NewsRob or other apps and stored to the SD care are picked up by Android's Camera/Pictures application, which can be a bit confusing. It would be nice it the pictures application could be tweaked to hide certain folders, but a bug report/enhancement request going into this direction has not even been acknowledged by Google. 
As that doesn't make me confident that Google will do something about it in the foreseeable future NewsRob now masks all file extensions of downloaded assets so that images are now longer found by the media scanner that the Pictures app uses. 
It will only do that for the articles that are downloaded from now on forward. Hence it will take a bit of time until the "newsrob" album completely disappears from the Pictures app.

I also changed the way that the downloaded articles are organized. This should speed some use cases up quite a bit, but will also only take effect slowly.

Posted via email from newsrob's posterous

NewsRob 2.0 Preview - Locale Integration

In the upcoming release NewsRob features a basic integration with Locale. Locale is a Grand Prize winner of Google's Android Developer Challenge.

Based on situations/zones (e.g. @home, low battery) you can define settings (e.g. turn the ringer off, turn WiFi on) or, as of the NewsRob's 2.0 release, request NewsRob to synchronize. 

This integration should take care of the need to do a synchronization at a certain point in time as Ben and Julian Felke requested.  

The screenshots below illustrate a scenario where NewsRob is triggered to synchronize every workday at 6am. On a sidebar: It doesn't make it necessary to use GPS or any other of the more advanced features of Locale.
Please note that you need to use the actions from the option menu to apply the changes you made in the dialogs. You'll see what I mean when you press the option menu.

Ok, let me know how this integration works for you. And, of course, I am aware that a broader integration (e.g. turning auto-sync on/off) is imaginable ;-) It is on my TODO list, but not near the top.

See and download the full gallery on posterous

Posted via email from newsrob's posterous

Wednesday, April 22, 2009

Manual "Refresh" not working anymore? XML Parser issues! Beta?

"Refresh" not working anymore?

Daniel of Bedside fame reported that "Refresh" doesn't work anymore with NewsRob 1.9. It turns out that this is true ;( 

With the last release I added the option "WiFi only" to the auto-sync settings.
Unfortunately the way I implemented it didn't make a distinction between a manual "Refresh" and an auto-sync, which lead to the manual refresh not working, when the auto-sync settings were set to "disabled" or "WiFi only" and no WiFi was available.

Matthias also mentioned yesterday by chat that "Refresh" doesn't work when WiFi is not available and auto-sync is set to WiFi-only. At the time I thought of this more of a feature request, but in the light of the other bug from above I now consider that behavior a bug too.

So the new/changed behavior is that a tap on the "Refresh" button or a trigger from Locale (will be included in an upcoming release) are considered manual refreshs. That means they ignore any setting in the auto-sync preference. 
When auto-sync is triggered by the sync interval set in NewsRob it is an auto-sync and obeys the setting in the auto-sync preference - as it should.

XML parser issues

NewsRob used the kXML pull parser to handle the feed data from Google Reader.
kXML is very small and specifically designed to run on embedded devices like phones. Unfortunately it seems that it is not full-featured what led to a couple of problems.
You can read more details here.

One of the bigger problems surfaced for the first time yesterday and was reported by Gaboo. A consequence of kXML not being able to parse a certain part of the Google Reader input was that the "fetching new entries" phase of NewsRob was interrupted every time, so it renders NewsRob useless. This only happens when there are special characters used in the subscribed feeds and I only know about a single case, but nevertheless there may be more.

I now changed my code to use a DOM parser. This is not a drop-in replacement though, but a deep rework of a central part of NewsRob.
Also I stumbled over another alleged bug in the DOM parser of Android.
As a result I will not release that code yet, but will let it mature a bit more on my phone. As I don't have any other bug reports that we haven't found a workaround for, that should be ok.
If you are a victim of this bug too, let me know. I may help you to find a workaround or release the fix earlier.

So far the fix works great and I haven't had any problems with it. 
If you want to help to test this release with fixes for the both mentioned issues, let me know. I'll send you a version by mail, but you would need to uninstall the current installation of NewsRob to run it.

Saturday, April 18, 2009

NewsRob 1.9 - Rabbit

(Updates at the end of the article)

What's new in NewsRob 1.9?

More Control Of Downloading And Displaying

The biggest feature in the new version allows for more fine grained control of the download process to reduce download times and storage consumption to the necessary minimum.

On a related note it is now possible to define in which mode an article should be opened ("Feed", "Web"). That should make navigation quicker.

More information here.

Share Link

As suggested by Eric Sinclair and Marcus Schmidtke I reworked "Share By Mail" and made it more general. It is now called "Share Link" and looks like this:

The mentioned applications are just exemplary. The actual applications on your phone that participate in sharing might be different (YMMV).

Rescheduling background synchronization after upgrade

Marcus also reported that he needs to set the synchronization schedule again after each update.

The problem here is that an upgrade on Android is an uninstall followed by an install. And during the uninstall the scheduled alarms get uninstalled also – which makes sense – leaving the phone in a pristine state. Unfortunately the app doesn't get notified during the install process to (re-)establish any alarms.

So for NewsRob that meant that the alarm was only re-scheduled when you visited the preference screen or when the phone was booted again.

From this version on every time NewsRob is launched by the user it checks if auto-sync is enabled (the default) and if that is the case it schedules the next sync, if there isn't a schedule already.

Still, if you don't launch NewsRob after an upgrade the auto synchronization will not resume until the next reboot.

Clearing Cache On Install Now Features A Progress Dialog

Another problem stemming from the above issue of not being notified when the app is installed or uninstalled is that NewsRob isn't able to properly clean up after itself. In particular the stored articles on the SD card are not removed during an uninstall. You can, of course, push "Clear Cache" before uninstalling it.

This led to a problem where you installed NewsRob, uninstalled it and re-installed it at some later point. As the NewsRob database gots unistalled the downloaded files don't mean much anymore as the "index" is missing. So every time NewsRob instantiates a storage provider or switches it (phone memory <-> SD card) it cleans the old and new storage provider.

So during a new install where NewsRob finds old files on the SD card, they get removed first. Unfortunately I forgot to put a progress monitor around it which lead to the dreaded "Application Not Responding" as well as to other weird GUI behavior. This has been fixed now.

Ejecting SD Card During Synchronization Now Longer Leads To A Forced Close: NullPointerException

When ejecting the SD card in the middle of the "Reduce To Capacity" phase – NewsRob deletes the articles that are over the configured maximum number of articles – lead to a forced close with a NullPointerException.

Hanaguro reported this problem and helped me over the course of many emails, tests and the use of Log Collector (Now that's a great Android Market rating!) to track the problem down. It is now fixed. Many thanks Hanaguro.

New Auto-Sync Mode: "WiFi-Only"

With another user I exchanged a couple of mails on using NewsRob without a flat rate data plan. As a result there is a new option that not only for the content download, but also the auto-sync, you can now specify a "WiFi only" option.

But, please be careful. NewsRob checks occasionally if WiFi is no longer available, e.g. between article downloads, between chunks of new articles, but this is very coarse grained. NewsRob is not cancelling the downloading of a file in the middle of the download.

The upload-only synchronization that kicks in 5 minutes after the last status change, now is also dependent on the auto-sync setting.

I'd also like to add, at least in my personal experience, the G1 loves to hop on and off WiFi.

Having said that, I want to make sure you guys understand that NewsRob is a bandwidth hog, no matter which way you slice the issue. If you don't have a flat rate, please don't use NewsRob. And if you must, make sure that you go into "offline" mode by changing the APN settings automatically or whatever.

Last and least new/changed feature: The article's context menu – as accessible by a long press on the article header on the Show Article Screen or on a row in the Article List – is now also the option menu (hardkey "menu") on the Show Article screen.

And as always many more little details.

Like with the next release - this one was tested, but there will likely be bugs small and possibly big that you will find and report. During the first three days of the release I will upload new versions frequently. So if you don't want to help testing the app and bugs and upgrades make you throw up, please wait another three days before taking the upgrade.

With this release I now have implemented Feeds as entities of their own right, as opposed to just being the feed title as before. They are used to set the download and display references. In one of the next two releases I plan to surface them, so that they are one more level to browse through the articles.

Also planned for one of the next two releases is the basic integration of Locale.

For the releases thereafter I currently plan on fixing whatever bugs come my way, documentation (website, videos) and vacation.

And I am thinking about stopping those release notes. The note from yesterday and this take together almost 6 hours to prepare. This time I am not working on features or fixing bugs. Worst of all, when reading the mails I get, I can't fight the feeling that the release notes are read only by a minority. And the same is true for the web site. Please leave a comment if you read this ;-) "Read it" would be fine, but more verbose comments would be acceptable too ;-)

Maybe videos that are linked directly in the app are better?!

UPDATE - NewsRob 1.9.1:

Fixed a NullPointerException that happened during synchronization when a category doesn't have a label. 
Many thanks to Matthias Nitschke for sending logs, XML files, emails and IMs; also for the "instant" replies ;-)

Cupcake. With Cupcake the Enter-key and DPAD_CENTER-touch didn't work anymore on articles in the Article List. NewsRob 1.9.1 
I see that 10% of 1.9.0 is installed on Cupcake. Please give me feedback what else doesn't work.
I am only aware that preferences changes are not always reflected in a new schedule.

Friday, April 17, 2009

NewsRob 1.9 Preview - More Download Control

NewsRob 1.9 is around the corner. So I'd like to share some bits before the release.

More Download Control

The new version brings you more fine grained control over what is downloaded and how long it takes.

I often hear that NewsRob is slow and it takes very long to make the web pages available offline.

Let me tell you what happens:

NewsRob downloads the feed content and the web page. Let's first have a look at the feed content. The feed content's text is already part of the feed that is synced with Google Reader. So only the images that are referenced in the text need to be downloaded – so that you can see them more quickly when browsing through your articles, or that you can see them at all when you are offline.

This is a relative straight forward process and doesn't take all that long. And in many cases that is all that is needed. So from now on you can select a download option called "feed content" to stop after that.

There are lots of web pages – in particular the commercial websites that really want you to see the ads on their webpage to make their business model work – that only provide summaries in the feed. That's called a partial feed as opposed to a full feed that contains the full text and all the images.

When you encounter those partial feeds in Google Reader you'll see only a line or two describing the content in the article's body. To read the actual article you have to click on the title to open up the web page as a new tab/window in your browser. That is slightly annoying when you are at your desktop, but really annoying when on Android. It just takes very long to open a new browser window or even launch the browser.

(Btw. If any of you know of a Mac or browser based reader application that does what NewsRob does, please let me know.)

So to take care of that NewsRob let's you display the web page inside NewsRob.

That is possible when the content is downloaded as well as when the content is not downloaded (yet). In the latter case NewsRob just acts as an ordinary browser and downloads the page on the fly. This also works when you use the download options "headers only" and "feed content".

The web page that is referenced in the article is called "alternate content".

To offer this alternate content offline, NewsRob downloads the html page and goes through it looking for images. When it finds a reference to an image it downloads that image, saves it to the SD card/phone memory and changes the reference in the html page to point to the local file.

Then it repeats the process for all the stylesheets. After the stylesheets are downloaded, they are processed the same way – that is NewsRob looks for image references, downloads the images, changes the stylesheet, etc.

I hope you can imagine that this takes a bit of time. Please also consider that the web pages are not meant originally to be downloaded to a mobile phone. A typical commercial web page has 100-300 images embedded. Those images are usually very small though: these are rounded-corners, dividers, navigation elements and whatever else the history of the internet brought with it.

So if you don't need the web page – because the feed you're interested in is a full feed – use the "feed content" option; otherwise use the "feed content + web page" option.

Why a "feed content + web page" option, not a "web page" only option? Doesn't this take up more space and time than necessary?

The web page and the feed content share the same content and NewsRob preserves that. So if an image is downloaded for the feed content, the same instance of the images is also used in the web page or vice versa. As a consequence the feed content comes "for free".
The "feed content + web page" option was the default – and only option – in NewsRob until now.

The new default is "feed content".

And there is a third choice now "headers only"; this means that no feed content is downloaded.

This is basically the functionality you have when you use the mobile version of Google Reader.

You can still see the feed content, but the images are downloaded on demand. You can also still see the web page, but it is downloaded on demand.

So it's not exactly as the mobile version of Google Reader as you don't need to open a new window when you want to look at a linked web page, the alternate content.

The "headers only" option is great for feeds that just contain short textual information. All information is then already contained in the feed. There is no need to download the alternate content or images in the feed for status updates of your Facebook buddies or the latest tweets.

The option is also great for partial feeds that contain some articles that you like, but you don't care for all of them. So with "headers only" you stay informed what articles are there and can look at the alternate content when you are online, it just takes a little bit longer as it has not been downloaded ahead of time.

You can specify the new download option on a per-feed basis and also set a global default:





There is another new option you can specify on a per-feed basis: the display preference.

The default is that for a feed where you specified that the web page should be downloaded an article from this feed will also be opened in the "Web" mode. This is also the case when you navigate between articles on the Show Article screen.


If you specified that NewsRob should not download the content or only the feed content, then the default is that the Show Article screen is opened in "(Display) Feed" mode.

But you can also specify the "(Display) Feed" or "(Display) Web (Page)" mode explicitly.

Why would that make sense?

Consider this: You have a partial feed from a commercial news site, then it not only takes long to download the web page, but it also takes a lot of time to display it. Remember the 100-300 files?

So it may make sense for you for those feeds to configure downloading the feed content + web page, but open articles from this feed in "Feed" mode by default, so that you can browse very quickly through your articles and click on the header to change to the "Web" mode, if an article is interesting to you.

Does this make sense? You tell me – leave a comment. NewsRob is intended for people that live in their news reader, not so much for the casual users that checks once a week for something to read.

You could tap in the Article List on the globe to directly open the Show Article screen in "Web" mode before. With the introduction of the new configuration options this is an obsolete feature for most of the cases and so I removed it. If you are one of the two people using it, please don't fight the removal. In an attempt for more simplicity this feature is gone for good.

The "Feed" or "Web" mode is displayed in the upper left corner of the Show Article screen. Below that you'll see the download state as before (globe, phone).

The download state can also be seen in the Article list in a bit more detail than before.



Monday, April 6, 2009

NewsRob 1.8 - Phoenix

I have taken my sweet time to prepare a new release. Sorry for that.
To compensate the ads are gone for the time being.

Just to keep you up to date : As hinted to in my last post, Back To The Drawing Board, I went back to use the existing code base. I am therefore abandoning my previous performance work, but I will keep the experiences I made and will apply some of my new insights over the next releases.

With NewsRob 1.7 I introduced Q-Reports – a bug reporting feature – and it proved tremendously helpful to me.
I answered each and every single bug report and it proved to be a great and pleasant experience to communicate with you guys. It was way better than what I expected. But well, my expectation was set by the Android Market comments ;-)

In the last three weeks – since the release of NewsRob 1.7 – I got around 100 bug reports for about half a dozen bugs. I will continue to answer each bug report, so that the reports keep me honest on really chasing the bugs down, if only to have fewer bug reports to answer to ;-)
There were so many mails that it doesn't make any sense to mention everybody by name. but in any case, thank you very much for your participation. 

Most of those bugs are fixed now. Two are really hard to track down though and I have not been able to reproduce them. But even for the latter I implemented some changes that might or might not solve the problems. I need your bug reports to prove that the latter are gone or not.

This release's duration was a bit long and especially people that were reporting bugs in the last week were only getting a response saying that the bug is fixed already. I will keep an eye on that and if this turns out to be a frequent occurrence I will make NewsRob check against a list of know bugs to lift the burden of reporting known bugs from your shoulders.

  • New default for storage provider: SD card (most of the time)

    Some of you reported a bug that happened when the phone memory was low. The subject line of your bug report mail contained "NullPointerException: null" and the body contained: "".

    This bug was actually happening not in the NewsRob code, but in the framework code. JBQ, a Google engineer, took care of the problem quickly, so that it should be fixed in an upcoming release (maybe Cupcake?). If you're interested in the details, you'll find them here and here.

    No data is harmed; so from this release on the bug is silently swallowed.
    However there is an underlying problem. The lack of memory was because NewsRob was configured to store the downloaded articles in the phone memory, not on the SD card.
    There was likely something else eating the phone memory too though as NewsRob stops downloading new stuff when a certain threshold is reached.

    But anyway storing into phone memory was the NewsRob default, because it is the simplest approach. On the other hand: SD cards have a higher capacity, but when using an SD card it must be accessible.

    It is not accessible when the SD card is not inserted (doh!), when the SD card is in read only mode or when the "Use for USB storage" is activated for the SD card. 

    The latter means that an Android app cannot share the SD card with the desktop computer you plug it into. This seems to be a limitation of the FAT32 file system, but don't take my word for it.

    As you can see using the SD card is interesting as it usually has a higher capacity, but is a bit more complicated.

    As I got at least 20 bug reports for this bug only, from now on the story goes like this: When the user first launches NewsRob the default is set to SD card, if an SD card is present and writable, otherwise the default is still the phone memory.

    Also when opening NewsRob and the SD card is not accessible even though NewsRob is configured to use it, NewsRob will complain about it. See screenshot below.

    "Refresh" and "Clear Cache" will be disabled until the SD card is accessible again or you change the Storage Provider to SD card in the settings. 

    That looks like the most sensible approach to me.

  • Display of online web content

    Marcus Schmidke suggested to show the Website inside NewsRob when the content has not been downloaded yet, but the user clicked on the phone symbol as if to view the downloaded Website.
    That was a small change to implement, but I experienced over the last week that this is quite handy.

  • Bug "IllegalStateException: Oops. moveToPosition shouldn't fail."

    This bug happened when the Show Article screen was displaying an article that then gets removed by a running synchronization. When trying to navigate to the next or previous article this bug occurred. 

    Tom Kerswill helped me to track down and reproduce the problem. As a result the bug is gone now. Thanks Tom.

  • Bug "CursorIndexOutOfBoundsException: Index n requested, with a size of n" and
    Bug "IllegalStateException: get field slot from row 0 col 0 failed"

    Those bugs I have not been able to reproduce, but I have a suspicion that they both are caused by a concurrency issue. I changed the implementation accordingly. 

    As I haven't been able to reproduce it with the old version I can't verify if it is gone in the new version. So send me those bug reports if you get them.

    Don't be afraid to send me the bug report every time it occurs. This way I know how urgent it is to fix the problem. 20 bug reports from 20 people is bad, but not as bad as 5 reports for the same bug from the same person over the cause of two days (Hi Michelle!).

    Even better than frequent bug reports are bug reports with instructions on how to reproduce the bug. If I can reproduce it there is a 99% change that I can fix it.

  • Bug "IllegalStateException: Entry was null in bindView. cursor.getString(0) =,2005:reader/item/xyz cursor.getPosition()=n

    This one is hot off the press. Version 1.8.0 had a concurrency issue that fortunately was found by Aaron Chancey literally minutes after the release. Together we were able to reproduce the concurrency issue very quickly and he also found that I yanked one permission too much when disabling the ads. Aaron, thanks for your swift support.

    Unfortunately fixing this concurrency issue was not a small thing. So I might have introduced more errors, but I hope not. On the sunny side, look at the scroll performance of the Article List. To fix the bug I adapted code that I developed during the performance project.

I will now work on making the download method configurable. In the future you should be able to define on a per-feed-basis if it should be downloaded as feed content,  downloaded as feed content + the website, or not downloaded.

Update: There was also a problem for first-time-users when NewsRob was started the first time on a fresh SD card. This is fixed in 1.8.4. This bug was reported by y2kcong. Thanks for helping with the testing.