Does anyone have a short Android and Cloud SQL example - android

I realize that Google App Engine (GAE) is very powerful and I would like to determine the proper way to create the database schema (outside of Android) and start populating the database (once my Android app is deployed). Then I would like to query the database (outside of Android). I was hoping that this would be a 10-20 line exercise but it is turning into a much harder task that I anticipated.
Out of Band Steps
Create Database via command line using proper GAE authorization.
Query Database via command line using proper GAE authorization.
I want to reiterate that I don't want to write Java code to create or query the database. I am more interested in using SQL or a SQL-like language directly vs. using Java.
Android Steps
Insert rows into the database using proper GAE authorization, encryption, etc.

Here are two ways to issue SQL statements to your Cloud SQL instance:
https://developers.google.com/cloud-sql/docs/commandline
https://developers.google.com/cloud-sql/docs/sql_prompt
As for inserting rows into the database from Android, you'll need to write a GAE app to act as a proxy. The app can then expose a REST API or whatever API you want.

I realise this is an old post but for people finding this via search, the link below is relevant and includes a sample android code:
https://developers.google.com/appengine/docs/java/endpoints/consume_android
Also, the Google Eclipse pluging also supports creating an App Engine Android project, see:
https://developers.google.com/eclipse/docs/endpoints-androidconnected-gae

Related

How to connect to a SQL Database on an Android Kotlin app

I am building an Android application with Kotlin. I am not very familiar with Databases and Backend in general, I have only used AWS DynamoDB and S3. I want to try something else and learn SQL. I want to connect my app to a Cloud SQL DB like MySQL or PostreSQL. I can't use SQLite because I want the app to be served remotely and be accessible by all the users. I don't need a server, instead I would like to use a server-less structure where I make queries to the DB on function calls from inside my App. How would I do that? I read online about services like planetscale and raiway.app but I can't find a way to connect to my tables there. Are they perhaps web-only?
If you have a remote back-end you can use retrofit https://square.github.io/retrofit/ otherwise you can use room library https://developer.android.com/training/data-storage/room.
I understand that you aren't going to use a Server but in the case where you have to make queries locally, i.e. you have your database on your PC, you must use retrofit and for doing this you must make a small API that will send you JSON and you can process your queries easily with that. If not, you can use room to connect to sqlite, a small database that is default on android phones.
Some Links :
https://square.github.io/retrofit/,
https://developer.android.com/training/data-storage/room.

Link vb.net /android project with online database

I have a project in vb.net and another in android studio I want to link them with one database (real time connection) what is the best way to do that (sql server-my sql ....other?)
Sql server is pretty easy to link to vb.net. you simply create a connection string with the server name and password, although I am not sure about android, but the process would probably be similar
It looks like you want to communicate between the two applications via SQL server, is that correct? While it is possible to do this it is highly ill-advised as the communication cannot be realtime (you would have to poll a table by selecting from it every ## seconds or use triggers MSSQL / MySQL in a very strange way) and it is likely to be unnecessary.
My suggestion is to consider what data you need to go back and forth and why. It is unusual for an Android app to directly connect to a database across the Internet because of the security risks in exposing a database publicly. Most developers opt to use a web application of some kind that provides an API for the Android app to consume. This prevents direct access to the database and provides you a place to add in all your business/game/other logic.

How Can I Create a Database Accessed By windows and Android

I have been looking and searching for this whole day, so i want to create a database which can be accessed by both computer and smartphone, is there a way to do it, and how ?
Sorry For Beginner Question, Thanks in Advance
Ok, the first thing you should do is to define the type of database
that you want. You can build SQL or No-SQL database. For the most
part I would suggest no-sql so something like MongoDB could do, but you can always do mySQL. As
for accessing that db with anything actually, you need application
layer around it. You see, database acts as just a huge data
container thus it should not be used for any other logic.
Now, lets talk about application layer. To be more precise - about posting/updating/retrieving data from db. You should research something about RESTApi or GraphQL concepts as they are used to make communication between your app and your db which is hosted on a server (I deliberately did not talk about how you can build an app because I assumed you already know this one).
THE POINT: The most important concept to wrap your head around is how you can access the db you make not the type or tech used to build it. (Even though this is important too)
Good luck!
The better way to do this its creating a web service, so your app will talk to this web service, the web service will talk to your database and retrieve the results to your app (this can be done using HTTP protocol's APIs like Volley for android) and its a secure way to do it.
You can connect your application direct to your database granting external access, but this is a specif configuration according to your database (mysql, ms sql, etc.) and its not recommended.
You can think in the same way to the computer(s) that will access your database, except if this computer(s) is in the same network which the computer that your database is hosted in, in this last case, the program in this computer (which will access the database) can access it directly (you need to setup the database to permit this and this setting is diferent according to your database).

DB communication suggestion for web/mobile apps

I have a lot of nice ideas to develop into Web and Mobile applications, most of them need an online DB communication. However, I don't know nothing how to configure a fresh DB server from the scratch and start queries and requesting it. Even with DB basis acquired during my graduation.
What I don't know is what to use. If I need a DBMS or build my own server from scratch (which I would like to avoid to save time).
So, I don't want to develop a DB server (back-end, such as PhP, Java, etc...). I need a ready-to-use back-end to send my queries and request to it.
Any suggestion, or tutorial how to configure it? Like deploying on AWS...
many thanks, in advance!!!
I've developed some card game apps that use databases for leaderboards and multiplayer data. I found that using http to access php scripts which in turn access mySQL databases and json encode the result certainly works and is reliable. You will need to write a bit of php and set up the databases but other than that it's quite straightforward. If you keep your http access in a seperate thread in the app you can do visual and input processing whilst waiting for the result.
You don't have to build database server yourself. Database services are available from some companies. Some are:
Amazon Relational Database Service (Amazon RDS)
Google Cloud SQL
Windows Azure SQL Database (SQL Azure)
Clear DB

Which database type is applicable to Android application for contents available in server?

I am trying to develop a real-time Android application where all contents are stored in server. So, they are available whenever a connection to Internet is available. Also, the application provides communication between users and conversations are stored in the server as well. Nothing is locally stored.
However, I am still cannot decide which database type I can use. I intended to use SQLite but I am not sure if I can really use it or not.
Could you please guide me to the proper database type to my application.
Appreciate your time and efforts.
As its upto you which database you use.
you may Install Lamp (For Linux) or WAMP(for window) . This is a nice database tool and very easy to handle and easy linked with PHP for various database function
I recently developed something similar to what you are talking about and here is what I would suggest you to go for.
Use SQL server to manage the data on your desktop and create a web-service in .Net on Visual Studio.
(Note that as others have already mentioned, it really does not matter what is the database you are using in your server end, because eventually the data is going to come to the Android application from the server in form of either xml or json in the web-service., regardless of what database you are using. So it is totally your wish which database you want to use.)
Then connect to the web-service in your application and set/get data from the remote Database, using SOAP.
Link on how to make a web-service in .NET (does not include the implementation in Android).
Links on how to connect your service with Android : this, this and this.

Categories

Resources