HabraCitizen — a new android app for Habrahabr with a dark theme and swipe navigation



Hello, Hebraist. Tonight in the Play Market was uploaded my first android app — HabraCitizen. The subject is a new capacitance with lots of options and features. Asked convenient Habra client for android devices? Meet :)

Features of the app (from the description in the market):
— Light and dark theme!
— Slide-menu allows you configure the location (left or right);
— Swipe navigation!
— Authorization*;
— Authorized users can see the number of new comments to posts are list posts, and see new comments in a post (comments are highlighted in green)*;
— Ability to download posts for offline reading (with pictures!)*;
— Tech pull-to-refresh to update list to update the comments or the list of posts is now sufficient to pull the list and do not press the button;
— Fullscreen reading posts and questions;
— Customizable separate font in the post and in the comments.
— Almost all possible sections of the site: best posts (per day, week, month, all time), thematic and corporate (zacharenia, new, odobrenie), questions, events, hubs, profiles, companies and users (with the list of published posts, questions, answers, etc)
tape*, favorites*;
— Full search, share posts, questions, hubs, users, comments;
— Support for Harakat
— View a full-sized version of the images on the Tapu (with the possibility of resizing)!
— Start youtube videos in youtube app directly from posts and comments;
The app does not "lose" position when reading the post or comments when you rotate the screen, and also able to recover the loaded post comments or a list of posts even if the application has been "killed" in the background
Is the app able to "catch" links to domain habrahabr.ru and open the appropriate section automatically;

* authorization and download posts for offline reading available in the full version, which you can unlock from the app. More on that below.

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

Interested? Ask under kat (carefully, a ton of pictures).



the Backstory


I was interesting to the android platform and the android market applications. For heating of interest in January 2012, has been bought by Android smartphone — Incredible S. the idea was to take and write something. But, as usual, the presence of the device and the possibility of development is not generated by themselves, the idea of any application. Therefore, the development was shelved, however, in my spare time I read literature on Android and still trying to put a least some objective goal.
At the same time I often and in large quantities read Habr. And because I wanted to be able to read it, not only sitting behind the monitor, but also on the road with the phone, then I got 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 works IT shnogo wing does not have any normal android application.
Available in the store customers buggy and had very limited functionality. Of them in a better way stood only HabReaderwhich I decided to use it. However, "stood for the better" does not mean "was perfect." During use, I have accumulated a lot of claims to the work (please note that the author corrected many of the problems in the February update, but its development began much earlier):

— The text in posts are not formatted to the screen width by adding a horizontal scrolling;
— There was a dark theme;
Comments were loaded separately and were not loading (it was unclear, they are loaded or not);
— Search only works on posts;
— Attempt to go to the "Events" led to the departure application;
etc.

So I came up with the idea of a "finished" app and to upload changes to github by the author of the project. So there was a specific goal.
I take this opportunity to convey to the author HabReader thank you so much for sharing sorrow on github — without them, development would have been delayed indefinitely, because I knew almost nothing then about android and Java (any HelloWorld does not count). And available source code gave me the necessary Foundation, and downloading them, I took up the study...

Development



Directly development only started in January 2013 on Christmas vacation. Tired of the drinking and toiling from inaction I was trying to think what to do. And then I remembered the source HabReader'a and his desire to dig deeper. I began with choosing an IDE. And it's worth making a small digression...

a small digression

the Official guide for Android from Google recommends the Eclipse. The reasons are clear: free, cross-platform, blah-blah-blah. "Okay," I said and put Eclipse. Installed ADT plugin and imported the project. "Not so simple", happily reported Eclipse and highlighted blood red the whole project. "Okay," I said, thinking about passed on from generation to generation, the legend about the incorrectly imported as R, with the words "Stackoverflow to the rescue!", put a request to Google. "OVER9000 results," replied Google. The 1st link did not help, the second helped, n-th! — did not help! I have optimized imarti, preinitial the project, restarted Eclipse, rebooted the computer, rearranged the android SDK and ADT plug-in nothing was my answer. Yes, I know that was supposed to help, but for some reason not helped. A new project? No problem. Import? Fuck. A new project copy-paste files from an existing project? Fuck. Moreover, when I created the XML file layout'a and tried to edit it in text mode, Eclipse, did something terrible — ruined the whole xml completely. Closing tags was above the opening, the colour code went to hell, try to put the cursor in any place or highlight the text has led to a new combination of the mosaic. Eclips'a restart did not help. It got to the point that I had to open the xml file in regular Notepad and edit it there. "Damn you, devil!", I said in anger after this and vowed not to use this insidious IDE.
However, writing code in Notepad and compile it via the console I did not, so I sent a gaze to the IDE, which has long wanted to try Intellij IDEA.
By the time IDEA just got editor layout'a dark theme. I put Community Edition, launched slightly pomateritsya trying to import project... And then saw the light. After a Eclips'it was just IDE dreams! Speed, really intelligent code-assist, easy to use interface, bezglyuchnost, excellent refactoring... My experience can be largely described in one sentence: "Wow! Here you can do that?!". While I was driving home after work, I'm just itching to get pokodit anything just to pokodit in IDEA. Is this not the perfect IDE? A tool with which we should not fight, and that really helps and speeds up just at times. You can consider it PR or advertising, whatever, but if not the guys from JetBrains and their offspring, I in time learned the android platform (as much), and it is unlikely you now have read this post (perhaps via the app ;). Rays of goodness to them!


