×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Question Address each mobile phone being connected to an apache server

    Dear readers,
    I'm programming mobile phones in J2ME, and I am in need of communicating with a server, which can be programmed via PHP. Additionally it has a mySQL database.

    It should work like that:
    1. A mobile phone connects to the server via Internet.
    2. It receives an id, which clearly identifies the mobile phone. So the mobile phone is logged in, as long as the application is not closed.
    3. Now picture a series of mobile phones which are all connected to the server at the same time using the same procedure.
    4. Now I want to address each mobile phone according to its id.

    For instance, one mobile phone has the ID 20090416/23456. Another one has the ID 20090416/23457. Now the approach should be - here in pseudo-code - "look through all IDs being connected, find a pattern and display a message/picture on that screen". So the first mobile phone could show a picture, the second mobile phone could show a text.

    I would like to know, which specific information I need to accomplish this.

    Regards

  2. #2
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    198

    Re: Address each mobile phone being connected to an apache server

    Mobile phones connect to the server using a REQUEST/RESPONSE pattern. You make a request to the server for the ID. The application could then (at a later time) make another request to retrieve the picture. The server cannot make a connection to the phone.

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com

  3. #3
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Address each mobile phone being connected to an apache server

    as mike adresses it's all mostly request-response communication... through http that would be GET or POST requests... always started by the mobile...
    So practically in your case a mobile could do a LOGIN request (GET or POST) after which the server responds with a unique ID... after that the mobile always includes this unique ID into his requests towards the server...
    so the mobile will do a POST request to (for example) a getData.php script, the wwebserver will receive this POST request adressing the getData.php script, after which it will extract the unique ID from the supplied POST parameters (or even the HTTP header)... and according to the ID it will return a picture or some text

    personally I did experience sometimes that some HTTP POST parameters were missing when the POST request arrived at my server, but this hads been a known problem in my country cause it seems that sometimes some providers actually remove some parameters (or cache them) by using firewalls, filters or whatever...

  4. #4
    Regular Contributor
    Join Date
    Sep 2007
    Location
    Thirunelveli
    Posts
    115

    Re: Address each mobile phone being connected to an apache server

    hi,
    I think in your case the server has to connect to mobile for transfering data. Though i have not practically implement atleast in the document it says:
    An inbound connection can be established using push registry. that is making the midlet application listen for UDP request from mentioned server. This is possible only if mobile is allocated with an ip address.

    Read Midlet push Registry document for more details.

    Regards
    Senthil

  5. #5
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    198

    Re: Address each mobile phone being connected to an apache server

    Quote Originally Posted by senthil_k View Post
    An inbound connection can be established using push registry
    You can't normally establish an inbound connection using the Push Registry. As far as I am aware, there is only one network in the entire world that assigns IP addresses to the phone, and that network is very small.

    You can push a short message to the application using the Push Registry, but this does not establish a networking connection. The application receives the message and then performs the normal Request/Response connection to the server.

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com

  6. #6
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Re: Address each mobile phone being connected to an apache server

    mikemoore, but when does the application know that there is a picture waiting for it. By constant polling using a thread? There should be something closer to the hardware. After all, if a call is coming in, the phone is being activated. Do you know how I can use the same mechanism? I mean, the phone has to be detected to have a conversation, why shouldn't it work here aswell?

  7. #7
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    198

    Re: Address each mobile phone being connected to an apache server

    Quote Originally Posted by Koryphäe View Post
    After all, if a call is coming in, the phone is being activated. Do you know how I can use the same mechanism?
    An entirely different technology than TCP/IP and not available to you using either Symbian C++ or Java Micro Edition.

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com

  8. #8
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Re: Address each mobile phone being connected to an apache server

    Who told you so?
    Quote Originally Posted by mikemoore View Post
    An entirely different mechanism not available to you using either Symbian C++ or Java Micro Edition.

  9. #9
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    198

    Re: Address each mobile phone being connected to an apache server

    Quote Originally Posted by Koryphäe View Post
    Who told you so?
    If you have a genuine desire to know more about this subject you might want to study it in a little more depth than your question suggests you have.
    Last edited by mikemoore; 2009-04-16 at 15:40.

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Address each mobile phone being connected to an apache server

    Quote Originally Posted by Koryphäe View Post
    mikemoore, but when does the application know that there is a picture waiting for it. By constant polling using a thread? There should be something closer to the hardware. After all, if a call is coming in, the phone is being activated. Do you know how I can use the same mechanism? I mean, the phone has to be detected to have a conversation, why shouldn't it work here aswell?
    Are you talking about MMS delivery?

    An MMS is received by an HTTP connection, initiated by the phone. Of course, the phone needs to know that an MMS is waiting. The network tells your phone that an MMS is waiting, by sending a WAP-push notification (basically, an SMS to a specific port number). The phone responds to this by retrieving the content.

    As Mike says, you can wake up your application on an incoming SMS to a specific port, so yes, you can use this mechanism. However, this mechanism is not an inbound TCP connection.

    You can handle an inbound TCP connection, but your phone has no public IP address. The TCP connection would have to come from another application on the same device (such as another MIDlet, or a native application). This can only be used for inter-process communication on the device.

    So far as I know, the only way to push information to the device is by SMS.

    Graham.

  11. #11
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Address each mobile phone being connected to an apache server

    also take into account the sandbox principle of j2me...
    it wouldnt make any software much safer if you could connect (and maybe activate) it on a distance...
    but mike precisely nailed it when he explained to you that an incoming call is a completely different technology than some basic networking (tcp/ip and http)... The fact that a device is capable of something like that does NOT mean that you will be able to acces it from within j2me nor c++ (symbian)...
    again, if you would like to know why this is so you might want to educate yourself regarind MIDP, J2ME and it's sandbox principle...

  12. #12
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    198

    Re: Address each mobile phone being connected to an apache server

    Quote Originally Posted by grahamhughes View Post
    your phone has no public IP address
    More to the point, the phone has no TCP/IP address at all. Data packets are only assigned an IP address at the point at which they exit the operator's network and are placed on to the Internet.

    All phones on an operator's network therefore appear to use the same (very small) range of IP addresses. These IP addresses are actually the addresses of the gateway that translates data packets from the operator's network to the Internet (TCP/IP).

    It is quite possible that two successive connections from the same phone may be assigned different IP addresses.

    The only sense in which TCP/IP can be said to work on the inside of a carrier network is (as you say) locally on the phone, using 127.0.0.1.

    It is quite impossible for a normal TCP/IP based server to ever initiate a network connection directly to a phone, the phone must contact the server.

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com

  13. #13
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Address each mobile phone being connected to an apache server

    Quote Originally Posted by mikemoore View Post
    More to the point, the phone has no TCP/IP address at all. Data packets are only assigned an IP address at the point at which they exit the operator's network and are placed on to the Internet.
    Hmmm... my understanding is that they do have an IP address, but that it's a private class A address (10.x.x.x). In the same way as my laptop's current address is 192.168.1.70, which is not the address any website will see, and is not an address to which other internet-connected devices can connect. The network changes the IP address in the same way as my ADSL router. But I could be wrong, this is not my area of expertise.

    My laptop can function as a server, only if I enable the routing of incoming traffic on my router, and if I configure a static IP address on my laptop. You can't give your phone a static address, and you can't reconfigure Vodafone (or whoever).

    However, it's a moot point. The consequence is the identical. An internet-connected device cannot initiate a connection to a mobile device. The mobile must initiate the connection.

    (Microsoft "Direct Push" email faces the same problem, and is hence not strictly a push mechanism. It works by initiating a connection from the device, and then holding it open with periodic "heart-beat" packets.)

    Graham.

  14. #14
    Registered User
    Join Date
    Feb 2009
    Posts
    16

    Exclamation Re: Address each mobile phone being connected to an apache server

    So asking the server each time whether it's "got mail" is the way to go. But what happens here? You enter an address into your phone-browser - be it opera mobile for instance. Then data is being delivered and shown on your display. You couldn't do that without knowing where to send the data to, I guess you agree. Can't you just keep the connection alive, so a packet is sent when the application is being started, like a "hey I am here". Then the connection is being kept alive as the application is simply waiting for more data. I guess something like Microsoft DP you mentioned graham. Can you share a basic code sample for that?

  15. #15
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    198

    Re: Address each mobile phone being connected to an apache server

    Quote Originally Posted by grahamhughes View Post
    but that it's a private class A address (10.x.x.x)
    I guess anything is possible, but there's no intrinsic reason why an operator would do this since the packets in the operator's network aren't transmitted or routed using TCP/IP.

    I suppose if I was preparing my network to allow incoming TCP/IP connections then this would be one way to do it. Which networks have you seen this on?

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com

Similar Threads

  1. Connecting PC to Mobile Phone Via Bluetooth
    By Sapinou in forum Bluetooth Technology
    Replies: 3
    Last Post: 2011-04-13, 08:19
  2. Replies: 0
    Last Post: 2007-07-15, 23:06
  3. SMS via Mobile phone connected to pc using VC++
    By pards073001 in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2006-10-09, 04:50
  4. PC vs Mobile Phone, which one should be server?
    By Jossnaz in forum Mobile Java General
    Replies: 1
    Last Post: 2006-10-01, 21:33
  5. How to read address book in mobile phone through AT command?
    By rickylee in forum General Messaging
    Replies: 1
    Last Post: 2002-12-14, 19:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×