currently I am working on developing an Android application which will pull data from an Azure SQL Database. I am just curious on what would be suggested as the best way for Android to interact with the database. Currently, I am thinking of using a WCF RESTful Service.
The reason I am asking is I just would like to be sure this would be one of the best approaches to solve this problem and that there is not another way I potentially could have looked over.
Thanks!
The question is quite old but it may help others who might be thinking to connect Android apps to SQL Azure database. Microsoft has a official Android SDK and support for Mobile Services. You can check this Get started with Mobile Services.
It has got loads of examples and tutorials which would definitely help anyone who is starting with Android and SQL Azure.
Related
I have a question regarding my app. While I was doing search for sqlite database concepts and advantages, I found that SQLite is serverless or you don't have to deal with server when you using it.
My question is, if SQLite is serverless, how two or more devices can share information in my app between them without server?
By wanting to share anything between devices you are creating a server/client scenario. i.e. Something is served from one device to a client, the other device.
SQLite is probably not the ideal solution as there is no client-server aspect included, so you'd have to write you own server and client code, which would very likely not be at all simple.
Firebase could be the simplest solution as it's a single SDK and is hosted/served by Google. This link - Add Firebase to Your Android Project - may be of interest
I'm building a new application for android and this would need to send and retreve data from an online database.
Firstly is this possible or is it a completely wrong approach?
Would i be able to tell my application to set certain data into the server and retreve other?
Does it create security risks by which anyone would be able to access the database?
It's my first time dealing with anything close to databases so i'm still learning.
Is there any website i can use which sets up an accessible SQL database?
Thanks for your help!
The Good approach for this is that you should create REST (Representational State Transfer) API on server and perform CRUD operations in your Android app using that API.
There are a lot of security problems with embedding direct database access into your app.
Usually,REST architecture is very useful to build client/server network applications. REST basically works on HTTP protocol and implementing REST is very simple compared to other methods like WSDL etc.
There are many good tutorials available on implementation of REST API that you can easily find by Googling it.
Here's one of them: http://www.androidhive.info/2014/01/how-to-create-rest-api-for-android-app-using-php-slim-and-mysql-day-12-2/
Yes, it is possible and it is not the wrong approach. Web services/REST API's are some things you should look at.
There are obvious security risks associated with having an outward facing web service or database. OWASP has a pretty good
web services guide that should get you started with the
security. You will need to address these risks prior to holding any sensitive/user information. There are plenty of guides online.
A couple of database hosting suggestions Amazon Web Services if you want it to be manage dfor you or create a VPS at Digital Ocean (or similar) website if you want to do it yourself.
Due to the open ended nature of this question there are numerous ways you can address these problems. I recommend spending a lot of time researching and analyzing them prior to starting the project and deciding on a technology.
This is not a wrong approach, most of the Android application send or receive data from online databases.
For connecting your Android app with the online database you can make of webservices , for instance you can create Rest Api for this.
For creating Rest Api using Asp.net web api visit this link
The answer for your last question would depend on the way your write your web services decide the security risk.
You can also use this reference
I have been searching for NoSQL databases. In my research on the Internet I have found that Cassandra DB is the most widely used NoSQL DB. I also want to use it in my Android App but did not find anything about its Android Version.
Is there an API like CouchDB has Ektorp for using it in Android?
Am I going in the right direction with the decision of Cassandra DB?
I need its Android API and tutorial to start with? I only found this link on StackOverflow but it did not help me.
Android cassandra client example
The typical approach is to use a web server to interface into cassandra whereby you send requests to server and it gives you an XML/JSON response, that is what this answer means by creating a RESTful service.
One of the applications that made it to datastax's next great developer competition finals was an android app that did exactly this, here is the project's code.
I know this might seem like a basic question but can an android app which i know uses SQLite work with a web site like http://www.freemysql.net/client/. I have developed a desktop program in netbeans that functions with this website using MYSQL and I want my android app to upload information to this site as well. Or can i use MYSQL with android. I just need to be pointed in the right direction. Any help will be greatly appreciated
If you only expect your app to work if "online" you may be able to make it work. I would expect that the cloud db API already qualifies as a web service interface like Kevin mentioned you would need. If you want a desktop and Android app to use this same database, it seems vaguely reasonable.
I didn't see any API documentation for the site you mentioned. I would focus your attention on how to write an Android app that communicates with a web service. Since you've already written a Java desktop client, you probably already have some idea about this.
If you decide at some point you need access to a database "offline" you should just look at a tutorial for database access on Android. It's not that painful. You may want this so you can store data locally and push to the cloud when you're connected.
http://developer.android.com/guide/topics/data/data-storage.html#db
I am a newbie and I've read many topics related to my question, but I still have a few questions in mind for which I need your assistance. Any kind of information would be helpful.
My application: I have a web site to sell tickets and an app to sell the tickets both should access the same database (centralized Windows server).
I read many topics related to my question and understood, using jTDS would be the best idea for my requirements. But after reading the following topics, I am little bit confused whether I am moving in the right direction or not. So please help to find the right direction.
using an Android app to post entries to SQL Server
How can I use external JARs in an Android project?
My questions are:
Which is the best way to access SQL server from both my app and website?
What kind of security issues do I have to consider? As my app will be used worldwide, do I have to take a special care for security?
Any tutorial or advice will be appreciated.
You must run a webservice based on the REST or SOA to do that. REST is lightweight. I don't recommend using a JDBC connection. I am not sure jTDS would work on Android. If you are about to deploy a webservice you have to look after authentication and SQL injection.
Use a WebService to talk to the database, and the Android app will talk to the WebService. You don't want the clients to talk directly to the database. In the WebService you can do any authentication/security checks that you want. If you use stored procedures in your WebService, you don't have to worry about SQL Injection.