I have an Android application and I want to move my local database in the cloud. I decided for a SQL database and not for a NoSQL, because I want to execute complex queries. I created a database instance in RDS from Amazon and I populated the database.
Now I want to connect my mobile app to my cloud database. I saw samples for NoSQL database connection, but I wasn't able to find examples for RDS. I saw that it is recommended to create a web service and connect to that web service, but it seems much more complicated than using a NoSQL and this doesn't feel right.
Does Amazon offer some API/service for Android - RDS connection? Do you know any sample code that handles this aspect?
Does Amazon offer some API/service for Android - RDS connection?
No. AWS does not currently have an API for interacting with an RDS instance.
Do you know any sample code that handles this aspect?
You may want to access your database with PHP and get a JSON response. If your RDS instance is using MySQL then you’re in luck. There is already a lot of documentation on connecting Android to MySQL using PHP. You can get great sample code and instructions on this blog post.
Here is a very popular reference for connecting Android and MySQL.
Related
I am making an app which requires a database, so I want to use PostgreSQL from Google Cloud Platform, I did not find any tutorials helping me to do that, How to access the data? a link at Can i use PostgreSQL or mySQL in android App development
no longer works or outdated, found the REST API documentation for Cloud SQL but unable to understand if these APIs are just to access DATABASE or the data inside DATABASE?
As mentioned in the accepted answer to the post suggested by #JGH, there are a few ways to access data of a DB from an Android App.
The most commonly used way is definitely by communicating to a service hosted on a server that can connect to the DB, and provides endpoints to request any operation (read, write, update, delete).
However, since you specified a direct connection from the Android App to the Cloud SQL instance, the best option would be to try to make it work with the JDBC connecting to, possibly, a public IP of the Cloud SQL instance. You may find more information in the Connecting to Cloud SQL from external applications documentation.
Good day everyone,
I have developed an android application and I would like to store my business information on MySQL database. I have decided to use amazon services for this project however I'm very confused how to allow my application to establish a proper/secure connection with MySQL database in order to pull and push the information into it. I have read many articles/stack overflow posts and realized I have to deploy a REST api in order to provide a layer between the application and the actual database. However with AWS being very confusing, in my opinion, i'm super lost.
Could any of you gentle folks provided with the step-by-step guide what services to use, how to connect them together and deploy them in order to be able to use it in my android application. Or maybe an article describing the steps? I don't really need a detailed explanation just a nudge in the right direction and I will try to figure out the rest.
Thank you greatly.
First of all, connecting to MySQL directly from an Android application is not secure, since you need the MySQL database access credentials for the app to communicate with the database.
This is why people recommend using a REST API Layer in between the MySQL database which you can implement using API Gateway and Lambda. This can be secured using a strong authentication mechanism for the API and using SSL for encrypting the messages at Transit.
However, this is not the case if you plan to connect to AWS DynamoDB from Android App. You can enforce Fine-Grained Access Permission to DynamoDB tables and roles using IAM policies.
Few Tutorials that might help,
Serverless REST API in Minutes with Serverless Framework.
Querying RDS MySQL with NodeJS Lambda Function.
Using Mobile Hub (To Simplify Things).
User Authentication with Cognito UserPools.
Background
I have a EC2 instance with a RDS instance(MYSQL) associated with it.
I want to use a android app to execute queries on that MYSQL instance.The Android sdk of amazon does not support RDS.
Problem
How do I connect my android app with RDS instance?Is it possible to use RDS(MYSQL) with an android application without sdk support?
RDS is not a database engine. It's a service that manages the infrastructure for you that's required to maintain a highly available and fault tolerant database. It supports a number of different engines such as MySQL as you mentioned. Please read the docs for more information.
You need to connect to your RDS MySQL instance the same way you would connect to any MySQL database. Using a library that supports MySQL, and using the hostname, username and password for your database.
However, it's probably not the best design to have phone clients connecting to your database remotely. The best thing to do would be to put a REST API on AWS that interfaces with your database.
Having n users connected to your database from each handset using your app is probably a bad idea. It means you need to have more power in your database, greatly hinders your scalability and makes things less secure as the database is exposed to the internet. With an API in front of it, you can build a much more fault tolerant, scalable and solution.
The "cloud way" to build mobile apps is to (within reason) build your application logic on the cloud and simply have your client code connect to your API. This way you can spread to more platforms (eg. IOS, Web) much more easily as you won't have to manage separate application level code for each platform. You'll just need to manage code that integrates with your already existing API.
Take a look at this whitepaper. Ignore the web server tier and focus on the App Server and Database tiers. This is probably the best design to go by.
Background
I have a EC2 instance with a RDS instance(MYSQL) associated with it.
I want to use a android app to execute queries on that MYSQL instance.The Android sdk of amazon does not support RDS.
Problem
How do I connect my android app with RDS instance?Is it possible to use RDS(MYSQL) with an android application without sdk support?
RDS is not a database engine. It's a service that manages the infrastructure for you that's required to maintain a highly available and fault tolerant database. It supports a number of different engines such as MySQL as you mentioned. Please read the docs for more information.
You need to connect to your RDS MySQL instance the same way you would connect to any MySQL database. Using a library that supports MySQL, and using the hostname, username and password for your database.
However, it's probably not the best design to have phone clients connecting to your database remotely. The best thing to do would be to put a REST API on AWS that interfaces with your database.
Having n users connected to your database from each handset using your app is probably a bad idea. It means you need to have more power in your database, greatly hinders your scalability and makes things less secure as the database is exposed to the internet. With an API in front of it, you can build a much more fault tolerant, scalable and solution.
The "cloud way" to build mobile apps is to (within reason) build your application logic on the cloud and simply have your client code connect to your API. This way you can spread to more platforms (eg. IOS, Web) much more easily as you won't have to manage separate application level code for each platform. You'll just need to manage code that integrates with your already existing API.
Take a look at this whitepaper. Ignore the web server tier and focus on the App Server and Database tiers. This is probably the best design to go by.
I'm novice in android. I'm writing an android application which requires the data like comments and scores to sync with the central database. I'm planning creating a simple web service and sync the data with the app.
Please suggest me some of the best methods and technologies which i should use. Thanks!
Have a central database on a remote server.
Develop a RESTful web service to access the data.
Store the data on your local device in a SQLite database.
Communicate between both sides with good old http.
Hard to be more precise with such a vague question.