[Q] server client - Java for Android App Development

I am developing an application which sends information to PC from an android device (Smartphone), what i want to do is to control this communication from the PC, it means that I have an application GUI with Java in which the botton "RECEIVE" when is clicked the communication starts and the device send the information (the PC and the device are already connected)
I dont know how to proceed (JAVA RMI ,,,...????) if you have any suggestions dont hesitate
Thanks

At this link you can find a client-server framework. Right now its somewhat limited but it would give you a start. It can currently send messages from client to server. You can specify a port and IP address. Hope it gives you what your looking for. http://www.site.uottawa.ca/school/research/lloseng/supportMaterial/ocsf/ocsf231.zip
This page might give you more info
http://www.site.uottawa.ca/school/r...rom my Nexus 4 using XDA Premium 4 mobile app

Related

How to Send String Message to XDA Application. HELP!!!!!!!!!

hi, my dear friends
I am a freshman to XDA dev, I am using ms vs2003 to develop an application on XDA II.
The application is about dispatching a job to a driver's XDA, the senario likes the following: (1) The dispatch server sends a job to driver's XDA thru GPRS. (2) The driver then view the job on the XDA application and Accept it.
The question is how to send a job from the server side to an XDA application, what need I to do with the server programs and what need I to do with the XDA applications? Do we need some develop toolkit from the SP?
Thanks in advance, your suggestion and help are very appreciated!!!
If your network gives you an ip that others can see from outside then you just need to write a small server on your xda using sockets to accept the messages over gprs. Unfortunately, most phone networks do not do this. I think the easiest thing for you would be to make it sms based.
Otherwise you could make a page on your (pc) server and have your xda check it at regular intervals to see if any new jobs are there. The down side of this is the cost of all that checking.
Thanks ORD for you help.
Re: If your network gives you an ip that others can see from outside then you just need to write a small server on your xda using sockets to accept the messages over gprs. Hi ORD, do you mean the Public IP for each XDA phone? Do you know if the SP O2 in British provides this kind of service?
Thanks again!
I don't know what you mean public address? The phone network will have a server address and your phone will get assigned a client address. I can't tell about o2 as I only have tried vodafone in Australia. I think that most IP's given are only useful from within the private network of the provider. I am no expert with the internet, but I think if the ip starts with 10.XXX.XXX.XXX its no good. Perhaps if you post the first half of your IP some of the other network wizez here can tell you if its accessible from outside.
Even if your ip is good, it probably would not be static so I think its not worth the effort. Still... if you go that way, the implementation of sockets on ppc works 100%. In fact I have cut and pasted code straight from ppc apps to desktop apps and had no problems!
Why not just have your phones connect as clients to a small custom coded server on your pc periodically. You could streamline the transmition to only transfer as few bytes as possible each time. The only time a large transfer would be needed is when a job is accepted and the details are needed. my network charges by the kilobyte and when i transfer in only the tens of bytes it dose not even register it on my bill (i don't know how big the handshake is).
Thanks, ORD, yes, we can check the server every XX seconds, the only thing I am worrying about is if I have more than 1 thousand XDA units to connect and check the server, if the server can afford to this load?
This sound like a real world problem you have (like taxis?). If you want the best solutuion (ie sending jobs to xda's) start checking the service providers. 1000 units is a lot. I think there must be a carrier out there willing to provide
usefull addresses. Also try connecting two devices from within the same network. If all your devices are within the same private network they may be able to communicate. You PC server could be connected to the internet via a gprs card and send out jobs to all the xda's within service provided by the same carrier. I have been wanting to try this for a while but I do not have two gprs connections with the same provider.
I have a couple of small apps that may help you test this if you have multiple gprs connections with the same provider.
The following is a ppc program to attempt to connect to another one of itself over a network using sockets:
http://odeean.veritel.com.au/serv/testSocketServer.exe
the next program is for the PC so you can show that the program at least works in the direction of ppc to pc via gprs then internet:
http://odeean.veritel.com.au/serv/ORDsocketUserPC.exe
Do the following:
-Turn on your internet connection and gprs
-On your pc run the ORDsocketUserPC.exe
-to simplify things just turn off any firewalls etc (my app dose nothing bad, but sometimes even if you open a port, firewalls cause it to fail)
-On you xda run testSocketServer.exe
-On the pc server function side enter the desired port details. Because you are first testing if it works at all change the ip to 0 as this causes it to listen for all incoming ip's in my app.
-On the pc server side press listen
-On the xda set the port on the client side to the same as on your pc. Enter the pc's ip (ie from your connection status).
-On the xda press connect
-Now the xda should attempt to connect. It says waiting to read when connected at first
-Now on the pc it should say blocking-listening with some code.
-Two way data transfer is now possible. The desktop version is self explanitory. The ppc version has a lack of screen space so to elliminate some buttons I replaced the get button with ..... make data edit box clear, press send, this generates a dialog with the read data so far.
-This is only a very raw app some things malfunction but I get reliable two way communication. If something goes wrong just close the program and start again.
If all that works you are ready to test the ppc to ppc connection. Make sure you get gprs on each from the same provider run the testSocketServer.exe on both xda's at once. One with server side only and one with client side only. In the client enter the ip of the server (my app dose not find this for you - you may need some third party program for this), make sure the server ip was set to 0 before you press listen.
Please post to tell if it works within the same network as I am very interested. If it dose your problem is solved, otherwise I see no way to help because of the volume of units to communicate to.
Thanks ORD, it is too complicated for me, frankly. Can I push an email to the XDA then let the driver knows that he has a job? He can click an button to request the job. The question is how to push an email to the XDA unit.
Sorry, I can't help with emails.
Its a pitty you could not try it. If anyone else cares to try gprs device to device communication with both ends within the same phone network I am still interested in the result. I just do not want to get yet another sim. vodafone sales people in Australia do not seem to understand their own network and I have wasted enough money buying products from them that do not do what they claim.
Sending of string message over O2
Hi ORD!
Im interested in this and I am using a VPN approach to get both of the devices talking!
I am using your programs but I also wish to view the source code on how u coded this, as when I click connect I recieve an error stating the socket is not writable??? I think it doesnt even start the 3G/GPRS service on the XDA? Could you send me the code?
If it does start GPRS in the background i do apologise!!! But Im uncertain that this is the case!
Thanks!
AJ.
possible solution
All pockets pcs are using private internet addresses, i.e. they can access other external sites, but no one can directly access them as no external connections are allowed to access them without the XDAs initiating the connection.
So all of your 1000 xdas initiate the connection and connect to a central server (on server use asyncrhonous sockets for scaleability).server should be able to handle this easily.
when a job is ready for dispatch the server simply sends it to the appropriate XDA(possible because that XDA initiated the connection, so the phone operator will allow it through their firewall).
No polling needed on the XDA, just the need to monitor the connection and keep it open to the server.
XDA to XDA commmunication. Easy. The server acts as an intermediary.
Imagine XDA1 (vodaphone) wants to talk to XDA2(02) and both are on different networks. They cannot talk directly to each other.
XDA1 sends it message to the server already connected. The server (with a connection already set up) forwards it on to XDA2.
XDA2 replies back to the server, which then forwards it to XDA1.
The server acts as a gateway between the two networks and is able to do so because it is XDA1 and XDA2 initiateed the connection to the server.
For a more technical explanation of how private IP address are assigned by phone operators read up on NAT (Network Address Translation).
This solution would also work if both XDA1 and XDA2 had public IP addresses. All logic can be kept on the server and there is no need for XDA1 to find XDA2s public IP address, which with a 1000 XDAs could become messy very quickly.
cheers
Steve Jubb
I posted a response to this thread that ended up in its own thread.
Please read this: http://forum.xda-developers.com/viewtopic.php?t=55255

Connecting Remote Desktop

Hi,
I am using HTC touch diamond2 and I just want to use the remote desktop function.
I am trying to connect my Windows Vista laptop to my mobile.
I am not sure what needs to be filled in the following:
Computer:
User Name:
Password:
Domain:
I am having the WIFI connection. I have tried with IP in "Computer" and also entered the user name and password and don't know what to fill in at domain.
Can anyone pls help on this? thanks.
If i remember correctly Domain can be left blank, Computer is the name that you would see in System Properties under Computer Name i.e Bob-PC.
All of this is useless though if you are using Vista Home Premium though as it only allows Remote Desktop out to another pc. If you want to RD in to your laptop from your phone Home Premium won't allow it. There is a hack for this on the web though if you are willing to look for it.
Vista Business/Enterprise/Ultimate versions will work fine if that is what you use on your laptop.
Hope that helps!
Hi DirkGently1,
Thanks for your quick reply and yes, I am unfortunaltely using Vista Home Basic. Can you provide any link for hacking this piece to support? thanks a lot.
http://andrewblock.net/?tag=windows-vista
There are links and info on the page above. There have been multiple versions of the hack as service packs would disable it again and an update to the hack was needed each time. Even if you get it working there is some port forwarding needed to allow connections.
You could save yourself the bother and use logmein instead. It's browser based and free. www.logmein.com

[Q] Sending command line to remote desktop

Hello all,
I have been searching the forum but could not find an answer to my question. I have installed a TightVNC server on my dekstop in order to remotly control it by my HTC desire. It works great with the android VNC app.
But the thing is, i only want to send a command line to my PC without using the whole app. I'm designing my own app where i want to send a command lines to my computer. It's just a simple app with a few buttons in order to switch my lights on and off in my room. I have running it on my PC right now with winlirc, which can be controlled by entering a command line.
Is there anyone who can provide me with the Code that connects to the server and can send a command line? If it is not possible to send a command line, then maybe just a way to send a keystroke so i can use autohotkey to act upon it.
Thanks
Have you tried SSH?
I'm working on a windows PC with openSSH at the moment.
But that is just in order to create a secure channel. Don't need it right now since i'm only working in LAN area. Just need the source code that i can put in my app in order to send a command/keystroke

[Q] android + MySQL

Hello all
Probably the question has been ask´d but here it goes...
is there allready a way do acess an on-line MySql DB from the android ?
I need to design an app to fetch and post data from a bd...
any ideas ?
ty all
You may find the following link to be helpful: http://shariqmobin.wordpress.com/2010/03/06/hello-world/
That requires some fiddling with firewalls and allowing external connections to your MySQL DB. If you're not comfortable with that (or not allowed by the DB server admin), you could consider creating a simple webservice or script to supply specific data from your DB.
thnkx m8
i will take a look @ it.
i do have acess to the db as we own the server where the db is
i´ll keep you guys posted
´´tnkx
RemoteDB (market). For extra security, connect to the host via ssh with ConnectBot and tunnel port 3306. It works, and I use it all the time.
It's a ***** to get it working the first time if you're new to ssh and/or tunneling, but it means you don't have to directly expose your database to the Internet. I *highly* recommend getting Toad to work with PUTTY before attempting it via Android, though.
Sent from my SPH-D700 using XDA App

[Q] many to many user

hii all,
i am fresher in android app developer,i face a problem in connection many user to many user also role of admin.in this process. like example one user can send some text to other user but after confirmation of admin it will push the text to desire user.how can it possible globally without investing any cost in trial host.any code if possible . plz suggest me how its possible
You need to have a central server for what you want to do. You could setup the server on a small PC or Raspberry Pi. Its quite simple actually. The server needs to be connected to the internet.
Sent from my Nexus 4 using XDA Premium 4 mobile app

Categories

Resources