Tips For Developing An Android App: My Training Discovered

Hi! I’m Ivan and I’ve been an Android app developer for quite some time now. Or so it appears. Back in the day (we are talking approximately 2009), Android changed into simply an toddler and I watched the Little Green Man develop ever because. I’m afraid a while ago, Android controlled to outgrow me.

Nowadays, Android isn’t always just on tens of thousands of different phones and capsules. It’s to your wrist, for your dwelling room, to your car, and as soon we start assigning IP addresses to inanimate gadgets, it is going to be quite a lot everywhere around us. A lot of ground for even an experienced Android developer to cover!

Also there are over 1,000,000 apps simply on Google Play, now not counting Amazon AppStore or markets we aren’t usually interested by, like China. Let’s now not forget about countless cell app development organizations that generate billions in sales each year.

So, how can an unbiased developer create a successful app in this large marketplace with big gamers? I don’t have any idea, I haven’t made a a hit app! But, I actually have made a cute one, and I’d want to percentage my tale with you.

Lesson 1: Connect The Dots

Success (typically) doesn’t happen in a single day and this isn’t my first app. I even have ones starting from sudden over-the-weekend development hits like Macedonian Orthodox Calendar, with over 30,000 customers in a language that no greater than four million humans can understand, to extra a hit disasters like TweetsPie, an app with heavy media coverage and a horrible consumer-base of simply over 600 lively customers. A lot of instructions there!

While those apps helped me apprehend the mind of the “elusive creature known as the User” a piece higher, the only that inspired me become a two-hour challenge. Originally evolved to make me a millionaire, once 1,428,571 users purchased the app as Google takes 30 cents out of every greenback, The Dollar App became made to check my merchants account.

Little did I realize that years later I will get hold of an e mail from a satisfied mother declaring that it changed into the nice dollar that she ever spent for the reason that her boy was smiling each time my app gave him a hug.

And that’s how an concept changed into born! Why no longer use the fundamental human want for a hug and make it quite? Make it for a particular target audience, interactive, hard, a laugh to apply, or even extra fun to share.

Lesson 2: Understand The Android Market

All the things I cited above introduced up to a live wallpaper app. The fundamentals are not that tough to guess. Android has a bigger marketplace proportion than iOS, but iOS customers purchase greater. Messaging apps are wildly famous, however freemium games pinnacle the income. China, India, Brazil and Russia are emerging markets, however lack spending habits. You can study the App Annie Index for extra insights.

So how does a stay wallpaper app in shape into this? First of all, it gets rid of most of the structures considering a live wallpaper is an Android element. Second, this option became brought in Android 2.1 so it has a large network and pretty a few lovely examples. Most substantially Paperland and Roman Nurik’s open source Muzei, likely the quality reference factor for Android development.

While there are lot of live wallpapers available, most of them fall below the scenic/weather category, and very few fall underneath the cuteness overload category. This is some thing we wanted to exchange and provide something that offers you a grin each time you liberate your phone, even though you unlocked it for a very specific cause. We gave you a cute little package of joy to hug you before you go to bed at night time, or while you switch off your alarm inside the morning. And even better, make it personal and customizable.

Without further ado, and earlier than we pass into technical info, I proudly present you: Ooshies – The Live Wallpaper

It capabilities:

loose live wallpaper app that offers you hugs12 unique ooshies to pick out fromloose, un-lockable, and accessible contentmodern weather updatessocial login and records syncseasonal greetingsmany surprisesa ninja catdid we point out hugs?

Lesson three: Try To Make It Happen

Ooshies appeared like a quite sincere Android app concept. Paint a heritage, overlay some clouds and stars, put a endure with a balloon on top, and you’re accurate to go. But no, it’s Android! What appears easy is frequently quite hard and we generally tend to copy the identical commonplace mistakes time and again once more. Here’s a short rundown of the challenges I faced:

Hardware acceleration – why draw the use of the CPU while the GPU is a lot higher at it? Well, it turns out that drawing bitmaps on a canvas cannot be hardware elevated. At least now not in the intervening time.

OpenGL – if we need hardware acceleration we need to apply OpenGL ES or maybe better a framework that does most of the paintings for us.

Bitmap loading – a widely recognized memory consumption difficulty. We want to allocate 1 byte [0-255] of reminiscence, for every channel within the #ARGB, to show a unmarried pixel. Also the snap shots we use regularly have better resolutions than the device’s show. Loading them all will speedy bring about OutOfMemroyException.

Home launchers – the stay wallpaper could be hosted within the domestic launcher procedure, and distinctive launcher have a tendency to provide exceptional callbacks to the live wallpaper service (maximum drastically Nova and TouchWiz).

