0

I am a true NEWBIE and if this question sounds stupid i apologize in advance.

I am looking at trying to create an app that will allow me to post customer data to SQL Server on a windows server, is this possible? If so, what do i need?

Thanks again for the help, and again i apologize if this is a stupid question.

bobs
  • 21,844
  • 12
  • 67
  • 78
Chimera13
  • 1
  • 1
  • 3

4 Answers4

1

You should check http://www.basic4ppc.com/forum/basic4android-getting-started-tutorials/8339-connect-android-mysql-database-tutorial.html

They explain the first steps to configure the web server (php), the database (mySql) and the client side (java-android)

The way I see it, is the best pile of information arround :D

PD: I'm a noob too xD

Anibalismo
  • 11
  • 1
1

Check this link (sorry its in Spanish, maybe you'll need a little help with that, but I managed to make it work)

Check this code, it may help you

Despite the fact that is a good practice that a client doesn't access a DB directly, there are cases when that's exactly what you need, and a web service in the middle, well, its unlikely to work fine.

I have worked in the automotive industry for 6 year developing intensive use C# client apps that connect to SQL server to store production information, and that's the standard procedure, so, if you manage to ask the user for credentials or save the connection string somewhere else and download each time the app is launched, and create a set of special user-logins with limited access (in my case they can only execute a limited set of stored procedures and functions) you'll be fine, also make sure the DB is only accessible trough your LAN or VLAN.

That's a real case scenario, works fine, and will remain the same until something new appear, but certainly a middle web service, well, just sucks, either ASP or whatever it is

gnat
  • 6,213
  • 108
  • 53
  • 73
mxgh2000
  • 11
  • 1
1

You should not allow client side applications access to your database server directly. There are a number of problems - security being an important one.

Instead, create a Webservice which will handle access to your database. This webservice is where you should also control access to the database.

  • You both are correct on the security front, i understand the issue, i would actually like to use these apps on an internal network, these apps would be used over wifi in a closed network, the app in question would be a form of sorts for clients and i want the data to simply populate in the database so that the business software has all of the client data before they complete there purchase? Will this work in this type of situation or should i be going the route of the webservice? – Chimera13 Jan 03 '11 at 13:56
1

You'll need to download this jTDS driver and follow this tutorial

jTDS works fine in Android. And if you're not sure how to add a jar to an android project, you can follow these directions. You'll also need to take into account the fact that the phone network will add latency to your app that an emulator probably won't show you (that's why this will need its own thread, otherwise the ui will get blocked when it's waiting for the response, and the user will get a "force quit" or "wait" Application Non-Responding Warning).

The security concern pointed out by Will Hughes is still very valid. And it is important that you don't create a consumer level application that does this, but since this app will most likely be only used by internal employees/equipment (as per your description), depending on your exact business use case, you may be able to use the very granular per-user level security settings already provided by SQL Server and manage some of your security that way (although, I do agree, this only solves some of the potential security problems, this does not solve all of them).

Community
  • 1
  • 1
Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49
  • You both are correct on the security front, i understand the issue, i would actually like to use these apps on an internal network, these apps would be used over wifi in a closed network, the app in question would be a form of sorts for clients and i want the data to simply populate in the database so that the business software has all of the client data before they complete there purchase? Will this work in this type of situation or should i be going the route of the webservice? – Chimera13 Jan 03 '11 at 13:55
  • You *can* make it work using the jTDS driver mentioned by Stephan. I would strongly suggest against it, however. Even in internal environments. Other than security - is the need to do all your database transaction and loading directly on the device. Handling transactions over wifi on devices that may sleep or drop out at any time complicates the situation and can lead to weird issues. –  Jan 03 '11 at 13:59
  • We are trying to go paperless and currently, the customer sits down and fills out a form and then the receptionist needs to re-enter all, this was our thinking to eliminate the paper, do you have another suggestion? – Chimera13 Jan 03 '11 at 17:07
  • Kiosk computers? Even a $300 netbook with it's puny keyboard would arguably be a better device than using a smartphone to key in data...right? – Yoopergeek Jan 04 '11 at 02:14