I want to connect android application to Mongodb. I had installed Mongodb into my system but i don't know to connect with android.I tried mongo with java applicaion.can you help me?
It is a very large question but,
The best way to achieve this is to create a restful webservice to access your mongodb database and also respond to clients with that service.
There are lots of choices to pick a framework for your restful webservice however, you can use Jersey because of its ease of using.
First, deploy your jersey application as your backend application to
your localhost or to some remote hosting provider as y.
Second, make http calls to your backend and fetch the data from
mongodb in json format
Third, parse the json formatted data in your android application and show it on your layout.
Related
Still a newbie. I am building a simple quiz app which I plan to take make public. The questions will be stored in a JSON. Trying to understand the right approach to build this:
The javascript file cannot read the local json file through fetch (URL scheme file not supported) or using jquery (I get CORS error)
I want to expose only part of the json file and different question will be shared everyday.
Do I need a nodejs server to address these requests? What is the right way to host this on a server? When I buy a domain, do I need to keep a server running there to service these requests?
Would appreciate a response on the approach.
Thanks,
There are different "Components" in building and deploying an application on the web.
To handle the User Interface (Website as we know it), we would require HTML/CSS/Js or a frmaework like React, Vue, Angular etc.
This frontend will be connected to a server (backend) that can be developed by using Nodejs(Express), Python(Flask), Java(Spring), Go etc...
Then there is a database, you can use SQL or noSQL databases. (As per your requirements, I would recommend using MongoDb Atlas, a hosted cloud database)
Initially, you are going to develop Front-end and backend seperately as deifferent projects. Then Integrate the APIs.
Now, you can either host these projects seperately, or together.
Now, for testing servers, you can use Heroku or Netlify, these services host your projects for free (upto a certain limit), once you are done with development and testing. You can pay these services or choose other services to host your project and do other stuff like a good domain-name, a SSL certificate etc.
I receive continuously data by uart sérial port.
How can i print this data on my html web site and update it dynamically ?
I use a raspberry pi 3 with apache server.
I can use php, javascript, python... and many languages.
You could create a NodeJS server, with express for example.
Then use the serialport npm module to get data from your serial port.
Then send this data through a websocket, create a web page, and use the Websocket Javascript API to retrieve the data from your websocket.
This way, you can display real-time data from serial port on your website. I've used this 'stack' to build a connected aquaponics system in a Hackathon and it worked well !
It would even be simplier if you use socket.io, since it provides simple library and code example for both the back-end and the front-end part.
Hope it helps,
Best regards
I'm trying to create a mobile application using AngularJS and Ionic Framework. However, I'm lost when trying to find a solution for backend database support. Is there a plugin or third-party API available to use to accomplish this?
Client side web applications do not connect directly to SQL database servers.
You need to pick a server side programming language and write a web service interface to your database.
Then access that interface using XMLHttpRequest (which Angular wraps with $http).
I have an UI5 Application [Mobile-Fiori], and I would like to connect it with MongoDB to get JSON data to be displayed in my views.
I know it would have been possible if I used Node.js with the package Mongoose, but for my applications developed locally, I use Eclipse with Tomcat Server.
I wonder if this is possible in this way.
Thanks
Yes it is possible, e.g. with Spring Data MongoDB.
I am developing an HTML5 mobile application which I am planning to port to Android also using Phonegap. I want to use AWS DynamoDB for storing my users data. I know that amazon has a http api but it is too complicated. Some of my queries are
If I use the HTTP api, wouldn't it expose my credentials? (Same qquery for dynode)
What are the alternatives? I have a EC2 instance so hosting a server is not a problem.
I would appreciate your suggestions on this.
If you connect directly from your phone application, to dynamodb, you will risk exposing your credentials.
The general way to handle this is to have a json REST api through which the phone application can authenticate and make requests to the datastore. Your application would communicate with this api.
In this case, each user would likely have its own authentication to your server application.