Does anyone have a sample Android Studio project that interacts with MongoDB

Hi anyone. I have been looking at the tutorials for Android Studio interacting with a Mongo DB and it is extremely confusing and my team has put over 10 hours just to get basic input from Android Studio to MongoDB.

Our app allows the user to log in via email login in Android Studio and we have a Mongo Atlas. Does anyone have a very basic android studio project that could have some super simple interaction with MongoDB. Literally anything, just to get us started.

We have looked at the docs, but have ran into problems with Sync and such.

Hi @John_Owens - you’ve come to the right place!

We build the O-FISH application with Android, and connect to a MongoDB Atlas backend. We are using Realm Sync, which is the recommended way to connect a mobile application to an Atlas backend. The code is at GitHub - WildAid/o-fish-android: Android app for the Officer's Fishery Information Sharing Hub (O-FISH). The mobile app allows fisheries officers to document and share critical information gathered during a routine vessel inspection.

Can you say more about the Sync problems you’re having?

3 Likes

I completed the task tracker tutorial and got everything working. However, I’m glad to know that I’m not the only one who feels Mongo Realm has a steep learning curve.

My advice is to keep at it. I’m not there yet but I’ve learned lots of things I didn’t know previously and I feel I’m close to having it all come together in my head.

3 Likes

It is important to know the basics of Android Studio (IDE) for building and deploying an Android application. In this article, I will show you how to create a project that interacts with MongoDB.

The following steps are necessary in order to complete this Android tutorial

  1. Create a new project in Android Studio
  2. Enable the content provider for the application
  3. Create a global database handler class
  4. Define data models and insert data into MongoDB