Public localizator – web service for online localization of applications

Here i present small but powerful web instrument for public localization of applications and some more thoughts on software translations, which soon will be published as open-source after some tests in real projects.

Public localizator

Public localizator (beta) – is online web solution for fast translation of application strings to many languages by its users. Of course if you have money to invest in localization by paid services – it will be better solution, but if you have project which has wide range of users, which are interested in translation why not to create interface for them. As i had some positive experience of user translation i decided to create simple web tool. This approach is much better than sending some files/tools to your translators –  translation is easy, its continuous process and you can monitor progress at any time.

Continue reading

How to create parallax effect using accelerometer

This is short guide how to create parallax effect using accelerometer on mobile platforms. Some code is related to Android, but all concept is applicable to iOS, etc.

What is parallax effect? There are some more complex definitions but i would define as simple as the following – you move your phone/device in space and some objects inside your application are shifting accordingly to compensate this movement. This allows to create some strong feeling of 3d interface as well as nice interaction effect.

As good example you can check out my live wallpaper (link on market), which is using this effect while rendering particle system of moving objects. More information about this application can be found here.

To create parallax effect we need to grab data from accelerometer sensor (as i found out gyroscope is not present at majority of phones while accelerometer gives enough of data to be happy with it), convert sensor data to relative rotation angles and shift some parts of application interface accordingly. 3 steps:

Continue reading

Stackblur – C++ multi-threaded version of fast blur algorithm

I found nice algorithm for blurring images – Stackblur by Mario Klingemann. It could do the job relatively fast and gives decent quality. You can check it here – web demonstration. As you can see it can be usable even in web projects.

stackblursample

As i wanted to include it to my cross-platform engine i found two c++ implementations: 

First is SSE friendly, second contains some division optimization via static tables. However, both are not using all cpu cores. I took second one as foundation for my implementation, as i expected my code to work on mobile devices with no SSE support. Single-core processing of 1920×1200 rgba image with 100 px radius took only 219 ms (Intel Q9550, Windows 7).

I improved stackblur code to multi-threaded version – on my quad-core cpu speed results as expected showed 4x improvement – 63ms for the same task. You can download the part my lib below and use it as a foundation to your needs.

Download multi-threaded 32bit-color (RGBA) version of StackBlur:  stackblur.cpp

I believe algorithm can be optimized even further – any suggestions are welcome.

Compact lib for JSON parsing (cross-platform C++)

Recently i was in search of compact C++ source code for parsing  of JSON format. This is very simple minimalistic format and its very popular – but i was surprised when found a lot of complex parsers and no simple implementation inside one cpp-h pair. So i wrote one.

mvjsonlogo

Here it is – tiny C++ cross-platform solution for JSON decoding without any dependencies like boost or something: MVJSON.cpp MVJSON.h (version 1.0)

UPD: recent version could be found here: GIST

Continue reading

Alive Numbers 2 – android release of my minimalistic live wallpaper with embedded widgets

Brand new version of live wallpaper –  Alive Numbers 2 for Android devices. Enjoy smooth OpenGl ES 2.0 animation of minimalistic animated background in couple with customisable embedded widgets. New version has adjustable color schemes and ability to hand-tune widget layout. You can choose from set of base animations and play with a lot of options for every widget.

Alive Numbers 2

It can be found by name ‘Alive numbers 2’ or here: https://play.google.com/store/apps/details?id=com.calibvr.minimal

This topic contains screens and details…

Continue reading

Perfomance of complex GL ES 2.0 shaders on mobile devices

There is very nice site http://glsl.heroku.com/, where you can find the gallery of complex GLSL shaders (from very simple gradients to very complex rendering systems). You can modify their code at real-time using provided editor:

heroku

Current implementation of WebGL is using GL ES 2.0 – the same as all mordern android / iOS phones/tablets. So i decided to test if i can use these shaders at mobile applications – and tested their performance on Sumsung Galaxy Note II. Of course i tested only relatively simple shaders expecting them to run slow…

Continue reading

Live Wallpaper under Android can be powered by my cross-platform engine now

After my recent modifications of android part of my cross-platform engine, it is possible to make application also run as android live background. I plan to implement the same feature as well for iOS 7, but a bit later. Here is working example (https://play.google.com/store/apps/details?id=com.calibvr.synctimer):

Synctimer as live background

Android live wallpaper is not a general Activity application – it is special WallpaperService. And you cant implement it in pure C++ using NativeActivity. All my core is cross-platform C++ so i implemented two-way communication between C++ and JAVA. From C++ NativeActivity you can call JAVA classes through JNI and from java service you can call native (c++) methods of engine core.

The tricky part that all this communication involves a lot of different threads. Wallpaper service has its own thread, but rendering should be performed in another one. My native C++ core is launched as third thread and spawns other async threads which could call some java methods. But i got through all this nightmare using mutexed queues of events. As result i got full functionality of my engine at the background of android launcher.

When i only started working with android i wrote small live wallpaper in pure java (with no OpenGL). Wasted only couple of evenings and even lost the source code. But recently i was surprised when discovered that it has more than 100.000 downloads (https://play.google.com/store/apps/details?id=back.livenumbers). It does not even work properly on my Note 2 now.

But the point is that now i have smooth OpenGl ES 2.0 animations/effects in couple with engine functionality. Probably, i will create couple of stylish backs fused with some in-code widgets (like battery indicator, weather forecast, clock, calendar date or something else) as implementation will be relatively easy now using my engine. Any suggestions on this matter are welcome.

Manual decoding of ICO file format – small c++ cross-platform decoder lib

This post is related to one simple task – decode ICO file format from C++ manually (I needed this for one of my projects where i wanted to display fav icons related to web sites and decoder has to be part of my cross-platform framework). As a result you can download small c++ code below (ico.cpp). The description of ICO format you can find here – http://www.daubnet.com/en/file-format-ico. Image data is stored uncompressed so we don’t need to implement some smart decompression algorithms – just read some headers, get data and apply bit mask to fill alpha channel.

icons

As solution i wanted a function like this:  

bool IcoDecoder::decode(unsigned charbuffer,///< input buffer data

    int size,///< size of buffer

    unsigned intwidth,///< output – width

    unsigned intheight,///< output – height

    std::vector<unsigned char>&image///< output – image data

) 

and this function should extract the largest possible image from multiresolution icon.

Continue reading

Brief design guidelines for iOS 7

I have read new apple documents considering IOS7 application design. And here is very short list of features:

Main key features:

  • Full screen (Use whole screen of device).
  • Minimalism. No heavy shadows, bezels, gradients, etc. Borderless buttons.
  • A lot of white space.
  • Key color.
  • Single font (but dynamic size).
  • Minimalistic light single-color icons.
  • Dynamic layout with no fixed hardcoded sizes.

Specific Apple features:

  • Translucent elements hint content behind them. And here they mean specific blurred gradients.
  • Control center could be swiped from bottom of screen.

As you see – only last block of features is related to actual new apple platform. First list can be easily applied to Android or WP. So now apple tries to reach main market tendency to minimalistic design. Not something new. I wonder for how long this fashion will last, but at the moment that style is new standard across all mobile devices.

 

This brief is based on “Designing for iOS 7” and “iOS 7 UI Transition Guide” official documents from apple development  site.