Create My First Android App


Task: Add Color Resources

Creating Your First Simple Android App

So far you have learned how to change property values. Next, you will learn how to create more resources like the string resources you worked with earlier. Using resources enables you to use the same values in multiple places, or to define values and have the UI update automatically whenever the value is changed.

Designing The User Interface

One of the first steps to building any Android application is to design and build the user interface. Heres a quick sketch of how the applications interface will look:

Large image

The user will be able to set a brew time in minutes using the + and buttons. When they click Start, a countdown will start for the specified number of minutes. Unless the user cancels the brew by tapping the button again, the brew count will be increased when the countdown timer reaches 0.

Day : Drawing A Wireframe

Now you know what it is you want to create, you should come up with a basic wireframe for the app. Wireframing is an expression often used in web design but it applies here too. It means drawing a map of the individual screens , of the buttons, and of any graphics youre going to use . This will give you a good outline for everything you need to create.

You can find a pretty good guide to creating wireframes from Google here. I recommend going with something a little less complex for your first app though. Dont worry about following any particular method for creating your plan either just draw it out in a way that you understand and that comes naturally. Use some grid paper and sketch freely. Either way, by the end of day 2 you should have a sketch of your app and know precisely what graphical elements youll need.

Also Check: How To Control Android From Pc

A 10 Day Program To Create Your First Android App

Building your first Android app doesnt have to be hard. If you arent overly ambitious, then you can break the process down into some simple steps and avoid overwhelming yourself in one go. The trick is to make your first app relatively simple and to focus on creating something. Dont try and create your magnum opus first time around build something small to learn the ropes and to understand how it all works. This will give you the understanding and the confidence you need to go bigger next time.

In this post, Ill show you exactly how to do that in 10 simple steps. Well go from the initial inception and ideation, all the way through to uploading your app to the Play Store. All you need is a couple of hours in the evening spread out over 10 days and you can officially call yourself an app developer!

Make The Count Button Update The Number On The Screen

Create your first Android App with Kotlin

The method that shows the toast is very simple it does not interact with any other views in the layout. In the next step, you add behavior to your layout to find and update other views.

