Implementing background upload queue with Swift

Author is a professional software developer providing android and iOS development services. More info here.

I’m working on an app that lets users select a bunch of photos, upload and share them with other users. Sounds simple enough: user selects photos, app uploads photos, user shares the album. More realistically though: user selects photos, app starts to upload photos, user figures out this might take some time, user leaves the app to do something else, iOS suspends the app (or even worse terminates it), user comes back to find out the job is not done :( We don’t want that, do we?

Continue reading Implementing background upload queue with Swift

RecyclerView “swipe to delete”. No 3rd party lib necessary.

Author is a professional software developer providing android and iOS development services. More info here.

Checkout the code at the github repo.

Big shout-out to the guys creating libs for all the stuff Google promotes but doesn’t give us code for just yet, but the fact of the matter is I prefer not to use those libs unless I absolutely have to. The lib you include in your project might be doing a lot more than you need it for and with that comes a burden on your precious method limit count, possibly longer builds, another lib you and your coworkers need to keep in your heads…

The other day I had to implement “swipe to delete” feature. I wasn’t very happy about that since I feel that it’s not very discoverable and that those kind of gesture based actions shouldn’t be the only way to access the feature, but that’s another story. Still remembering how difficult this was couple of years back on a ListView I’ve started googling and soon enough there was a simple SO post with a simple solution and the best part – no 3rd party lib needed! However, it wasn’t to be so easy in the end.

Continue reading RecyclerView “swipe to delete”. No 3rd party lib necessary.

Yet another post on Serializable vs Parcelable

Author is a professional software developer providing android and iOS development services. More info here.

All my android developing life I’ve used java serialization as a data transfer mechanism between activities. I was vaguely aware of Parcelable and it proclaimed benefits but never really saw any performance issues related to this and thus never had a need to start writing all the parcelable boilerplate in my classes instead of just marking them as Serializable. When I recently started working on an ongoing project I’ve quickly jumped ship since: a) it’s supposed to be an order of magnitude faster and b) there is an awesome code generation library, Parceler, relieving developers of writing the boilerplate while keeping all the performance goodness.

I’ve just finished implementing my first big feature in the app and all was well until our amazing QA guy came to me with an issue – app was crashing on transition from one activity to another – throwing a TransactionTooLargeException (or just logging E: !!! FAILED BINDER TRANSACTION !!! on pre 15 API levels). And he wasn’t even trying to do anything crazy. Quick google search led me to a world of remote procedure calls and binder transaction buffers, a world I was blissfully unaware previously. So there is this binder transaction buffer, and it appears to be limited to 1MB, and it is used by all ongoing transactions simultaneously. I am moving a fairly large object graph through an activity starting intent, and maybe I’m not supposed to be doing that, but surely I can’t be hitting a 1MB limit? Or can I?

Continue reading Yet another post on Serializable vs Parcelable

Android case study: placeholder image and memory consumption

Author is a professional software developer providing android and iOS development services. More info here.

I’m trying to optimize and lower memory footprint of an android app, and increase performance by doing that. If you want to see what’s been using up your memory you can use Eclipse MAT – Memory Analyzer Tool. You can plug it in to your Eclipse or use it as a standalone app, it’s easy to use but also have a lot of advanced options. I’ll talk about the tool itself some other time, today I’ll present a case study in which I’ve used it.

Continue reading Android case study: placeholder image and memory consumption

Designing android apps begginers guide – introduction

Author is a professional software developer providing android and iOS development services. More info here.

More often than not, designer I’m working on an any given project had no previous experience with android. That is way I want to write a series of articles as a beginners guide for designers entering the android realm for the first time.

Continue reading Designing android apps begginers guide – introduction

Converting an android app to a library

Author is a professional software developer providing android and iOS development services. More info here.

Are you trying to convert your android app to library? It’s very simple, just go, Properties->Android,  thick Is Library and that’s it. At least in theory, but here are couple of advices to make it work in real life as well…

Continue reading Converting an android app to a library

Adding things to $PATH on OS X 10.8 Mountain Lion

One of the reasons I’ve started writing this blog is that I was tired googling solutions for same issue every couple of months. The most annoying thing is when you have to make a disproportional effort to do something that should’ve been easy.  There are couple of solutions online for this simple task but not all are working for me. However this one is:

http://architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/#.URa4eFrjkjc

The end :)

Android build target – a controversy

Author is a professional software developer providing android and iOS development services. More info here.

Here is a very good example why are android devs pissed off most of the time (you can find another in this post). Lets find an answer to this simple question: “What version of android should you build your project against?” I claim this should be set to maximum version your app is supporting (the latest existing one obviously)  and a colleague of mine, a respectable senior developer, claims it should be a minimum version your app is supporting. And we are both right because android resources say one thing here and another there.

Continue reading Android build target – a controversy

SVN, Android Pre Compiler and Mac OS X = PITA combination

Author is a professional software developer providing android and iOS development services. More info here.

As far as I’m concerned SVN is a thing of the past. In todays market of SCMs my weapon of choice is git and I’m very satisfied ever since I made that transition. That was easy enough for me, a freelance developer, but may not be so easy for a company for reasons both real and imaginary. That’s why I still have to use SVN for time to time whenever I’m consulting for a company with SVN repositories.

Continue reading SVN, Android Pre Compiler and Mac OS X = PITA combination

How to make Android Google Maps v2 work in android emulator

Author is a professional software developer providing android and iOS development services. More info here.

Couple of days ago I was in for a nasty surprise. Providing android training in a company here in Belgrade I wanted to present a demo app of location sensors and Google Maps API but when I sat to prepare it I realized that only yesterday new Google Maps API v2 for android has arrived :) Not a problem really since I love learning and keeping up to date with changes but not beeing able to run maps powerd app in an emulator was a really  unpleasent surprise. Read on to see how you can make this happen.

Continue reading How to make Android Google Maps v2 work in android emulator