⬆️ ⬇️

How we wrote a Symbian client for VKontakte

Today we want to tell about our experience in developing the VK application (Vkontakte) for Nokia smartphones. At that time, when we decided to start working on it, we already had a lot of experience with the Symbian platform, and it was interesting for us to continue to create various applications for this platform.



We have been working with Nokia for a long time. The company provides us with partner support in the process of developing applications for Symbian, providing advice and participation in various programs, holds events where you can communicate with developers from other companies and offers interesting and promising projects. One of these projects was the VK application.



The idea of ​​creating a client for vkontakte.ru was in the air. Nokia is the largest player in the smartphone market, and in terms of the number of devices supported, the Symbian platform in Russia is a leader. However, previously there was no official link between these huge services. We are pleased that we helped to implement this project.

')

We are proud that of all existing VK applications for various platforms today, which we have created for Symbian, is closest to the structure of the site itself. To achieve this, we worked closely with the developers of Vkontakte for several months. For application development, a developed API was used, published on the website vkontakte.ru . It should be noted that at the time of developing the VK API application was actively developing, it was being finalized, including with our participation. So, in the process of collaboration, it became possible to add captions to photos when they were created and delete albums. The current network status of the news author has been added to the news list. It became possible to receive statistics on the user's page (number of photos, notes, friends, etc.), lists of the most popular friends. The mobile version has the ability to send messages with attachments. We also helped to find a few errors in the API, which VK developers quickly corrected. For example, the method that hides news from certain users did not initially work, it was impossible to see your photos poured on the wall, incorrect paths came to video files, etc.



It was interesting to work with the design of the application. Before starting the development of the application, we were provided with an interface concept developed for the iPhone version. It would be wrong to use such a concept directly for Symbian, and implementing the application through the Symbian controls is not very nice, since we wanted to make an application that is stylistically similar to the original site. In the first version proposed by our designers, all elements were very large. But on modern Nokia smartphones with large screens, the size of the elements began to seem too cumbersome. As a result, our designers changed the appearance of the application several times, guided by the site design and usability requirements of the mobile application. The final version was obtained with the active support of VK designers to maintain a common course in the style of icons and colors.







The most important problem in the development for us was playing a video. VK server supplied video in two versions: FLV and MP4. However, Nokia devices did not support the MPEG-4 codec settings that the VK server used. We suggested that the server-side developers transcode the content into another format, but it was risky, since it was possible to break the support of other platforms and, at the time of developing the application, the video was not recoded. After discussing the video receiving API, fields were added to receive platform-specific video files, but at the time of release, the application could not play a significant share of the video on many devices. Now, our testers say that there are no problems with the playback of videos from VKontakte in the new firmware of smartphones.



The application was executed on a minimalist cross-platform graphics engine developed by SPB Software, the main language is C ++. The concepts of Model / View were used, the application logic and graphic components were rather strongly separated. The general approach resembled the development of an application using QML: almost all graphical logic is described in XML, and in C ++ source codes only the logical part is processed. A small mediation module allows you to convert structures received from the server into graphic structures using the code only for special cases. For presentation in the program of API'shnyh structures, a code generator written in Python is used, which transforms the formal minimalist definition of structures, taken from API pages, into a form convenient for C ++ applications (typed structures, with support for interfaces, all necessary declarations and functions). If necessary, minor operations with the fields of the structures, it was possible to prescribe a small functional right at the definition level. It was required to get time in a different format, a combination of a name and a surname in one line, etc., as if it were a regular field.



The graphical components of the Qt library decided not to use for the simbanov version of the application for the sake of increased performance, stability and convenience for users (on the main mass of devices, additional actions would be required to run the application).



Typical software solution: to minimize dependencies and simplify code, functional objects (functors) were actively used. Their active use allows reducing the number of abstract classes, which has a good effect on the support of the code. For example, the function to upload a file looks like this:



template<class T> Functor<void, void> FireRequest( Connection& connection, const String8& url, Functor<void, T> on_succ, Functor<void, ErrorReason> on_fail ); 


Typical function of calling a dialog or view panel:



 Functor<void, void> RunWaitDialog( const String& text, Functor<void, void> on_cancel ); 


A clear separation was used: in the engine (for working with skins, url, etc.) there are 8-bit strings, and in what the user can see, platform-specific Unicode.



Memory management was carried out using analogs boost :: intrusive_ptr and boost :: weak_ptr for objects and using STL containers for arrays, etc. STL was used as is, there was no dependency on boost. The use of manual memory management (use delete) has been kept to a minimum.



Another feature of working with the Vkontakte application is that all the time it was necessary to follow the development of the social network, the emergence of new features, functions, improvements in design. Vkontakte is a dynamically developing social network, and the official Vkontakte application should not lag behind it. We tracked the site optimization process and changed our application in accordance with it. Changes to the site during the development required rework design and dialogues. We didn’t manage to do some things, such as dynamic loading of news lists.



A month before the release of the program, active beta testing began, in which hundreds of people took part. In any beta testing, besides searching for bugs, the most important thing for a developer is how the user evaluates the program, how much he liked / disliked it, whether he will be ready to use it in the future. And we were very happy to receive positive feedback from beta testers Vkontakte. We realized that we were moving in the right direction and creating what users need. As a result, by the middle of October, more than 600 thousand users downloaded the application from the Nokia store.



Work on the application was very interesting. Nokia advised us on technical issues and provided marketing support, and thanks to the API and ideas provided by Vkontakte, we didn’t have any particular difficulties in development.

Source: https://habr.com/ru/post/130224/



All Articles