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.
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've been reading through developers.google for a few days now and this process is still confusing me.
As far as I can tell, I need the following:
An Android application
A Java App-Engine backend that uses Endpoints (still not quite
understanding what these are).
Code within this backend that connects to my Cloud SQL instance.
My problem is that none of Google's examples seem to have an Android/Cloud-SQL example.
I've been using this guide on how to create an Android app with App Engine backend. But then it uses Google datastore stuff, I think? I need to use SQL rather than this.
In this guide there is mention of App Engine, but for a JSP web form front-end, and no mention of Endpoints.
So my questions boils down to, have I got the right idea with using EndPoints + Cloud SQL, and if yes, how does one achieve this? I'm quite a JDBC newbie in general, so I'm not quite sure how to achieve this off the top of my head.
you are on the right track.
Just for the record, if you don't have strong reasons (yet) to go for a SQL data store, do consider using Google Data Store as it is better seamlessly integrated into the SDKs and after a couple of compromises it should help you pushing your data design to scale nicer.
Let's split it into parts:
First you have your backend/api. This is basically your piece of code that operates on Google servers, which you'll access on an remote connection basis (http, socket, etc) - (same as most of the APIs we know work). I don't know which programming language you are using but here is some basic set up for your project and Cloud SQL on Python.
Cloud Endpoints is nothing more than a very cool feature that App Engine brought recently to avoid all the mess of creating and updating your client libs over and over again. It basically automates that task for you, by using annotations or references you put in your backend code to create client libraries for Java, Objective-C and JavaScript that you can then integrate into your clients.
Example: Let's say I have a controller on my api to operate with bananas, that has a method to delete a banana from the api. Annotating that method on your api code, will let endpoints script know that this methods is there to delete bananas, thus it'll gather it and include it in the generated clients libraries, so that you don't have to do that manually for any of your clients, nor every time you update you api code. [Here's] some documentation.
Android Application. That's certainly your business :) But I'm sure having your api libs already generated already helps a lot.
Hope it helps. Let me know if you need to get more into detail.
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.