X

    Get a Quote

    Android application development India

    How to become Beginner to Intermediate #Android Development #Navigation Component

    839 views
    Amit Shukla

    You have been beginner enough and now want to intermediate in development. If this you keep reading.

    This post will focus on Android Development skills and How to become Beginner to Intermediate Android Developer.

    What makes you a beginner and what makes you an intermediate, let’s have a look.

    Things beginners do:
    1.No structure in code.
    2.Keep pasting the same code without making a function
    3.Keep themselves away to learn the hard stuff (e.g. Architecture component)
    4.They only focus on the current task rather than think big, which means how it can be used in the future.

    Things you need to do to become Intermediate.

    1. Enhance your thinking by learning new things.
    2. If you are not using kotlin, it’s definitely a time. Learning kotlin is very easy and very helpful in your coding.
    3. Learn data binding and Architecture components, I prefer MVVM.
    4. More Important is to format your code in a readable form. Make classes and functions to do the same type of work, for eg: create a Util class that has many functions, one of them is to check the network connection and return true or false. So in any activity, you simply call this function and get value in boolean. Now that makes your code more readable and structured.
    5. Take a look at a small example:

    Android App Developer

    How to become Beginner to Intermediate Android Developer? Let’s try to learn something new that will make you close one step to Intermediate.

    Navigation Component:

    You may already know that Google has launched the Navigation Graph thing in android to make things more structured in the project.
    We consider using one Activity and some fragments in this post: we will keep it simple to learn basics about it.
    The basic idea about it is that you will have one host fragment inactivity and you will replace all your fragments in it Follow steps now:

    Step 1:

    For this, you first create a ‘navigation’ directory in the res folder and create a ‘New Navigation Resource File’ in it. Name it: ‘nav_graph’. It will prompt this dialog to you.

    Become a intermidiate android developer

    Click ok, wait for synch, villa you have built your first navigation graph.

    You see there is space available for HostFragment in your graph. Let’s fill it by adding the following code in your activity_main

    Step 2:

    Create fragments just like you normally do, go to graph and click on the Add button

    Create fragments

    Select your fragments and keep adding as many as want. It generates an auto-id if your read Text of nav_graph.

    Step 3:

    There is a home icon on your first fragment that denotes your start fragment, you don’t have to do anything extra to open your start fragment, simply run your activity and you are good to go. You can change your start fragment anytime.

    Step 4:

    To open one fragment to another, just write this line.

    Navigation.findNavController(view!!).navigate(R.id.fragmentB)

    Here fragments is the id given by nav_graph when you added a fragment in nav_graph. Go to nav_graph and check out your fragment ids.

    Step 5:

    Keep learning about Navigation Component, there is so much more

    Thanks for Reading.

    Please connect with us for any Android App Development needs. We are a team of experienced and skilled Android App Developers who are experienced in working for different industries all over the world. Hire Android App Developers with us for your next Android App Development. NBT provides high-quality and interactive Android Applications with creative and innovative designs and a very user-friendly system.

    Avatar for Amit
    The Author
    Amit Shukla
    Director of NBT
    Amit Shukla is the Director of Next Big Technology, a leading IT consulting company. With a profound passion for staying updated on the latest trends and technologies across various domains, Amit is a dedicated entrepreneur in the IT sector. He takes it upon himself to enlighten his audience with the most current market trends and innovations. His commitment to keeping the industry informed is a testament to his role as a visionary leader in the world of technology.