• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Viewing Local SQL Server Database

Good afternoon peeps, I'm wondering if you can assist me.

I am currently residing in the beginners area of Android Development but because i'm not sure what question to ask to get the answer I need, I am hoping someone can shed some light or point me in the right direction at least.

I am going to be using a dedicated barcode scanner and this barcode scanner uses a datawedge to get information to any app within a set profile. That bit is ok, but the development of said app is something else.

Ideally I want the app to scan a barcode which will contain several fields of information, basically the following:

TimeStamp (date and time of barcode scan), JobRef (numbers), DueDate (Date), Urgent (yes or no), Department, (listpicker) and maybe a couple of others.

I want the app to send the details to an awaiting table on our on-premise SQL Server database which I have full access to (for development purposes and messing about).

I'm not sure how to go about this, is there a service that needs to run on the server so that it listens for updates? or can I force an additional record in a table on the database by having the app work with it directly?

Kindest regards

Craig
 
Yes you will have to create a service of some kind on the server system, that can listen for incoming updates, and write the data to the database.
This can be done by implementing a client/server socket application, or a HTTP based web server type of application. You have a variety of technologies and programming languages to choose from here. Depends what you are most familiar or comfortable with.
There are Android libraries available which lessen the pain of implementing network comms.
 
Yes you will have to create a service of some kind on the server system, that can listen for incoming updates, and write the data to the database.
This can be done by implementing a client/server socket application, or a HTTP based web server type of application. You have a variety of technologies and programming languages to choose from here. Depends what you are most familiar or comfortable with.
There are Android libraries available which lessen the pain of implementing network comms.

Thank you for a quick response there.

OK so now searching into Client/Server socket applications and the IIS which is also running on that server....

I am not familiar with any of the languages but willing to learn. Any suggestions on here on how an experienced developer would target this?

Also, if i'm working with a client server socket application, what do I need to look into on the app development point of view in order to tell the app to look at the server do perform a task?

Kindest regards
 
Actually, implementing a client socket application isn't that hard. There's an example here if you want some code for the Android client application

https://www.tutorialspoint.com/sending-and-receiving-data-with-sockets-in-android

The server will need to open the corresponding socket, and listen to it.

Interestingly, this seems to be two android devices where one acts as a server for the application, I think I am looking for a service on the server which will update the sql database table when information is sent from the app is this the correct line of thinking?
 
Interestingly, this seems to be two android devices where one acts as a server for the application, I think I am looking for a service on the server which will update the sql database table when information is sent from the app is this the correct line of thinking?

Yes that's a complete client/server application for Android. The part of interest to you is the client code.

You'll need to implement the server part as a separate application, running on... the server ;)

Like I said, it's up to you what technology you use to implement that.
 
Thanks for the direction. Please, if you know of anything else that might be worth looking at (i.e. options for the server listening aspect and working with the sql database) then i'm all ears :-)
 
I'm hearing a lot of good things about Python these days. Especially good for implementing simple web services, or other kinds of server applications.
Here's an interesting tutorial on how to create a socket server listener with Python. You can run it stand alone, with minimal fuss.

https://realpython.com/python-sockets/

And Python is available on many different platforms.
It can also connect with your database using the pyodbc driver

https://docs.microsoft.com/en-us/sq...on-driver-for-sql-server?view=sql-server-2017
https://stackoverflow.com/questions...to-microsoft-sql-server-using-python/33727190
 
I'm hearing a lot of good things about Python these days. Especially good for implementing simple web services, or other kinds of server applications.
Here's an interesting tutorial on how to create a socket server listener with Python. You can run it stand alone, with minimal fuss.

https://realpython.com/python-sockets/

And Python is available on many different platforms.
It can also connect with your database using the pyodbc driver

https://docs.microsoft.com/en-us/sq...on-driver-for-sql-server?view=sql-server-2017
https://stackoverflow.com/questions...to-microsoft-sql-server-using-python/33727190

Again, very kind and much appreciated, thank you.
 
Aaargh, i've got to be honest, i've tried god knows how many tutorials on how to do this but these all fail part way through as the tutor either stops giving detail, or the version of the IDE they use is now obsolete and the instructions no longer make sense.

I've even messaged the writer of the tutorial you pointed out previously and it sits unanswered. I would love to get this pet project under way, is there another way I can ask this question that makes sense to a wider audience?

Kindest regards

Craig
 
Back
Top Bottom