HabraCitizen - a new android application for Habrahabr with a dark theme and swipe navigation

    Hello, Habrasociety. Tonight on the Play Market my first android application was uploaded - HabraCitizen. The subject is a new habratchitalka with many features and features. Asked for a convenient Habra client for android devices? Meet :)

    Features of the application (from the description in the market):
    - Light and dark theme!
    - Slide menu with the ability to customize the location (left or right);
    - Swipe navigation!
    - Authorization *;
    - Authorized users can see the number of new comments on posts in the list of posts, as well as see new comments in the post (comments are highlighted in green) *;
    - Ability to download posts for offline reading (with pictures!) *;
    - Pull-to-refresh technique for updating lists - to update comments or a list of posts now just pull the list itself, and not press a button;
    - Full-screen mode for reading posts and questions;
    - Customizable font separately in the post and in the comments;
    - Almost all possible sections of the site: the best posts (per day, week, month, all the time), thematic and corporate (hackneyed, new, juggled), questions, events, hubs, profiles of companies and users (with a list of published posts, questions, answers, etc.),
    tape *, favorites *;
    - Full-fledged search by resource - posts, questions, hubs, users, comments;
    - Habrakat support
    - View full-size version of tapas (with resize option)!
    - Launch youtube video in the youtube application directly from posts and comments;
    - The application does not "lose" position when reading a post or comments when the screen is rotated, and is also able to restore a downloaded post with comments or a list of posts even if the application was "killed" in the background
    - The application is able to "catch" links leading to the domain habrahabr.ru and open the appropriate section automatically;

    * - authorization and downloading of posts for reading offline are available in the full version of the application, which can be unlocked from the application. About it below.

    Link to the application in the market: play.google.com/store/apps/details?id=com.allesad.HabraCitizen

    Interested? I ask for a cut (carefully, a ton of pictures).


    I have long been interested in the android platform and the android application market. To warm up interest in January 2012, an Android smartphone was purchased - Incredible S. There was an idea to take and write something like that. But, as usual, the availability of the device and the possibility of development did not in themselves generate the idea of ​​any application. Therefore, development was postponed, but in my free time I read literature on android and still tried to set myself at least some objective goal.
    At the same time, I often read a lot of Habr. And since I wanted to be able to read it not only while sitting at the monitor, but also on the road from the phone, I climbed into the Android Market in search of a mobile client. What was my surprise when I found out that for the largest Russian-speaking resource IT'shny sense, there is not a single normal android application.
    Customers in the store were buggy and had very limited functionality. Of these, only HabReader stood out for the better , which I decided to use. However, "stood out for the better" did not mean "was perfect." During use, I have accumulated a lot of complaints about the work (please note that the author fixed many of the problems in the February update, but I started my development much earlier):

    - The text in the posts was not formatted to fit the width of the screen, adding a horizontal scroll;
    - There was no dark topic;
    - Comments were loaded separately and did not have a loading indicator (it was unclear whether they were loaded or not);
    - The rotation of the device led to the "dropping" position of reading the post and comments;
    - The search worked only on posts;
    - An attempt to enter the "Events" section led to the crash of the application;

    Thus, the idea came to me to “finish” the application and upload the changes to the github in the project created by the author. So there was a specific goal.
    Taking this opportunity, I want to thank the HabReader author for thanks for laying out the sorts on the github - if there weren’t them, the development would have been delayed indefinitely, because I knew practically nothing about android and Java then (all kinds of halwords didn’t count). And so, the available sources served as the necessary foundation for me, and after downloading them, I set about studying ...


    Development itself began only in January 2013 during the New Year holidays. Tired of drunken things and struggling with inaction, I tried to figure out what to do with myself. And then I remembered about the source code of HabReader'a and my desire to dig into them. I started by choosing an IDE. And here it is worth making a small digression ...

    little digression

    The official Google Android guide recommends Eclipse. The reasons are clear: free, cross-platform, blah blah blah. “Okay,” I said, and installed Eclipse. Installed the ADT plugin and imported the project. “It's not that simple,” Eclipse happily informed and highlighted the entire project with blood red. “Okay,” I said, recalling the legend passed down from generation to generation about the incorrectly imported R, and, with the words “Stackoverflow to the rescue!”, I drove the request into Google. “OVER9000 results,” Google said in response. The first link didn’t help, the second link didn’t help, n-th! - did not help! I optimized imports, reimported the project, restarted Eclipse, rebooted the computer, rearranged the android-SDK and the ADT plug-in - a bucket with oil was my answer. Yes, I know that should have helped, but for some reason it didn’t help. New project? No problems. Import? Horseradish. New project with copy-paste files from an existing project? Horseradish. Moreover, when I created the layout XML file and tried to edit it in text mode, Eclipse did something scary - it distorted the whole xml cleanly. The closing tags were higher than the opening ones, the color code went to hell, an attempt to place the cursor anywhere or select text led to a new combination of this mosaic. Restarting Eclips did not help. It got to the point that I had to open the xml-file in a regular notebook and edit it there. “Ugh, damn it!” I said in anger after that and swore to use this insidious IDE. The closing tags were higher than the opening ones, the color code went to hell, an attempt to place the cursor anywhere or select text led to a new combination of this mosaic. Restarting Eclips did not help. It got to the point that I had to open the xml-file in a regular notebook and edit it there. “Ugh, damn it!” I said in anger after that and swore to use this insidious IDE. The closing tags were higher than the opening ones, the color code went to hell, an attempt to place the cursor anywhere or select text led to a new combination of this mosaic. Restarting Eclips did not help. It got to the point that I had to open the xml-file in a regular notebook and edit it there. “Ugh, damn it!” I said in anger after that and swore to use this insidious IDE.
    However, I did not smile at writing code in notepad and compiling it through the console, so I turned my eyes to the IDE that I had wanted to try for a long time - Intellij IDEA.
    By that time, IDEA had just acquired a layout editor and a dark theme. I installed Community Edition, launched it, slightly cursed trying to import the project ... And then I saw it. After Eclips, it was just an IDE of a dream! The speed of work, really smart code-assist, user-friendly interface, lack of buggy, excellent refactoring ... My impressions of the work can be largely characterized by one phrase: “Wow! Is it possible here ?! ” While I was driving home after work, my hands were itching to sit down to do something just to get dressed in IDEA. Isn't this the perfect IDE? A tool that you don’t have to fight with, and which really helps and speeds up work at times. You can consider this a PR or advertising, as you like, but if it weren’t for the guys from JetBrains and their brainchild, I would hardly have studied the android platform in such a time (as far as possible), and it’s unlikely that you would read this post right now (perhaps through the application;). Rays of good to them!

    So, choosing an IDE, I started coding. I had to cod only at night after work, starting at one in the morning when I came home (such is my floating schedule) and ending at 6-7 in the morning. On weekends, I just came off, and, having got sober after Friday, coded for 15-16 hours in a row. All this was on the shock and powerful wave of enthusiasm that nourishes better than any Red Bull, and it was a thrill to me. There was a goal, there was an excellent and smart IDE - the work was in full swing. Gradually, I realized that the list of features that I would like to implement is completely pulled to a separate application, because the code was rewritten almost completely. From this moment, development was carried out as the development of a separate project. Ideas for implementation and ideas for implementation were born one after another, but fatigue “insisted” and at some point I realized that it was time to stop.
    Clapping my hand, reaching for the next “mega-idea”, I started polishing my project, catching bugs and making round eyes when I saw a fatal executable with a wonderful stack trace when testing on another device and another version of the OS. Oh, this android zoo, Oh menagerie! There is nothing to be done - you have to put up with it.

    For a while, catching bugs, reading documentation on publishing applications, setting up an account and setting up a developer account, taking screenshots, and here it is - the result. Phew

    Below I would like to tell you more about the features and capabilities of the application.

    Feature Overview

    Dark and light theme

    Yes! That, what for a long time asked in comments and responses to other mobile habra-clients (and I regularly patrolled these reviews).

    Slide Menu

    Fashionable and very convenient menu on a swipe from the edge of the screen (in the settings you can specify the location - on the right or left):

    Swipe navigation

    Another thing that has been asked a lot. Now you can switch between the lists of posts, between a post and comments on it, between tabs in the company profile, as a user-hub, in hubs with a simple swipe.


    Pull-to-refresh technology (as in the VKontakte or pulse application) for updating lists of posts, comments, questions, events, etc.


    Authorization is possible using the usual hub-login or through the linked accounts of social networks (for example, I go through G + so that I don’t enter captcha). Authorization gives access to the feed (posts, questions, events), favorites (posts, questions, comments), and also allows you to see the number of new comments for the post in the comment counter (+ green digit), as well as see these same added comments in comment list (new comments are highlighted in green). You can remove the highlight from the comment by tap on it.

    Almost all sections of the site are available.

    Posts (best, thematic, corporate), questions (incoming, hot, unanswered), events (upcoming, current, past), feed (posts, questions, events), favorites (posts, questions, comments), hubs with profile posts , questions and events, company profiles with blogs, questions / answers, events, subscribers, user profiles with blogs, questions, answers, comments, subscribers - all this in one application.

    Offline reading

    And another feature that many asked for is saving posts locally on a device to read them, say, in the subway on the way to work. The application is able to save both posts and questions (all together with comments), however, posts can be downloaded in a “bundle” mode. You can specify the section - the feed (for authorized), thematic, the best, corporate, as well as the number of posts for download (for the "new" or "best of the day" section, you can download everything at once). This part is similar to the lHabr iOS application. After clicking the “Download” button, the application will first collect information about the URLs from which you want to download data, then add a new notification to the status bar with download progress (progress, unfortunately, is available only for Android 4+, in older versions you can add it is not in the notice). First, download data from the Internet, then save to the device. After saving, the process of caching images is initiated, so reading posts and comments offline will be much more fun :) Just do not turn off the Internet immediately after saving posts (especially if you downloaded a lot right away).

    Full screen reading

    Now, no headlines or tabs will interfere with your reading. To return to normal mode, tap on the text in the post. Auto-opening in full screen mode can be set in the settings.

    Customize the font in the post and comments

    The font in the post and comments can now be configured separately - the result will be visible immediately. Settings are automatically saved for posts and questions - there is no need to set them every time.

    Search as on the site

    The result of the search query takes all the data provided by the search on the site - in posts, questions, hubs, nicknames of users and comments.

    Image Enlargement and Video Launch

    Again, a feature often mentioned in requests. Now the pictures in the posts can be viewed in full size - just tap on the picture. The full-size version can be resized.

    I had to torment the video - launching the video inside the WebView component, which is used to render web pages, is very difficult, inconvenient and buggy. The video did not start, there was no sound, there was sound, but instead of a picture it was a black screen, then when I tried to view the full screen the video was cut down ... I spat on this matter and decided to start the video in the native player. 90-95% of the video on Habré is from YouTube. YouTube application is also available on almost all Android smartphones. Therefore, I did the following - parsing the HTML-code of the page on loading, cut out the iframe from the youtube video, constructed the correct URL and inserted my div with the link and picture instead of the frame. By clicking on the picture in the youtube player youtube video opens. It seems convenient.

    A bunch of nice little things

    Disabled Habrakat

    Ability to immediately open a post in a browser (from the list or from the “read” window of a post)

    The name of the post’s author is highlighted in comments in red (convenient - you don’t need to remember the name or constantly climb it up to look :))


    Posts are also checked with flags ( translation, tutorial, from the sandbox, recovery). Moreover, for those who like to read translated articles in the original, I added a special item in the context menu - you can immediately open the source ;-)

    The application is extremely survivable and does not change its state, even if it was "killed" in the background :) This means that reading your post or comments will continue from the same place where it was interrupted. Lists of posts, questions, events, etc. will also be automatically restored. Also, the application is not afraid of turning the screen and does not lose the reading position at the same time :)

    This one turned out to be a scum.

    About monetization

    If you remember, at first the application was planned as a completion of the existing HabReader, which means it is completely free. Subsequently, I moved from the idea of ​​“sawing” to the idea of ​​“sawing” something of my own, still free. However, as time went on, the application grew, coupled with fatigue, and I began to think about the possibilities of monetization to increase, so to speak, motivation. Of no less interest to me was the opportunity to study the Android payment system, because for me everything in the platform was new. At first there was a crazy idea to make an “unobtrusive” advertisement, but the idea was rather quickly executed with particular cruelty, because I myself do not tolerate advertising in applications. By no means did I want to make the application itself paid. And therefore, there was only one way - dividing the functionality into paid and free.
    Total: in the free basic version, you can still read all sections of the Habr (except, of course, the tape), but authorization and offline downloads are available through activation of the full version from the application. However, for authorized users I plan a lot of further improvements:

    - Writing comments on posts;
    - Adding posts and comments to favorites;
    - Ability to vote for posts and comments;

    so don’t blame me for my unscrupulous greed :)


    The application is ready, uploaded to the public. I, in turn, am ready for a stream of criticism and feedback (I hope it will be). Use, write reviews, thank you all for your attention. Enjoy!

    Special thanks

    Dj_raphael colleague - for help in testing;
    Lilislilit colleague - for an invite to a Habr for a birthday;
    To NOSTRA Habraiser - for the wonderful Universal-Image-Loader library for asynchronous image loading;

    Only registered users can participate in the survey. Please come in.


    • 16.2% Excellent, I will use it! I will buy the full version 153
    • 36.3% Excellent, I will use it, but for free 341
    • 8.5% Good, but there is room for improvement 80
    • 2.2% Mediocre, many problems 21
    • 0.7% Bad, bugs 7
    • 1.4% Bad, don't like the design 14
    • 15.1% I will continue to use the browser 142
    • 19.2% There is no android device, I will not use 181

    Also popular now: