📜 ⬆️ ⬇️

Productive procrastination: development for BlackBerry and Tizen



I am not a fan of Android. And a bigger non-fan of Java. Therefore, when I faced the task of finishing porting my iOS / Mac / Win8 / WP applications on Android, I preferred to do anything just to delay this happy moment: I went for an interview to Moscow to the position of iOS developer to Britain (failed), did out of turn two cards to my strategic game, I watched the film “Frames” (“The Internship” - really, it was not worth it), made pontovye stickers on the MacBook and ... singled out two times every two weeks to port the same application to BlackBerry and Tizen.

Here I also will tell about these four weeks of my life under a cat.
')
Ps. Do not rush to minus, I'm not going anywhere, and will make the port of the application on Android ... after porting everything else ...

I would venture to place this post not in “I am promoting”, because, let's be honest - you don’t "press" much on BlackBerry in Russia, and Tizen hasn’t come out at all. On the other platforms, my application is already expanded to the level I need, and again, Russia is a small penny. If anything, please do not ban, but just transfer ... thank you. I will not explicitly call the application, the attentive reader will find it below in the screenshots.

Everything happened spontaneously. I ended up on the Hackathon as part of MobileFest'13 in St. Petersburg, where I met the head of the Russian branch of BlackBerry. Having told about my application for iOS / WP / W8 / Mac, I asked if it was possible to get a BB device for development. A minute later I had a device.

Under BlackBerry 10, you can write using HTML5, Adobe Air, repackage Android apps and write Native apps in C ++. Well ... I don't own any of these technologies. HTML is not mine, Air is without comments, about Java — see above. So, choose the "direct" method: C ++. On the pros, I last wrote laboratory work at the institute of the year in 1998, so I bought a book on Qt (I never opened it, selling cheap).

About registration on the BlackBerry Developer portal to write nothing special. We go and register. For a withdrawal, a PayPal account is indicated (I haven’t received any payments yet, even less than a month has passed since my product was in BlackBerry World).

The SDK is downloaded, installed, and ready to go. IDE based on Eclipse, but it works very fast. Simulators in the form of VMWare images are loaded and work without complaints.

General documentation for the BB Native SDK is at a good level, everything is described, though not very detailed, but it’s clear where to dig. But the documentation on the classes themselves at the level: the function returns the result, takes the time parameter, which means you won’t believe the time ... However, this is not a problem either. On StackOverflow there are answers to some questions, to the rest you can find answers or ask them at the developer forum.

Qt I really liked. The SIGNAL-SLOT model makes it possible to do without writing delegates and not to create “extra” classes (interfaces, delegates, etc.). I love the “short” code, and I liked the concept of the sub-classes Builder. The builder class returns itself, while having setter methods for most of the properties of the object, for example:
ScaleTransition * transition1 = ScaleTransition :: create (noteView) .fromX (1) .toX (0) .fromY (1) .toY (0) .duration (300) .autoDeleted (true);

QLM? No QML, just hardcore. I do not like descriptive interface languages, and even more so, with interspersed scripts in a non-native language. In addition, I believe that working with interface objects exclusively from code greatly helps in the initial development phase to delve deeper into the ideology of the framework (yes, XIB and StoryBoard for iOS is also not my choice ...)

By itself, BlackBerry Cascades (GUI framework) is very slim. There are all the necessary components, properties, animations, etc. Even if you take a couple of steps away from the standard interface, there are no problems. Gesture handlers work great, everything is rendered very quickly, resources are read instantly.

What "features" had to face:
1) If the control is turned at some angle, then tapas are not processed within the control, but within the bounding box (I don’t know how to translate). So you can easily get tapes with the coordinates [10, -20], for example. I had to handle manually.
2) It is necessary to set a picture for the clicked state of the graphic button (in my case it is a LOT of many buttons -> growing application size), so I had to “get bogged down” with a transparent button that had a darkened image on top of the picture itself. Cocoa Touch (iOS), for example, itself darkens the image for the pressed state, if it is not set.
3) Something is wrong with Unicode support. So, for example, the characters “" are displayed as something like “aa = a /”. I didn’t understand, I did it through pictures (in my case this is even a more appropriate solution).
4) The system has only one font with four outlines (Normal, Italic, Bold and Bold Italic) and some muddy descriptions that no other can be used, although they seem to be there. Postponed custom fonts to the following versions.

As planned, on the 11th day of development, the product was ready and went to the BlackBerry World store for testing. Here you are not Apple. Less than a day, and "our key." What can be noted about the store admin panel: 10 keywords maximum, description in any languages, but screenshots are only in English (I found out about this when I prepared 8 screenshots in 6 languages).

If you are writing an application using the Native Framework, then you can definitely apply for assigning the “Built for BlackBerry” badge to the application. Such applications are shown in the store in a separate group Built For BlackBerry (in addition to the common dump). "Knowledgeable people" claim that users are more willing to buy native applications. What, in fact, is indicated by the sales schedule below. At least some sales began on October 12, when they gave me a badge. I want to note that in order to receive a badge, you must have a Privacy Policy (not on the product, but in the company profile, which I, again, learned when I made a PP on the product in 6 languages).


What happened on October 27 - I do not know. But I am happy.

From the pleasant: the shop censors team works quickly, answers the questions adequately, with the desire to help. They promised to include the product in the monthly worldwide newsletter to BlackBerry customers (so far they have not received something).

The BB 10 platform itself, as a user, really liked me. Slender, nimble, without buttons Home (neither physical nor virtual). I even wanted to buy a BlackBerry Q10 (the one with a physical keyboard), but so far I decided to postpone it.

Special thanks to the head of the Russian branch of the BlackBerry, Andrei Kiselev, for his support at all stages of work on the program, before and after. When I “banged out” the test phone, the second one was sent to me by courier the next day.



So, the BlackBerry version in the store, but the reluctance to take on Android ... And Tizen comes to the rescue!

Compared to development for BB, development for Tizen is a struggle. But ... a pleasant struggle. The current version of Tizen SDK 2.2 is still very far from perfect, but ... everything is in order.

Thanks to the representatives of Samsung and Intel at Habré, I went to the Russian division of Samsung, where I was first advised to come to Moscow on October 23 for a seminar and there already get a test device. Fortunately, I managed to convince absolutely adequate and friendly managers that by the 23rd day I would have already provided an application, and I need a device earlier. After 6 days, after registration of all paper formalities, the test apparatus turned out to be with me.

Registration of the developer, too, it makes no sense to describe. The SDK is also downloaded, installed, and ready to go. IDE is also based on Eclipse, but insanely braking (I have a MacBook i7, 8GB, SSD. Note BB IDE on the same Eclipse I fly). Emulator based on QEMU. I don’t know what these letters mean, I would call it SSEE - Super Slow Emulator Ever (I didn’t find any checkboxes about hardware acceleration, or I couldn’t turn it on). Here without a test device in any way.

You can write in C ++ or HTML5. I think my choice is clear to you ... After reading HIG and getting acquainted with the structure of the framework, we get to work. And boredom immediately leaves us ...

The first thing I came across was the absence of the ImageView component. Button is, Label is, Panel is, Slider is, TextArea is ... everything is there. And ImageView is not. But we need to write, not cry, therefore, depending on the situation, we use our own implementation of ImageView (with AspectRatio and InterpolationQuality) or ... Button in disabled mode with a picture. If anyone needs it, I can share the component.

Further, JPEG files are not read correctly (with strong compression), Tizen confirms the bug and advises temporarily using the method with explicit format indication. By that time, I really realized that I did not need him at all ...
  Tizen :: App :: Application :: GetInstance () -> GetAppResource () ->
 GetBitmapN (resourceName, BITMAP_PIXEL_FORMAT_ARGB8888). 

The Label component forgot to make properties for specifying the right margin, and it is about 20 px, with which nothing can be done. And at EditArea, not only the right margin was forgotten, but the left margin setting does not work for values ​​less than 20 px. We have to decide the layout. I’m not saying that EditArea has forgotten to make the FontStyle property (Normal, Bold, Italic) ... you can’t get around this.

How to set the Native application to work only in portrait mode “in a human way” is also not clear, you have to write forms and frames as Tizen :: Ui :: IOrientationEventListener, wherever possible, and to conjure there.

Gesture handlers work disgustingly. For example, PinchGestureRecognizer behaves perfectly if two fingers are oriented SW-NE (south-west-northeast), but the component mercilessly sausage, if vice versa. I did not succeed in mixing handlers with low-level tap handlers. As a result, all processing is only in tapas (as in the good old days before iOS 3.2).

And where is the rotation of the controls? And it is not. There is neither .transform as in iOS, nor .RotationZ as in BlackBerry, nor .RenderTransform as in Win8. But there is RotationAnimation! But it was not there ... the end angle for Rotation Animation can only be 0 degrees ... Valuable. But here you can cheat. If you set the required angle of rotation as you want, 0 as the final angle, and 2147483647 as the duration (approximately 21 days), you can achieve the desired result (and twitch the timer periodically).
  GetControlAnimator () -> StopAllAnimations (); 
 GetControlAnimator () -> StartUserAnimation (ANIMATION_TARGET_ROTATION, 
 RotateAnimation (_note-> GetAngle (), 0, 2147483647, ANIMATION_INTERPOLATOR_DISCRETE)); 

Very pleased with the presence of Scene Manager (workflow). It's something like iOS StoryBoard, but much simpler. In the form of a diagram, the forms and parameters of transition animations are set, then the form factory and panel factory (if applicable) are written (filled), and all transitions between scenes are literally 1 line of code. I agree to that.

Tizen Store is only available to receive applications, the procedure also does not deserve attention. We make a package, write a description, post screenshots, an icon and ... in a day we get approve. One thing upset me terribly - this is the requirement to have a round icon. This ... this ... well, somehow not at all human. I drew an excellent icon from three circles, but I was assured that it would not work.



To publish paid applications, you need to submit an additional application (as long as it is not relevant at all), but I went through this procedure in one day. You can bind PayPal, and you can bank account (USD). I went to the bank, took a beautiful piece of paper about the existence of an account, and together with a copy of my passport I filled it with a form on the website. Let it be in advance.

For the sake of what else I got into Tizen - this is participation in the Tizen App Challenge (http://tizenappchallenge.com/) with a prize fund of $ 4,040,000. Maybe that will get there (acceptance of applications before November 1). And, perhaps, I have high hopes that the app, which will be in the store on the day of its opening, has a greater chance of success (as was the case with the iOS version, which was ready for the release of the first iPad).

Oddly enough, of all 6 platforms to which I ported my application, perhaps the most interesting was Tizen. In terms of new sensations, I don’t know ... freshness? The SDK is still finished and will look more slender. No regrets about the 12 days spent.

Tizen OS itself on the test device is not very impressive. No, she is all right, but somehow it is not finished. Although it is unfinished. The official release is expected early next year, and, as I heard, the interface is left at the end of development.

I thank the representatives of Samsung and Intel: Ekaterina Filenko, Renat Nyazhemetdinov, Kirill Chuvilin and Kirill Danilov for their help in developing and receiving devices, for the excellent master class in Moscow on October 23 and in general for their positive attitude and participation.

But what happened as a result of a month of work:


Now it's Android time ... though ... maybe FireFox OS? How are they doing there?

Immediately answer the questions (which were asked in previous posts about this application):
1) Yes, there are indeed 12 calendar days for everything. And I don’t need to tell me about two weeks for architecture, a month for development, a month for QA and a week of pre-production. This is the lot of "corporations".
2) No, this is not a waste of time. This is a good experience, new acquaintances, and in general, over the next couple of years of sales, a tidy amount of income (for two weeks of work).
3) With BlackBerry, I now get more than with Win8 + WP for the same application (but this is rather a minus in the MS garden). And I live at the expense of iOS.
4) I do not know who and why is buying my application. But someone and for some reason buys. And this is great.

I am ready to answer any questions than I can - I will help.

References:
BlackBerry Developer Portal: developer.blackberry.com
Tizen Developer portal: developer.tizen.org
BlackBerry World: appworld.blackberry.com

Thank.

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


All Articles