i have made an iPhone application that consumes a Local LAN web service for my client and now i am stuck up getting the app published…..
As the web server is deployed locally on the clients LAN the Apple team that tests my app will not be happy with the app as it cannot find the local server IP(it will crash)….
hey somebody help me out with a solution….
And can somebody explain the uses of these Attributes…
under Titanium.Platform ????
As long as you gracefully handle the error, so that no exception occurs, I don't think there will be any problem with your app. Put a try / catch construct around the code that is attempting to connect to the local server, and show an alert/warning after a given timeout to the user to inform them of the probem.
I hesitate to answer your second question, as it seems strange you have asked what an address/netmask is after you already seem to have an understanding of more advanced topics such as connecting to local webservers. Hence, please excuse me if I have missed your point:
"address" is the IP address. Every device connected to a TCP/IP network must have a unique IP address in order communicate with other devices.
"netmask" is used to differentiate between devices on local and remote networks. Those on a local network can be communicated with directly, but communications with those on remote networks must be routed via a gateway. You will find more information here, here and here.
According to the API docs, the two Ti.Platform properties are useful only when the device is connected to a wifi network. Use Ti.API.info('Address = '+Ti.Platform.address) and Ti.API.info('Netmask = '+Ti.Platform.netmask) to discover whether then are automatically set. Alternatively, try setting them using valid values such as Ti.Platform.address = '192.168.1.10' and Ti.Platform.netmask = '255.255.255.0' to see if they are writable.
Hope this helps
thanks for the Reply Hal…
If an answer has moved you any closer to a solution, a nicer way to show thanks is to simply mark an answer with "best answer". :)
This has the advantage that it helps other people find your question, and the answer, in future.