In Kotlin, variables are declared using var keyword and constants are declared using val keyword.
Well it’s not the tinder app but “any screen shown to the user is an activity”. In this case, we are seeing the log in activity of Tinder.
We know activity but what’s lifecycle?
Activity goes through many states. These states represents activity lifecycle. For example, a car has states like engine is off, engine is on but not moving, in motion, at rest, etc. You get the idea.
Since I’m an Android developer I’ll be using the term ‘android’ but this article is still relevant to any engineering candidates.
I will be sharing about an interview for the role android developer that I have gone through. This interview was for a small organization, a startup. Some big organization interview pattern may be very different from this.
There are generally three parts to an interview:
The way in which a new Android developer organizes the code becomes problematic as soon as the size of the app increases. Almost all of the code resides in an activity and the activity becomes too much congested. The activity acts as both view and the controller.
All the functions, views and business logic is managed by a single activity. This is a very bad architecture. Some of the problems in such architecture are as follows :
To solve this problem the…
Hi, welcome to the second part of the article. You should also look at the Part 1 of the article.
In Kotlin, by default classes are public and final i.e. it is not open for inheritance. We need to make it open for inheritance by using open keyword.
When we open a new activity from an activity itself, we can send data to it by using an intent and putExtra() method. But what if we also want to get something back? This is what the startActivityForResult() method is for. By opening our child activity with this method and overriding onActivityResult() we can send data back to our parent activity after we set it with setResult() in our child activity before we close it.
MainActivity.javaint REQUEST_CODE = 1;
Intent intent = new Intent(MainActivity.this, ChildActivity.class);
We need the REQUEST_CODE to identify the request…
Since the Android system uses the default no-arg constructor when recreating a fragment, we should not pass values over an overloaded constructor with arguments when we instantiate it.
The correct way to instantiate a new fragment and passing values to it, is by creating a bundle, setting arguments on this bundle using setArguments() method and then passing it to our fragment. Inside the fragment we then retrieve this bundle and get the values out of it. A clean way to do this is by creating a “factory method”.
I hope you learned something! Thank you for reading.
Click the 👏 to show your support and share it with other fellow Medium users.
While developing an Android application we might need to communicate between fragment and the activity. This can be done easily using interfaces.
2. Next Step is to implement the interface in the activity
And now you can…
Now we shall start to learn about what actually goes into an android app. An android project has three main parts :
We’ve already talked about this in the previous post link.
You have to provide each android app with a unique package name. Well you can have a non-unique package name as well but then you’ll not be able to upload the app on the play store because the unique id for the apps on play store is its package name.
All your program files are stored in the directory or sub-directory named same as your package name as…
This post is for beginners in Android Development. So we will go from the scratch. And I am keeping it brief, so you won’t get bored.
Android came to life sometime in 2003 when a company named Android Inc. was founded by Andy Rubin.
Mobile Application Enthusiast, an Android developer and a keen observer of life