Update the Count button so that when it is pressed, the number on the screen increases by 1.

  • In the fragment_first.xml layout file, notice the id for the TextView:
  • In, add a click listener for the count_button below the other click listeners in onViewCreated. Because it has a little more work to do, have it call a new method, countMe.
  • view.findViewById.setOnClickListener }) 
  • In the FirstFragment class, add the method countMe that takes a single View argument. This method will be invoked when the Count button is clicked and the click listener called.
  • private void countMe 
  • Get the value of the showCountTextView. You will define that in the next step.
  •    ...    // Get the value of the text view    String countString = showCountTextView.getText.toString 
  • Convert the value to a number, and increment it.
  •    ...    // Convert value to a number and increment it    Integer count = Integer.parseInt     count++ 
  • Display the new value in the TextView by programmatically setting the text property of the TextView.
  •    ...   // Display the new value in the text view.   showCountTextView.setText) 

    Here is the whole method:

    private void countMe 

    Don’t Miss: Nfc Card Reader App Android

    Day : Choosing Your Ide And Setting It Up

    The next step is to choose your IDE and programming language and then get set up. The IDE is your Integrated Development Environment a piece of software that provides everything you need to develop your apps. This software will provide the window where youll enter your code, it will check it and format it as you type and it will compile everything for you when youre ready to test it or publish it. The IDE is not the programming language itself though, so depending on the method youre using youre also going to need to download the Software Development Kit, which contains the compilers for the programming language itself. Dont worry about that though, just follow the steps outlined and it will all be handled for you.

    The most common way to build Android apps is to use Android Studio and Java. This is the official method recommended by Google and it will afford you a lot of flexibility while ensuring theres plenty of support if things go wrong. This is also the method you will need to know if you ever plan on becoming a professional developer. Ive published a post previously walking through the steps needed to get started with Android Studio. This will show you how to install and set-up everything you need from Android Studio itself, to Java and the Android SDK. Again, dont worry about it.

    Navigating The Android Candy Store

    One of Androids advantages, the diversity of devices that can run the platform, is also a major complication for developers. You have to consider just about everything, such as the items on the following non-exhaustive list, to be variable:

    • Screen sizes, both physically and in terms of pixels.
    • Screen density, or the number of pixels per mm.
    • The ratio of the screen width to the screen height.
    • The number of simultaneous touches the touchscreen can register.
    • The quantity and positioning of cameras.
    • Bluetooth capabilities.
    • Platform and software versions.

    If you want to make an app that will run on a hundred different devices, how can you tell if its going to work? Well, there are six main strategies I can recommend:

  • Nail down your target.
  • Check Androids best practices.
  • Emulate.
  • Pick at least one representative device.
  • Fake other screens on your device.
  • Lets go through them one by one.

    Also Check: Best Free Meditation Apps Android

    How Do Free Apps Make Money

    11 Most Popular Revenue Models for How Do Free Apps Make Money Advertising. Advertising is probably the most common and easiest to implement when it comes to free apps makes money. Subscriptions. Selling Merchandise. In-App Purchases. Sponsorship. Referral Marketing. Collecting and Selling Data. Freemium Upsell.

    Use An External Package

    Create your First Android App in Android Studio – Android Tutorial 1

    In this step, youll start using an open-source package namedenglish_words, which contains a few thousand of the most usedEnglish words plus some utility functions.

    You can find the english_words package,as well as many other open source packages, on

  • The pubspec.yaml file manages the assets and dependenciesfor a Flutter app. In pubspec.yaml, add english_words to the dependencies list:


    13+ english_words: ^4.0.0
  • While viewing the pubspec.yaml file in Android Studios editor view,click Pub get. This pulls the package intoyour project. You should see the following in the console:

    $flutter pub getRunning "flutter pub get" in startup_namer...Process finished with exit code 0

    Performing Pub get also auto-generates the pubspec.lockfile with a list of all packages pulled into the project andtheir version numbers.

  • In lib/main.dart, import the new package:


    import 'package:english_words/english_words.dart' import 'package:flutter/material.dart' 

    As you type, Android Studio gives you suggestions for libraries to import.It then renders the import string in gray, letting you know that theimported library is unused .

  • Use the English words package to generate the text instead ofusing the string Hello World:


    // Use of this source code is governed by a BSD-style license that can be
    3 // found in the LICENSE file.
    title: const Text,
  • Also Check: Does Uber Driver App Work With Android Auto

    Create A Virtual Device

    In this task, you will use the Android Virtual Device manager to create a virtual device that simulates the configuration for a particular type of Android device.

    The first step is to create a configuration that describes the virtual device.

  • In Android Studio, select Tools> AVD Manager, or click the AVD Manager icon in the toolbar.
  • Click +Create Virtual Device. The Select Hardware window shows a list of pre-configured hardware device definitions.
  • Choose a device definition, such as Pixel 2, and click Next. .
  • In the System Image dialog, from the Recommended tab, choose the latest release.
  • If a link is visible next to a latest release, it is not installed yet, and you need to download it first. If necessary, click the link to start the download, and click Next when it’s done. This may take a while depending on your connection speed.
  • Note: System images can take up a large amount of disk space, so just download what you need.

  • In the next dialog box, accept the defaults, and click Finish.
  • The AVD Manager now shows the virtual device you added.

  • If the Your Virtual Devices AVD Manager window is still open, go ahead and close it.
  • Upload Your App On Google Play Store

    Thousands of Android apps get released every month via the Play Store. There are numerous benefits associated with publishing apps to app stores. It gives a boost to your featured app with the number of downloads, wide target audience/users reach, and ultimately leads to great profit.

    So, lets check all the steps to upload an Android app on Play Store. Just ensure you follow each step in chronological order to avoid errors.

    Read Also: Set Up Auto Text On Android

    Explore The App Template

    When you created the project and selected Basic Activity, Android Studio set up a number of files, folders, and also user interface elements for you, so you can start out with a working app and major components in place. This makes it easier to build your application.

    Looking at your app on the emulator or your device, in addition to the Next button, notice the floating action button with an email icon. If you tap that button, you’ll see it has been set up to briefly show a message at the bottom of the screen. This message space is called a snackbar, and it’s one of several ways to notify users of your app with brief information.

    At the top right of the screen, there’s a menu with 3 vertical dots. If you tap on that, you’ll see that Android Studio has also created an options menu with a Settings item. Choosing Settings doesn’t do anything yet, but having it set up for you makes it easier to add user-configurable settings to your app.

    Later in this codelab, you’ll look at the Next button and modify the way it looks and what it does.

    Send The Count To The Second Fragment

    Make Your First Simple Android App with Kotlin (Android ...

    The Next/Random button was set up by Android Studio to go from the first fragment to the second, but it doesn’t send any information. In this step you’ll change it to send a number for the current count. You will get the current count from the text view that displays it, and pass that to the second fragment.

  • Open
  • Find the method onViewCreated and notice the code that sets up the click listener to go from the first fragment to the second.
  • Replace the code in that click listener with a line to find the count text view, textview_first.
  • int currentCount = Integer.parseInt.toString) 
  • Create an action with currentCount as the argument to actionFirstFragmentToSecondFragment.
  • FirstFragmentDirections.ActionFirstFragmentToSecondFragment action = FirstFragmentDirections.actionFirstFragmentToSecondFragment 

    Recommended Reading: How To Find A Password On Android

    Follow These 5 Steps To Make Your First Android App

    Android App development is a process of developing Native Android apps that might seem hard in the beginning, but it can open up a world of possibilities. It is hard to find where to start from, but dont worry this is the perfect article for a practical example to make your first running app used on a mobile phone.

    If you are confused or want complete knowledge of Mobile Development read this article.

    To develop an app in the Android Studio you need to learn programming language either Java or Kotlin.

    Its a different topic of discussion to choose which language but I will give a brief overview. Java is one of the most popular programming languages that was Googles preferred language for Android some time ago. Many apps run on Java and is used even today. Best thing is it has also got a ton of examples and rich tutorials for every topic of android that helps a beginner to learn fast.While Kotlin is a new emerging language currently preferred by Google. It is easy to learn and has got some edge over Java. Also, it reduces the length of code and removes some of the most famous Null Pointer Exception and other Java runtime errors beforehand.

    Allowing Users To Insert To

    Now that you have built an app capable of showing a list of to-do items, the next logical thing to do is to enhance it to enable users to insert more items. To accomplish this, you will create a new activity that will implement this feature. So, for starters, create a new file called activity_to_do_form.xml inside ./app/src/main/res/layout/ and add the following code to it:

    This layout resource is using a ConstraintLayout to put two elements side by side:

    • an EditText where users will input the description of the new to-do item
    • a Button that, when clicked, will add the to-do item in the list.

    Note that the layout above is using two string resources: @string/to_do_message and @string/button_insert. On Android development, it is a best practice to use String resources to declare static text. So, open the strings.xml file and replace its contents with this:

    < !--./app/src/main/res/values/strings.xml --> < resources> < string name="app_name"> To-Do List< /string> < string name="to_do_message"> Describe your to-do item< /string> < string name="button_insert"> Insert< /string> < /resources> 

    This will make your input text show a message saying “Describe your to-do item”, and will add “Insert” as the label of the button.

    Next, you will create the activity’s class that will render and handle this layout. In this case, you will create a file called inside the com.auth0.todo package and you will add the following code to it:

    Here, you are adding two new methods:

    You May Like: Sun And Moon Casino Game For Android

    Day : Publishing Your App

    Finally, you need to publish your app. That means you need to sign your application and create a new APK . Signing is a form of certification which ensures no one except you can upload updates etc. The official documentation can be found here. You should also view this page to find out how to build a release-ready APK through Android Studio.

    Gary has written a post about publishing your first app in the Play Store, it will walk you through the step of uploading the APK to Google. Youll need to pay a $25 registration fee but its a one off and hopefully it will prove to be a smart investment once youre a billionaire app developer!

    As you go through this process, youll be required to select a price and to fill out fields pertaining to your app description. Youll also need to add some screenshots and an icon. For some pointers on how to get your app to stand out in the store, check out how to make your Android app stand out and get noticed.

    How To Build An Android App In 2021

    How to make my first app | Android Studio |Beginner App Development – Tutorial 02

    If you have decided to be an Android app developer, then you might know that the average salary of Android developers in the USA is $1,02,000. This statistic is enough to lure aspiring Android app developers to make their careers in this field.

    However, just like you, often, beginners need the best guidance to start their careers. This is the reason we have crafted this comprehensive blog exclusively for you. Get to know how to build an Android app and upload it on Google Play Store in the simplest manner.


    • Create Android apps for smartphones, like Galaxy S
    • Submit your app to the Play Store

    If you want to learn Android development, you must ensure that you know the ins and outs of Android Studio. Need quick guidance and tips on this? Read the next section.

    Want to Validate Your Android App Idea?

    We have successfully designed and developed over 1500 Android apps.

    You May Like: Amazon Flex App On Android

    Task: Make Your App Interactive

    You have added buttons to your app’s main screen, but currently the buttons do nothing. In this task, you will make your buttons respond when the user presses them.

    First you will make the Toast button show a pop-up message called a toast. Next you will make the Count button update the number that is displayed in the TextView.

    Day : Writing The Code

    Now comes the more challenging part adding the code. You know the basics of Java and you have your widgets/views already in place. Now youre going to open the Java file for your main activity and simply create some onClick events to add code that will run only when users click a specific button or otherwise take a specific action.

    Take what you already know about Java and then read my two-part series on how to build a simple Android app . This will show you how to make certain things happen when your buttons are clicked and how to handle things like variables, resources etc. It can also serve as a recap on how to create a new activity and do some other basic bits.

    Do as much as you can with what you already understand about Java and what you learn from this post. Dont worry if the app isnt finished yet in terms of functionality though well be adding more tomorrow. Just set up the basic things like operations, variables and button clicks.

    As you build your code, youll want to test that its working. You can either do this by building a debug APK and installing it on your device, or by using the AVD Manager. This lets you run Android apps on your computer so that you can test whether your apps are working or not. This post by Alex Mullis on the Android SDK will show you how to get it up and running.

    You May Like: How To Make Android Apps Using C++

    Share post:


    More like this

    How To Create Resume On Android Phone

    Build Free...

    Remote Control Android Phone Over Wifi

    Best Remote...

    How To Develop An App For Android Free

    Android App...

    Sign Documents On Android Phone

    How To...