Posts

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....

Bullets List in Android?

  A much needed, sometimes hidden in the framework, and mimicked with unnecessary WebViews and sort of inner HTML injections to xml resources – a bullet list is much easier to implement then you would expect. When taking the easy solution – using WebViews , you are making the UI hierarchy much heavier then it should be, and when your UI is already rich with layouts and widgets, it seems bad to overload it with heavy WebViews. The Android.text framework gives us – the developers an easy to use API to build special text spans, in the next code snippet we’ll see how a bullet list can be implemented: let’s say we have a simple TextView which we need to hold a text with a bullet at the left hand of it: TextView mTv = (TextView)findViewById(R.id.tv_1); CharSequence cs = getText(R.String.sample_text); SpannableString ss = new SpannableString(cs); ss.setSpan(new BulletSpan(15), 0, cs.length(), 0); mTv.setText(ss);   Explanation: 1. Get a hook on a TextView 2. Construct ...

Xamarin – Use of an ORM , SQLite.Net

  When dealing with a mobile application, storage is a feature we cannot live without, whether it’s to handle relational data or persistent data in general, which is queried for different operations throughout it’s lifecycle. Most if not all mobile platforms offer SQLite database storage method which consists of a helper class and some method of initialization and querying which are both declared by the programmer. In most cases, it’s just some boilerplate code consisting of declaring table names, column names and types, primary keys, foreign keys.. and all that jazz. But we are discussing cross platform native development here, let’s see what’s what in the area of local storage in Xamarin. Ok, so the classical model of a cross platform application consists of a Core project, which is actually a .Net class library, and a couple of platform specific projects which have a link to the Core project. Each of the platform specific projects have – you guessed correctly, platform specif...

Introduction to Android native development using Xamarin’s Mono for android.

  It’s been couple of months since I’ve had a chance to post here, but it’s been an amazing time for me in terms of adapting new/old technologies for my development skills, and I have a bag full of new knowledge which has been accumulated and is waiting to be put on the blog, So in the coming weeks I’ll start posting a lot of code samples, architectural guidelines and how-to-do’s. In My professional career as a software developer, the first contact I had with OOP was with C#, back in 2007 as part of a course I took for web development which involved mostly ASP.Net, Windows forms and at the time - the diapers of WPF and Silverlight which were the latest buzz by Microsoft along with c# 3.0 and the 2.5 .Net framework. As time passed, I took on Java in order to acquire the skills which will allow me to program for the Android platform, which is my (Native) passion in the last 3 years or so. Developing for Android in Java is really something all java programmers are able to adapt to as...

The SELA Developer Practice Android app

Image
  For the last couple of weeks, I’ve been working on an App which offers the users interactive information regarding the Sela Developer Practice conference to take place on may 5th and will include dozens of lectures and international speakers which will present new technologies and trends, as well as advanced topics in the fields of Client/Server and Cloud/ALM and VS. The app communicates with couple of web services to consume the JSON data which is than processed on the client to show it from different points of view and arrange it in dynamically generated views. I took the inspiration from both the official website http://www.seladeveloperpractice.com and the app for Google’s IO which is published every year. The app shows info on the Speakers including twitter and blogs, as well as extensive info on the abstract of each session. You are welcome to try the app and rate in on Google Play: https://play.google.com/store/apps/details?id=com.selagroup.sdpmay2013

Properly save battery Life Throughout App’s lifecycle

On every Google IO, many advocates for the Android platform demonstrate and teach us how to build great apps. The term “Great Apps” consists of many aspects – user experience, performance, saving battery life, not wasting expensive 3G quota and more..in this post i’ll try to demonstrate a simple way to not waste battery life in an Animation oriented activity. Let’s say that after displaying a nifty splash screen, your main activity consists of some animations which act in some sort of an infinite loop, to change pictures, articles, maybe polling data from a web service (asynctask of some sort). needless to say, that all of these processes take a lot of juice from the battery, so why worry about it? well, if we are focused in that activity, there’s not much we can do because it’s in the foreground and the user probably has some interactions with the current activity. but what happens once it’s not focused anymore? all these tasks don’t just stop themselves, it’s in our respons...