Reputation: 3
I want to create a connection with a local MongoDB using Android Studio, I have searched online, but I only found information about mlabs
.
What I want to know is, if there's a way to create a connection locally and utilise the db within Android Studio.
Upvotes: 0
Views: 1496
Reputation: 3469
You can create REST API to communicate with the MongoDB Database via Spring boot. Also for Calling those APIs you can use Retrofit/Volley to get Response from REST APIs.You can certainly have a look at this Medium post for more information. ->
This Post will teach you how to create API to communicate with the Database via REST API using SPRING Java Framework, using POST Man tool you can verify your API is working or not and once it's verified you can use any networking library RETROFit/ Volley to call get JSONResponse from those APIs and using GSON or any other mapping libraries you can map Json Objects to appropriate Java Objects and for that you have to create Model classes(POJO Classes). This all steps you need to do in order to communicate with MongoDB and Android. Hope this helps.
Upvotes: 1