Posts

Showing posts from October, 2014

New App - Gamory

Image
Hi All, I've just released a brand new game to the google play store, GET IT AT GOOGLE PLAY It's a memory game, mostly for children but i believe that adult will find it entertaining as well. The game took about a week to develop (most time was devoted to adjusting resources and dimens to all screen sizes) , this has become really tedious but that's the game and if we want to be able to deliver a comprehensive experience to all the users. In the coming days/weeks i'll point out some code I've used in the app, please stay tuned. In the meantime, please take a minute to download the app and use it, let your children and your children's friends play with the app on a phone, a tablet or even a phablet. I'll be happy to get feedback, either for design or performance. GET IT AT GOOGLE PLAY Thanks

Observers and Observables in Android

Within the android framework there’s a somewhat vague usage of the MVC pattern. We can see it happening with Activities, Adapters of all kinds and in fragments as well. But there’s a hidden gem within the java.util package which can be used very easily as the grounds for a publisher subscriber needed scenarios : java.util.Observer, java.util.Observable. The approach is quite easy to grasp and is identical to the usage in other platforms and programming languages. The Observer announces that he wishes to subscribe to events and the publisher holds a list of subscribers which he can notify on data being changed with a simple callback. In this very simple example, there’s an activity which contains a TextView which is updated by values. The Activity implements the Observer interface, which forces it to implement the update(Observable observable, Object data){} which will be invoked by the publisher, the parameters are the reference to the publisher and the data that is being published.