Displaying posts in a native mobile application.

112 views
Skip to first unread message

Jamie Maddocks

unread,
Jan 4, 2013, 7:51:13 PM1/4/13
to tumbl...@googlegroups.com
Hey I was just wondering how other people have gone about showing posts in their mobile apps, be it iOS, Windows Phone or Android.

Retrieving posts in HTML (rather than raw or markdown) format seems the best way to get all of the information (blockquotes, links etc, as raw doesn't provide these)

My first thought was to parse through the HTML and construct the layout myself taking into account all of the different elements, this seems like a lot of trouble and while not amazingly hard it could take a little while.
The second thought I came up with was to just take the HTML and throw it into a UIWebView (provided by apple) to let it do all the rendering, obviously this gives me less control and it's harder to access elements that would be interacted with by the user (images for example) and then just style the web view by coming up with some CSS to add to the HTML before I tell the web view to render it. (I assume android has something similar to a web view?)

(Note I'd only be using the webview to render the text and blockquotes and links in each post. I'm NOT suggesting doing it the way the tumblr for iphone does it before 3.2)

So I've been thinking this over for a few days and I thought the best solution would be to get your opinions and see what some of you have done, if I recall correctly someone made a tumblr client for Windows Phone on here so it'd be interesting to hear how they went about doing it.

Thanks!

Steven Pears

unread,
Jan 4, 2013, 8:45:13 PM1/4/13
to tumbl...@googlegroups.com
Hey Jamie - good question!
 
I'm still making updates to my app on WP7/8 to get the new functionality in, but this is a question I've taken several approaches to since I wrote the first version of my Tumblr client.
 
The main drawback for Windows Phones is that although MS give you access to a web view control, the limitations of that control are extensive - especially how difficult it is to accurately size when you have a lot of variable height items, like someones dashboard -  meaning that it's just not a feasible option.
 
Early on (the first two major version I released) I worked with building a XAML framework from the HTML structure. I had the same concept you did. The issue there was variety - my app isn't anywhere near my day job, so creating a framework that accounts for all the different variations within the HTML structures you can get on any average request to your dash? I spent all my time fixing the big issues with the post format rather than on the functionality that actually got my users to use the app in the first place. And that's ignoring the performance impact of creating that sort of content on the fly.
 
I did play with markdown, my app posts are still markdown compatible when they're created for ease of formatting. But you end up falling back to HTML for those posts they create on the website directly, so you're back to square one.
 
So for rendering a list of posts, I use the text filter on the post requests. I rely on blog/reblog and type-specific templates to give each post type its own layout. But the captions and text content are just plain text. It's fast and easy to manage - quick to render in large quantities - and my menus give the user access to the actual post using its permalink, so if someone wants the rich text it's only a click away.
 
As an alternative view, for the Win8 version of the app I was able to use HTML/CSS as the whole app uses browser tech, and I actually I had to work harder to get the posts looking right when I could render the full html. I was surprised how much I didn't lose by saving myself that hurt.
 
I'd be interested in other opinions, I know there are other .NET developers on this group, but I'm unsure if any of the other Windows Phone clients are represented. The issues I had weren't so much to do with the content itself, more the hurdles I hit on the platform I was using, so I hope you get a range of feedback.
 
Let us know how you get on.
 
Steven

Stumbler Dev

unread,
Jan 5, 2013, 7:05:32 AM1/5/13
to tumbl...@googlegroups.com
For our Android App we:

1. Retrieve the post as raw
2. Create a whitelist of allowable tags
3. Process the post using the whitelist and Jsoup (Jsoup.clean())

Here is an example of a text post formatted through our app:

https://www.facebook.com/photo.php?fbid=474828279234711&set=pb.332538340130373.-2207520000.1357387367&type=3&theater


Message has been deleted

Jamie Maddocks

unread,
Jan 5, 2013, 1:54:04 PM1/5/13
to tumbl...@googlegroups.com
(I can't edit my first post but obviously I meant text doesn't provide blockquotes, links, etc, raw obviously does either through markdown or html)

Thanks for the info Steven and Stumbler Dev.

My concern with using the text filter to retrieve posts like you do steven is that you lose all hyperlink information, do you just not render links in your posts and rely on the user to go to the permalink'd post? It seems like that could be a big function lose that users wouldn't like. Thanks again for your input on this.
Reply all
Reply to author
Forward
0 new messages