Battery existence – if now not achieved right, the stay wallpapers and the widgets can drain plenty of battery. With all of the buzz about the Lollipop (Android 5.0) terrible battery lifestyles the first app to move will be the stay wallpaper.

So, masking a bitmap, painting it on a canvas, after which switching frames on touch to give a hug, doesn’t appear like a huge deal, even when if it’s miles done at the CPU, right? Thats right, it’s not a trouble. But, who wishes a static stay wallpaper? It beats the motive. The wallpaper have to reply for your touches, it ought to circulate as you scroll your property monitors, it have to carry out random acts of kindness and make you sense happy.

And there may be an Android development trick for that. There is a time period called the parallax impact for adding intensity in a 2-dimensional space. Imagine your self driving a car. The house towards you actions quicker than the mountain inside the distance. Same impact may be accomplished by using shifting gadgets in extraordinary velocity on a canvas. Although, they are all in the equal aircraft, your brain perceives the faster shifting items as toward you. Much like including drop shadows, the parallax impact provides a z-axis.

And this is in which all hell breaks unfastened! On maximum gadgets transferring the Ooshie, the weather overlay, and the history, at exclusive speeds, yields vast body fee drop. Here’s how a unmarried frame is drawn:

canvas.drawBitmap(historical past, zero – offsetX / 4, 0, null);canvas.drawBitmap(weatherOverlay, zero – offsetX / 2, 0, null);if (!validDoubleTap) canvas.drawBitmap(ooshieNormal, positionX – offsetX, positionY, null);else canvas.drawBitmap(ooshieTapped, positionX – offsetX, positionY, null);

The offset is a percentage of the distance user has scrolled. It’s a callback that the wallpaper engine provides:

@Overridepublic void onOffsetsChanged(flow xOffset, go with the flow yOffset, float xOffsetStep, flow yOffsetStep,int xPixelOffset, int yPixelOffset)awesome.onOffsetsChanged(xOffset, yOffset, xOffsetStep, yOffsetStep, xPixelOffset, yPixelOffset);// athe modern-day offset must be a fragment of the display screen offset to acquire parallaxif (!isPreview()) go with the flow newXOffset = xOffset * zero.15f;wallpaperDrawHelper.setOffsetX(newXOffset);if (isVisible() && hasActiveSurface) wallpaperDrawHelper.drawFrame(false);

I need to word that all of this would be useless if I knew a way to work with OpenGL! It’s on my TODO list, considering that anything more complicated than what we have now would require a hardware acceleration. But, for the time being I need to work harder, now not smarter (I’m open to pointers inside the feedback). So right here’s what we did:

Lesson four: Work With What You Have

As a huge supporters of the minSdk=15 initiative, from the start we eliminated all the 2.x gadgets. The attempt for preserving backward compatibility is greater than the viable sales from customers unable\unwilling to upgrade their phones. So, in maximum instances, we’ll be able to obtain easy revel in with an brought option to disable the parallax if favored.

Another huge optimization is how we cope with the bitmaps. A very comparable parallax effect can be completed with drawing two bitmaps as opposed to three:

Ooshie overlay – trimmed and punctiliously scaled Ooshie bitmap (can be accessorized)

Combined overlay – a blended historical past and weather bitmap that movements with a fraction of the Ooshie pace

This Android improvement trick saves memory and quickens the drawing time, for a moderate parallax impact degrade.

When scrolling the house monitors, frames can be drawn pretty frequently (preferably extra than 30 instances in step with second). It’s crucial now not to draw them when the home screen isn’t always seen (a few lock screens, some app drawer, starting/switching apps and so on.) to minimize the CPU utilization.

This is all tied carefully with the weather updates. Initially there has been a repeating task, executing each hour or two, to sync the weather, but it was really an overkill. If the consumer cannot see the wallpaper, the weather data is inappropriate. So now, climate updates take place only while wallpaper is seen.

lengthy lastUpdate = prefStore.getLong(SharedPrefStore.Pref.WEATHER_TIMESTAMP);if (System.currentTimeMillis() – lastUpdate > Consts.WEATHER_UPDATE_INTERVAL)// update the climate if obsoleteIntent intent = new Intent(getApplicationContext(), WeatherUpdateService.magnificence);startService(purpose);

So, essentially, here’s the tick list for a reminiscence optimized clean software program bitmap drawing:

Combine bitmaps onceDraw less bitmapsRedraw simplest on demandAvoid background dutiesOffer customers some manage over the mannerLesson 5: Test. Test. Test

I can’t strain how crucial this is! Never, I repeat NEVER, launch your app earlier than testing it! And, I don’t suggest that YOU must do the trying out. You wrote the code, you know how it really works, and you have an effect on the result with the aid of understanding the expectations. I’m no longer speaking about JUnit checking out (even though endorsed), however about staged rollouts i.e. alpha and beta trying out.

