Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Phone to PC communicating

  • 14-05-2008 12:25pm
    #1
    Registered Users, Registered Users 2 Posts: 161 ✭✭


    Hey folks,

    I am trying to develop an application where, in its simplest terms, a user can send data (just a number) to a PC (nearby, probably the same room). An application on the PC takes that number and does something with it. Then sends back a simple message saying thanks for using the service.

    I wish to keep this as simple as possible for the user- and also as easy as possible for me to implement.

    I dont want to limit comments but I have experience in Java- but all ideas are welcome.

    Thanks In advance.


Comments

  • Registered Users, Registered Users 2 Posts: 2,931 ✭✭✭Ginger


    Mobile or landline..

    Plenty of mobile modems and you can communicate with them and read info from it.

    Same with a standard TAPI enabled modem and pick up via TAPI on Windows


  • Registered Users, Registered Users 2 Posts: 161 ✭✭ViperMAN


    Thanks for the reply Ginger:
    Sorry- its a mobile. Yes I have heard about hooking up a GSM modem to your PC and then using AT commands etc, but it sounds very complicated and I cant find straightforward tutorials with example code. I am new to mobile programming so I want things to be as simple as possible.


  • Registered Users, Registered Users 2 Posts: 515 ✭✭✭NeverSayDie


    These tutorials might be of some help, re using GSM modems. They're not in Java, but they look fairly straightforward;
    http://www.codeproject.com/KB/cs/SMS.aspx
    http://www.codeproject.com/KB/IP/Sending_SMS_using_Net.aspx

    If the phone is going to be physically close to the PC, you could possibly look into using a Bluetooth solution of some sort. That would probably involve the phone having to have an application on it though.


  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    Bluetooth?

    Or, if you simply must use GSM, why not send a message from your GSM phone to a server and get your server to activate a specific PC.

    C# and visual studio would do this for you on a WinMobile platform -- maximum of one day's work for an experienced developer.

    Java would be quite restrictive in terms of being handset specific -- more 'feature phone' rather than 'smart phone' domain.

    Hooking up Nokias via the serial port and sending AT commands is even more restrictive in terms of application flexibility. (AT commands aren't that hard!)


  • Registered Users, Registered Users 2 Posts: 1,922 ✭✭✭fergalr


    There's a bunch of ways to have your mobile phone talk to your computer.
    What options are available to you?

    Have you bluetooth on both the mobile device and the computer?
    Are both the mobile device and the computer able to access the internet?

    If the mobile device can access the internet, and if the computer has an internet IP address (ie, isn't behind a router or something doing NAT), then I would say the simplest solution would involve running a server listening on the computer, and writing a very simple application in J2ME on the mobile device that connects to the server listening on your computer over the internet.
    You could write a very simple server in PHP on your computer, and simply do a HTTP Get from the mobile device.
    This would be a very simple way of doing things, from a programming point of view, and would be very robust, as HTTP Gets have been supported on J2me mobile devices for a long time.
    There are plenty of tutorials on writing a mobile app that does simple HTTP access, as well as writing simple servers in PHP.


    If the PC or mobile device doesn't have access to the internet, then bluetooth might be an option, assuming they both have bluetooth access. This is harder to code in a device independant way, at least in java, so you might need to look at other technologies.

    I would not think that accessing the phone as a modem would be as easy to implement as using Http, but what the best solution is depends on your other constraints.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 161 ✭✭ViperMAN


    Firstly,
    Thanks to all that replied- much aprriectated!

    Looking over the posts, fargalr's HTTP Get option does seem the easiest. Ive just seen examples of this and seems pretty straight forward. The only downside is making the user download the app first which might turn people off using the service. And would sending a message back from server to the client phone be much work?

    Looking over NeverSayDie's links and taking Cantab.'s advice, using AT commands doesnt seem too hard but trying to find the right modem could be tricky- looked them up on eBay.ie- saw a only COM1 modem- it was over 100quid- if needs be I could stretch to this. There was alot of wireless ones- 30quid- would these suit my needs?

    Again, thanks for the help folk!


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    One option I've used in the past is to write a simple web service to run on the PC/server, and then write an app to connect to that on the phone. It's very very simple to do.

    It requires an IP connection between the phone and PC, but that's also a huge bonus in that it allows a lot of flexibility in the connections, some phones will get an IP connection over a USB cable, some over bluetooth, some over WIFI, or mixtures of the above.

    It requires the PC to be running web server software too, but that's not much of a stretch.

    I did it with windows mobile phones connecting to windows PCs/servers, but it should be as easy to do with java.


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    Oh, another option of course is via SMS messaging. There's various different means of having a PC send/recieve SMS messages, and ways to retrieve them from an app you write. Then on the phone, depending on your needs users could either write the SMS themselves sending it to a number you give them, or your could write an app to do the same.


  • Registered Users, Registered Users 2 Posts: 1,922 ✭✭✭fergalr



    Looking over the posts, fargalr's HTTP Get option does seem the easiest. Ive just seen examples of this and seems pretty straight forward. The only downside is making the user download the app first which might turn people off using the service.

    If it's not a homebrew project, and you have ease of use requirements, or the people you are targeting are customers as opposed to (for example) people in your household or business, then going with some sort of SMS based solution might be best.
    It's probably easier to get someone to send an SMS to your gateway (which in turn transfers the data to your server) rather than getting them to install an application. Not that installing a Java app to a phone is difficult, it's just that everyone already knows how to send an SMS.
    (This would mean your priority is implicitly changing from ease of implementation to ease of use.)

    I don't know a huge amount about getting an sms gateway that connects to your server, but I do know that it's a well solved problem, with plenty of companies out there offering appropriate services and toolkits.
    And would sending a message back from server to the client phone be much work?
    If you go with a http get from a j2me application, sending a message back from the server would be trivial - it happens as part of the http request, you just put your message in the page that's returned from the Get request.
    One option I've used in the past is to write a simple web service to run on the PC/server, and then write an app to connect to that on the phone. It's very very simple to do.
    It requires an IP connection between the phone and PC, but that's also a huge bonus in that it allows a lot of flexibility in the connections, some phones will get an IP connection over a USB cable, some over bluetooth, some over WIFI, or mixtures of the above.
    This is another possible solution, however I'd say HTTP generally beats this if you go down the internet road, as it's easier for you to implement, and the HTTP request is also supported on more phones - some older devices don't support (j2me api) IP well, or at all, but do implement HTTP fine.


  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    ViperMAN wrote: »
    Firstly,
    Thanks to all that replied- much aprriectated!

    Looking over the posts, fargalr's HTTP Get option does seem the easiest. Ive just seen examples of this and seems pretty straight forward. The only downside is making the user download the app first which might turn people off using the service. And would sending a message back from server to the client phone be much work?

    Looking over NeverSayDie's links and taking Cantab.'s advice, using AT commands doesnt seem too hard but trying to find the right modem could be tricky- looked them up on eBay.ie- saw a only COM1 modem- it was over 100quid- if needs be I could stretch to this. There was alot of wireless ones- 30quid- would these suit my needs?

    Again, thanks for the help folk!

    If you want to send simple SMS messages via a gateway, I'd highly recommend bulksms.co.uk. You can buy as little as £8 credit which lasts for 12 months. Each sms to Ireland costs £0.02 IIRC.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 161 ✭✭ViperMAN


    Cheers lads-

    Looks like SMS is the right way to go! Im off to look for a GSM modem (although I've heard you can hook up your Phone to the PC with a cable and it works just as well- am I right?). Anyone with good places and models to buy please get back to me.

    If all else fails, I always have the HTTP get option.

    If anyone has anymore good examples/tutorials etc, on both the SMS & HTTP method (or bluetooth for that matter) please post them. I just want to cover all options before I start!

    Cheers everyone!


  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    ViperMAN wrote: »
    Cheers lads-

    Looks like SMS is the right way to go! Im off to look for a GSM modem (although I've heard you can hook up your Phone to the PC with a cable and it works just as well- am I right?). Anyone with good places and models to buy please get back to me.

    If all else fails, I always have the HTTP get option.

    If anyone has anymore good examples/tutorials etc, on both the SMS & HTTP method (or bluetooth for that matter) please post them. I just want to cover all options before I start!

    Cheers everyone!

    Before you dive into data cables and AT commands, think about
    - the cost of running a machine 24x7 (you'd be surprised how much electricity this uses)
    - the cost of you buying all the hardware (PC server, data cables, phones, etc.)
    - the cost of sending an SMS via a phone (pay-as-you-go/subscription, etc.)
    - the cost of your time

    I would find it very hard not to justify using a third-party SMS gateway for < €0.03 per message.


  • Registered Users, Registered Users 2 Posts: 161 ✭✭ViperMAN


    Cantab. wrote: »
    Before you dive into data cables and AT commands, think about
    - the cost of running a machine 24x7 (you'd be surprised how much electricity this uses)
    - the cost of you buying all the hardware (PC server, data cables, phones, etc.)
    - the cost of sending an SMS via a phone (pay-as-you-go/subscription, etc.)
    - the cost of your time

    I would find it very hard not to justify using a third-party SMS gateway for < €0.03 per message.

    I can see where your coming from here Cantab. I will investigate a third party gateway before I do anything. Thanks for the advice.


  • Closed Accounts Posts: 3,285 ✭✭✭Smellyirishman


    If you're interested in just getting a test model running with a local mobile phone then SMSLib is a great java library that will provide all the functionality you need.


  • Registered Users, Registered Users 2 Posts: 161 ✭✭ViperMAN


    If you're interested in just getting a test model running with a local mobile phone then SMSLib is a great java library that will provide all the functionality you need.

    Yes Ive heard quite alot about SMSLib- I'll give it a look, thanks.

    One final few questions though- if I was to go down the route of the GSM Modem-
    1. Do I have to get a modem that will connect to a COM port only (What about the USB ones? Ive seen examples only with COM ones, would using a USB one make programming harder to execute?)
    2. Where can I find a good/cheap one?
    3. The sim cards used in these modems, can they just be a normal pre-pay one from vodafone?
    4. What about hooking up your phone (Mines a Nokia 6234)- is this alright?

    Thanks in advance.


Advertisement