You are ready to build your first Android app, well good luck and welcome aboard an exciting journey. My first Android app took me a year to build because of the complexities of porting a legacy desktop application to mobile app and dealing with constantly changing business requirements.
Below are my ten tips for building your first Android app and hopefully it will help you ship your app in a lot less time than my first app took me. These tips are applicable to non-game apps because I do not have experience building Android game apps.
My advice is it doesn’t matter for your first app, this is not the app that will change the world, this is not the app that will get you a million download in one week.Your first Android app is the app that gives you a better understanding of what it takes to make an Android app, accelerates your learning of Android development and gives a significant boost to your confidence and career.The goal of your first Android app therefore should be learning, and since you cannot learn from a non existent example,
I will suggest that you set aside your awesome ideas for now and choose something that people have already built. So here is my three step process for choosing your first app idea in 30 minutes.
The reason for this suggestion is that for any top/popular app there has been numerous attempts to build that core feature that the app has and therefore numerous resources for you to learn from.
How do you know the number of screens your app should be or how do you limit the number of screens your app should have? – you sketch it. Before you sketch your app though try to answer the question “what does my planned app do”. It will be easier if you can answer this question in one sentence without using the word “and” because that introduces complexity.
For your next app, you should start to graduate towards a commercial prototyping tools because according to a blog post by Dave Kearney of FluidUI, there are quantifiable benefits to prototyping your app.I have not actually used FluidUI, and I am seriously considering it, just trying to get over the hump of their annual payment requirement. I have however used Ninjamock.com for some of my apps.I actually start with some UML diagram (Use Case, Sequence diagram, etc). UML diagraming is one of the first things you learn in any college Software Engineering curriculum, if you are not familiar with it don’t worry about it. However it does help with translating your vague app description to a prototype. Watch this Google IO video to appreciate the importance of planning your app before you begin.
Here is how I transitioned this app description
Book Manager – will be an app to help me keep track of the books that I read. There should be categories and subcategories to organize the book, I should be able to add information about the author, publication date and date read.
And with the above proposed app description I first created a simple UML Use Case diagram, then used NinjaMock to create a wireframe and then used that wireframe to creat an Android Activity screen – in that order
Focus on improving on that number and you do that by clicking on the published button.There will be tough days ahead, things will not make sense, your questions will be dismissed in StackOverfow.com because people think is does not make sense, don’t take any of these personal. Focus on publishing that app that you started, don’t just abandon it and start another one that is more promising because that one won’t be easy either.
Navigation and screen orientation is one behavior you will have to deal with no matter what is your app’s core feature and Fragment is at the center of dealing with this in Android.I will encourage you to limit your first Android app to two Fragment per screen. You can get away with one Activity one Fragment, but by having atleast two Fragment you will get to learn the subtleties of dealing with the Fragment Manager, dealing with transactions in the back stack, changing the ActionBar (or ToolBar) title to reflect the current Fragment, dealing with the Up button from within the Fragment and handling onBackPressed from Fragment.
All these will be skills that will save you time in your subsequent apps and you may not get exposed to them if you just do one Activity and one Fragment.On the other hand, if you go with one Activity and more than 2 Fragments, then you may encounter issues that you will rather avoid in building your first Android app.Which ever approach you choose with Fragments, you will do well to setup the core behavior of your app or specifically how your app handles configuration changes before you start writing your application logic.
You can add Textviews, or Toast or colored background to test how you app response to screen rotation, handles retain instance, selects alternate resources before you proceed.To the extent possible, I will gently encourage you to avoid implementing dual screen as shown below for your first app. If you doubt me, go back to the Play store and take a look again at the top 5 apps in the category that you looked at in the beginning of this post, how many of them have implemented a dual screen in their apps? I bet the ones that do are the corporate apps with big budget development team. You are a solo developer at this time, focus on the screen in the right of the image, the one with with the title handset. Place one view (one Fragment) per screen. Use alternate resource folders such as sw600dp, w820dp, to provide layouts with extra margins, padding and larger text sizes for the bigger screen, define your sizes in resvaluedimens folders so Android can auto adjust sizes for your layouts.
Even if you want to give away your app for free, going through the process of implementing in app purchases allows you to structure your app around your app main feature, such that you are able to place a pay wall beyond certain point.
Let’s say for example that your app is an app that let users send mass text messages to their contacts. Well the core feature there is “send text messages”. So you place your pay-wall in front of this “send text messages”.This could be a simple counter that increments for each text message sent, and then you can provide just one button from which a text message can be sent from your app. And every time a text message is sent successfully you increment your counter and each time that button gets click, you check the counter to see if the free limit you set has been reached, if yes you throw up an Alert dialog or Toast message asking the user to upgrade.
Again even if you plan to give away your app for free, it may worth your while to go through this step of implementing in app purchases, at least you learn it and also by the time you finish your app you may fail to understand why anyone will want you to give away all this effort for free. Besides by having the mindset of getting paid you will go the extra mile to make sure that your app did not increment the number of junk apps in the store.
Toast.makeText(getActivity(), "Hello World", Toast.LENGTH_SHORT).show();
You could do this instead
Toast.makeText(getActivity(), getString(R.string.hello_world), Toast.LENGTH_SHORT).show();
The good thing is that with Android Studio, even if the string does not exist, it will give you an error and an opportunity to right click and create the string without opening up your String.xml file. This is a good habit according to the official guideline and should more than one person download your app and you are fired up to go international, then you have a ready to go string to translate to any other language.
Atleast read, or type what you are coping, try to understand what that piece of code is doing because you will come back to it to – debug! . Reworking defects in requirements, design, and code consumes 40-50% of the total cost of software development.
That is it, my simple ten tips for creating your first Android app. I have left out some things for brevity and I am hoping that the above will get your programming juice flowing. You will have noticed that my tips are not prescriptive, that is I am not telling you what to do, I am merely suggesting and sharing my experience with you. That is because at the end of the day, you will have to make the decisions, you will have to take ownership of the project, you will be responsible for getting it done. In doing so you will get the credit for building an app, you will be called an Android App Developer.
However, if you need a step by step guide in building your first Android app, I am creating a paid video tutorial and lots of supporting materials to help you build your first professional Android app and publish it to the Play Store in 3 days. This will be a massive shortcut for you to watch me implement these sometimes confusing features into an app and go through the process and publish it live. If you want to get a free beta access, please use the contact us button at the top of the page to send me your name and email.
Good luck and happy coding.
I am a Software Engineer with expertise in Android Development. I am available for Android development projects.
Introducing Pronto Invoice