If you are into Android software development the phrases are straightforward, but here is a quick rundown:

Alpha testers – a small institution of human beings including your teammates and those from the industry, preferably Android builders. Chances are they are going the have excessive-give up gadgets and will play around with the developers alternatives. They’ll ship you stack lines, trojan horse reports, or even provide you with some code/UI optimization suggestions and tricks. Perfect for early releases with partial/missing functions.

Beta testers – a far broader target audience with diverse demographics. Stable releases need to be published here. Even if your ninja level is just too rattling high, you can by no means expect, not to mention account, for all of the viable Android distributions and methods people use their telephones.

Once we passed the alpha, I thought we have been achieved. But, boy I became wrong?! Turned out that not all Android users have Nexus devices with the modern-day software! Who’d realize? 🙂

Here are a few Android improvement troubles primarily based in this revelation:

Different launchers have extraordinary default home monitors – commonly the primary or the middle one, and ,as a ways as I recognize, there’s no way of knowing it’s position.

It’s difficult to middle the Ooshie without understanding the default home display function – as a result the settings slider for adjusting the parallax offset.

An average consumer doesn’t understand what parallax offset means – a whole lot simpler terminology ought to be used on the settings web page.

A random person will endorse your subsequent function.

So I would love to thank all our beta testers for the hard work they did. I wish that obtaining all of the trendy functions earlier than every body else is a first rate reward for his or her dedication. If you’d like, you could additionally be part of our Google+ Beta Community.

Lesson 6: Let The Data Speak

Making an Android app that sticks out today is a piece greater hard than creating a calculator app, when there had been none returned in 2009. Making the correct app is hard. Mainly due to the fact perfection is in the eye of the beholder. What is ideal for me, doesn’t necessarily mean it’s properly for you. That’s why it’s important to let the app grow. Our roadmap tick list for brand new functions indicates that we’ve sufficient paintings for the complete 2015. Among other things we’ll quickly encompass:

SoundsSeasonal backgroundsCustomizations (heritage color, climate packs, ooshie skins, and many others.)Region unique ooshies (ex. babushkas)A lot of recent ooshies and approaches to unlock them

Now, we’d have kept the app in beta till all is completed, but that manner we are throwing away valuable information. Not all beta testers will dedicate a element in their day to send you the feedback. That is wherein you could advantage in the use of equipment for buying the comments. You can use Google Analytics, Flurry, Mixpanel, Crashalytics, ACRA, and so on. to collect utilization information.

For instance, by way of reading the statistics we noticed that users don’t click the settings button lots, so we made it more apparent and brought a brief tutorial for tweaking the settings.

Although that is a heritage process, it could be used to further enhance the consumer revel in. Why now not show the consumer how usually:

he/she obtained a hughow many rainy days were brightened up by using a grinwhat number of taps had been had to release an Ooshie with a mini-gamewhat number of friends installed the app due to you

This is vital because it presents consequences for his or her moves. Don’t make the identical mistake our instructional machine does, making the users passive content material customers. Make them in fee. Give them the option to govern their own devices and create their very own private enjoy. If you manipulate to package deal all this right into a cute package deal that steals a smile on the primary splash, than isn’t always too far fetched to invite the user for spammy favors for content material unlocking.

In the cease, you want to adapt your Android app development based on this statistics as a manual. Although commonly supposed for mothers/kids, this app may also become famous in other demographics.It may not suit into our unique imaginative and prescient, but customers desires must be met. Otherwise they’ll find someone who can.

Conclusion

Let’s return to my most a success failure TweetsPie. Despite couple of awards and big media coverage, the app failed to preserve it’s users (the motives why are beyond the scope of this newsletter).

Success is not usually obvious. Thanks to the whole experience I found out plenty. I gave, as a minimum, a dozen lectures on How (not) to fail as a startup on diverse events and hackathons, and controlled to get a couple of clients at Toptal.

Even more crucial, I strive no longer to copy the identical Android improvement errors with Ooshies by way of following the pointers and tricks in this guide.

To wrap up this lengthy guide, what we define as a achievement is, at later stage, tightly coupled with what we set as aim in the beginning. The most not unusual achievement degree is, of direction, making a number of money. No rely in case your app makes it or not, you should try to make it show up, and accept as true with me on the stop you’ll come to be a better person (optimistically one which manages to research OpenGL). You’ll make new friends, few enemies, and if you are fortunate/clever enough you’ll make lots of customers glad.

You can take a look at our internet site or down load Ooshies to give it a attempt.

Leave a Reply

Your email address will not be published. Required fields are marked *