Thus, selecting the IDE, I started coding. Kodit had exclusively at night after work, starting in the morning, when I came home (so now I have a floating schedule) and ending at 6-7 am. On weekends, I just had fun, and pohmelitsy after Friday, kodil for 15-16 hours in a row. It was all drums and a powerful wave of enthusiasm that nourishes better than any Red Bull a, and I was in a rush. Had a goal, was excellent and smart IDE — work was in full swing. Gradually I realized that the list of features that I would like to implement quite a pull on a separate application, because the code has been rewritten almost completely. Since then, the development was carried out as a separate development project. Ideas for implementation and ideas for implementation were born one after another, but the fatigue "nastacuas" and at some point I realized that it was time to stop. The ideal is unattainable, and attempts to get closer to his radiance could easily lead to "burns" in the form of a hulking monster, filled with glitches and bugs instead of the application.

Some time of catching bugs, read the documentation for publish applications, billing and account settings developer screenshots and here is the result. UV.

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

features


Dark and light theme

Yes! What have been asked in the comments and reviews of other mobile Habra clients (and I regularly patrolled these reviews).



Slide menu

Fashionable and highly convenient menu swipe from the edge of the screen (in the settings you can specify the location — right or left):



Swipe navigation

Another thing that is very much requested. Now go between the lists of posts between the post and comments to it, between the tabs in the company profile, Habra-user hubs can be a simple swipe.




Pull-to-refresh

Technology pull-to-refresh (like in Vkontakte or pulse) to update the lists of posts, comments, questions, events, etc.



Authorization

Authorization is possible with a conventional Habra-login or linked accounts of the social networks (for example, I am using G+ I go to the captcha to enter). Authorization gives access to the ribbon (posts, questions, events), elected (posts, questions, comments) and also allows you to see number of new comments to post counter comments (+green numbers), and see those same comments in the list of comments (new comments are highlighted in green). Remove the highlighting of a comment by tap on it.





Available in almost all sections of the site

Positions (best, thematic, corporate), questions (incoming, hot, unanswered), events (upcoming, current, past), tape (post, questions, events), favorites (posts, questions, comments), hubs with relevant posts, issues and events, profiles of companies with blogs, questions/answers, events, subscribers, user profiles, blogs, question, answers, comments, subscribers — all in one app.













Offline-reading

Another feature which many had requested, and the save posts locally on the device reading them, say, on the subway on the way to work. The application is able to save posts and questions (all with comments), however, the posts can be downloaded in the "from the stacks". You can specify a section of tape (for authenticated), theme, best, corporate, as well as the number of posts to download (in "new" or "best of day" can be downloaded all at once). This part is similar to the iOS application lHabr. After clicking "Download" the application will first collect information about the URL-s to download the data, then add in status bar new notification with the download progress (progress, unfortunately, is only available for Android 4+, in older versions the possibility to add it to the notification no). First, data is being downloaded from the Internet, and then save on your device. After saving triggers the process of caching images, so read the posts and comments offline will be much more fun :) Just disconnect your Internet immediately after you save the post (especially if you rocked a lot at once).




full screen reading mode

Now there are no headers, and tabs will not interfere with your reading. To return to normal mode, tap on the text in the post. Auto-opening in fullscreen mode, you can set in the settings.



set 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's no need to expose them every time.





Search

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



an Increase of pictures and run video

And again often referred to in the queries feature. Now the pictures in the posts can be viewed in full size version — just tap on the picture. Full version to resize.



Video had to torment — launch video inside a WebView component that is used to render web pages, very heavy, uncomfortable and glucan. The video does not run, then no sound, it was sound, but instead of picture — black screen when trying to view full screen, the video was cut... I spat on it and decided to start the video in the native player. 90-95% of habré video is from YouTube. The YouTube app is available on almost all Android smartphones. So I did the next best thing — was being parsed on loading the HTML page, cut out the iframe with a youtube video, designed the correct URL and insert instead frame your div with a link and a picture. On the top of the picture in the youtube-player opens youtube videos. Kind of convenient.



a Bunch of nice little things

Switched Harakat



The ability to immediately open a post in browser (from the list or from the "reading" post)



The name of the author of the post highlighted in red review (convenient — no need to remember the name or constantly to go to watch it :))

image

Posts as well as on the website indicated by check marks (translation, tutorial, sandbox, and recovery). Moreover, for those who like to read the article-translation in the original I added a special item in the context menu — open source ;-)



The app is extremely tenacious 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 point where it was interrupted. A list of posts, questions, events, etc. will be automatically restored. The application also is not afraid to rotate the screen and does not lose the reading position at the same time :)

So that's got flourish.

about monetization


If you remember, at first the app was planned as a refinement of existing HabReader'a, and therefore completely free. Subsequently, I moved on from the idea of "dopisivanje" to the idea of "zapilivanija" something of his, still free. However, as time went on, the application grew, coupled with fatigue and I started to think about the possibilities of monetization to improve, so to speak, of motivation. No less interest for me were the opportunity to study Andropovsky payment system, because for me, everything in the platform was new. The first was a crazy idea to make "unobtrusive" ads, but the idea pretty quickly was executed with extreme cruelty, for I myself can not stand the apps advertising. The app itself is paid to do I in any case didn't want. And therefore there was only one way — the separation of functionality for free and paid.

— Writing comments to posts;
— Adding posts and comments to favorites;
— Ability to vote for posts and comments;

so I do not blame me for my shameless greed :)

Result



The application is ready, posted for all to see. I, in turn, is ready to critique and feedback (I hope it will be). Enjoy, write reviews, thank you all for your attention. Enjoy!

special thanks

Colleague dj_raphael for help in testing;
Colleague lilislilit — for an invite to habrahabr birthday;
Abrowser NOSTRA — for a wonderful library of Universal-Image-Loader to asynchronously load images;

Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Briefly on how to make your Qt geoservice plugin

Database replication PostgreSQL-based SymmetricDS

Yandex.Widget + adjustIFrameHeight + MooTools