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?

How I did it on android

Some months back I implemented this feature in the android version of the same app. It was fairly straightforward, especially since I did similar stuff many times over the years (I’ve been creating android apps since 2010, feel old yet?). Basically I created a service to do the work, made it a foreground service so the OS wouldn’t kill it even if it’s in a background and voila. After creating Uber clones, music players and voice operated apps background service was a no brainer. …


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


All my android developing life I’ve used java serialization as a data transfer mechanism between activities. …

About

Nemanja Kovacevic

Software engineer specialized in creating native android and iOS apps

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store