-2

I am writing an invoice program that monitors the state of the invoice on an android tablet. For simplicity consider the invoice as an integer variable that dynamically is changed in the PC program. How can I show the last value of the variable in the tablet? In fact, the customers see the last state of their order in the tablet, while the main program is running in the PC. My first initial guess is to simulate a web server in my PC (for example using IIS or wamp) and periodically request the value from it and show the result in the tablet. But I think this is not optimal and depletes the tablet battery. Do you have any better Idea?

  • PC Platform: windows 7
  • PC programming Language: C#
  • PC DB: Access
  • Android version 2.3

This is my sample code written in C# in the PC. I want to see the value of ''i'' on Tablet.

class sample
{
    // I want the variable to be visible from the tablet
    public int i;
} 

** EDIT: **

My program is a standalone desktop program written in C#. My database engine is MS ACCESS. The security is not important for my case (at least for now), TCP connection through wifi is preferred (between PC and tablet), but if bluetooth has any advantage, I can also use it.

remo
  • 880
  • 2
  • 14
  • 32
  • Why a negative point? If I asked in an incorrect forum? – remo Jan 16 '14 at 21:17
  • your question is very broad - "view on tablet" assumes an Android app or web page? "changed in the PC" - a database client? stand-alone desktop program? What language? Preferred transport protocol? (TCP, HTTP, FTP, etc.) Security issues? Available through bluetooth? You tagged C# - is that your PC client? Your question should be edited to constrain the problem and be more specific to Android... – Jim Jan 16 '14 at 21:35
  • I have edited my question. Please guide me to solve the problem. – remo Jan 17 '14 at 05:41
  • OK - but you say you want to "monitor the state of the invoice on the tablet" and then say "integer variable that is dynamically changed on the PC" - which way is the data going? Are you roaming or do the devices have static IP's? Do you have MSAccess Drivers for TCP connections? – Jim Jan 17 '14 at 07:35
  • As I said for simplicity I assumed the invoice as an integer (That is because if I can monitor that variable in my Tablet, I will be able to show the invoice too, i.e., that is not my problem). My tablet and PC are in the same room (in fact in an small shop), and the PC has a static IP. I'm not aware about MS Access driver for TCP. I will search about it. Would you please describe more about it. I prefer not to develop a new android application, but use the browsers to show the invoice, probably in a Table. Thanks – remo Jan 17 '14 at 10:27

1 Answers1

0

If you're on a secure network and you're trying access a MS Access DB, then you probably need a 3rd party vendor driver like this:

http://www.easysoft.com/applications/microsoft-access/jdbc-odbc.html

since most JDBC drivers assume the DB is local, like this:

http://www.codeproject.com/Articles/35018/Access-MS-Access-Databases-from-Java

and then connect you Android app to it using TCP:

Android client and Java server TCP communication

Reading from a PC program (not a database) will require either reading flat files directly (where the data is stored or persisted) or writing your own data access driver (so that you make it accessible on a TCP port).

Community
  • 1
  • 1
Jim
  • 10,172
  • 1
  • 27
  • 36
  • Thank you. I prefer to install a wamp server and provide HTML output from the state of the variable. I hope this will remove my negat-ive point from the question – remo Jan 18 '14 at 09:47