[Interview Project]: An Android Developer Interview Coding Challenge in MVP

in #utopian-io7 years ago (edited)

Yesterday I got asked to build an Android app from scratch as part of an interview coding challenge. The recruiter asked me to submit the project via GitHub, so I thought I would might as well document it here for anyone interested in the Android developer interview process, and/or anyone looking for tips on their upcoming Interview.

The Challenge

  1. Create a native Android Mobile App with a Side menu and map as home screen.
  2. Take a set of dummy data representing locations on map with latitude and longitude. Show these locations on map when a user opens the app using appropriate marker.
  3. Create a button to pin a new location searched on map by a user.
  4. Add this new location to your set of dummy data and it should show up the next time user starts the app.
  5. Use MVP architecture

My Approach

The challenge pretty easy, I got it done in a couple of hours. Here's the completed product
image

What is MVP? for those if you that do not know, MVP is basically a design style of writing code. MVP stands for Model View Presenter, and when writing code in MVP, you compartmentalize the code to only perform certain function.

  • Model - consists of all the code that is responsible for fetching and storing data
  • View - is all the code the is related to the UI (what you see in the screen)
  • Presenter - all the business logic or the brain of the app.

Here's a pretty diagram of MVP

mvp

So here is How it Wrote the app,

  1. We define a Contract, in my case I named it MainContract this is the Glue between the View and the Presenter
  2. I created a fragment named MainFragment this will serve as the view. notice that we have to inherit MainContract.View
  3. MainActivity will serve as the presenter in this case. Here we need to inherit MainContract.Presenter
  4. Lastly I created the Model as LocationRepo

The LocationRepo is actually only in charge of fetching and saving the data into the database. The entire Model aspect of the MVP architecture actually consists of almost all the data directory. In here you will find the creation of the database, the definition of the only table in the database and the access objects for the database.

Overall this was a pretty fun project to do.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for your contribution.



Chat with us on Discord.Need help? Write a ticket on https://support.utopian.io.

[utopian-moderator]

Thanks,

It seems like contributions can be much more conscience with the score card, But I would think it's a bit more work for you moderators right?

Was it timed? I mean the interview

They gave me two days to complete it, I did it in about 5 hours.

lol, thats the boss, You getting the role :)
whats gonna happen to Mixion ?

I'll continue to work on it on my free time like I have for the past few months :)

Hey @edgar-trem I am @utopian-io. I have just upvoted you!

Achievements

  • People loved what you did here. GREAT JOB!
  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Utopian Witness!

Participate on Discord. Lets GROW TOGETHER!

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Congratulations @edgar-trem! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the total payout received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!