Vodafone India – GPRS for iPhone without Data Plan
Update: If you have the latest version of iOS (3.1.3, 4.0, 4.1 or later), please check update below.
Vodafone(India) will not allow to use the regular GPRS plan (Vodafone Live) on iPhone. We need to take special iPhone data plan which costs min of Rs 199. This is sort of insane, So I just took a crack at it and found a way to access the internet using the regular plan. I have an unlocked, jailbroken iPhone which is running 3.0 firmware. Please follow the below instructions.
Using OpenSSH, edit preferences.plist located in /private/var/preferences/SystemConfiguration.
Important: Make sure you take a backup of the original preferences.plist.
Around line number 89 (this is appox line number, contents of the file may change based on your phone settings) replace the <dict> with below <dict>
<dict> <key>Interface</key> <dict> <key>DeviceName</key> <string>ip1</string> <key>Hardware</key> <string>com.apple.CommCenter</string> <key>Type</key> <string>com.apple.CommCenter</string> <key>UserDefinedName</key> <string>com.apple.CommCenter (ip1)</string> </dict> <key>Proxies</key> <dict> <key>HTTPEnable</key> <integer>1</integer> <key>HTTPPort</key> <integer>9401</integer> <key>HTTPProxy</key> <string>10.10.1.100</string> </dict> <key>UserDefinedName</key> <string>com.apple.CommCenter (ip1)</string> <key>com.apple.CommCenter</key> <dict> <key>AllowNetworkAccess</key> <integer>1</integer> <key>Available</key> <integer>1</integer> <key>Setup</key> <dict> <key>AllowNoDNS</key> <integer>1</integer> <key>apn</key> <string>portalnmms</string> <key>password</key> <string></string> <key>type-mask</key> <integer>1</integer> <key>username</key> <string></string> </dict> <key>Version</key> <integer>2</integer> </dict> </dict>
To activate Vodafone Live (GPRS) see Vodafone Website
Update: The below configuration is working on 3.1.2 as well, but the line numbers are little different.
Update (16 Mar 2010):
Many guys have commented that the changes that were made in preferences.plist are lost after restarting the iPhone (for versions 3.1.2 and 3.1.3). So today i decided to take a look at it. And what you guys said is absolutely right, i upgraded my iPhone OS to 3.1.3 and i see that the settings are lost after restarting the phone. And you guys don't worry, i had found a way to fix this and this is much easier than my previous solution. Below are the step by step instructions.
- Download and Install iPhone Configuration Utility from http://support.apple.com/kb/DL926
- Open the application, Select Configuration Profiles on the left hand side menu and click New in the toolbar; Enter the name, identifier, organization and description; see the image below for more details

- Now go to Advanced option and set the apnname = portalnmms, proxy server =10.10.1.100 and port = 9401

- Connect your iPhone to computer via USB cable and you should see your iPhone in the devices menu on Left hand side. Select your device
- Select Configuration Profiles tab and you should see the Vodafone Profile; Click on Install

- You will see a pop on your iPhone asking for permission to install the configuration, Click Install button in your iPhone

- Turn on Data Roaming. Data Roaming can be turned on from Settings > General > Network on you iPhone.
- And you are done with the configuration. You should be able to use internet on your iPhone now. If its not working just reboot your phone.
Hope this helps !! Please feel free to give your Feedback, Suggestions
Update(08 July 2010): Few guys confirmed that this is working on iOS 4 as well, i personally couldn't test this at this point of time as i'm out of country. I will update this post as soon as i'm back in India. Thanks Sanjeev, Taran for testing it out on iOS 4. You might need to download the upgraded version of the configuration utility. You can download it from http://support.apple.com/kb/DL926.
Update(14 Nov 2010): This configuration works good on iPhone 4 as well. Tested and Certified by me
Update(10 Dec 2010): For those that this configuration is not working, please turn on Data Roaming. Data Roaming can be turned on from Settings > General > Network.
Update(2nd May 2011): 4.1, 4.1.2 are good with the same configuration
Update(31st May 2011): I Confirm that 4.3 is good with the same configuration for iPhone 4.
YUI Components with DWR – DWR DataSource
I'm working on project which uses YUI and DWR. The hardest part is intergrating these two. I googled on how people integrated YUI and DWR, found this and this. But these solutions will only work with earlier versions of YUI. I'm using YUI 2.7. So i ended up writing my own DWRDataSource. Might be useful for guys who want to integrate DWR and YUI 2.7.
Drawbacks :
- This version unlike XHRDataSource does not support queuing and aborting the requests, as DWR has no support for aborting the requests.
- No support to call java methods which has multiple arguments. Eg: You cannot invoke UserService.getUser(name, email).
YAHOO.namespace("javachap.util");
javachap = YAHOO.javachap;
var DS = YAHOO.util.DataSourceBase,
lang = YAHOO.lang;
javachap.util.DWRDataSource = function(oLiveData, oConfigs) {
this.dataType = DS.TYPE_XHR;
oLiveData = oLiveData || "";
javachap.util.DWRDataSource.superclass.constructor.call(this, oLiveData, oConfigs);
};
//DWRDataSource extends DataSourceBase
YAHOO.lang.extend(javachap.util.DWRDataSource, DS, {
/**
* Overriding method passes query to Connection Manager. The returned
* response is then forwarded to the handleResponse function.
*
* @method makeConnection
* @param oRequest {Object} Request object.
* @param oCallback {Object} Callback object literal.
* @param oCaller {Object} (deprecated) Use oCallback.scope.
* @return {Number} Transaction ID.
*/
makeConnection : function(oRequest, oCallback, oCaller) {
var oRawResponse = null;
var tId = DS._nTransactionId++;
this.fireEvent("requestEvent", {tId:tId,request:oRequest,callback:oCallback,caller:oCaller});
// Set up the callback object and
var oSelf = this;
/**
* Define DWR success handler
*
* @method _dwrSuccess
* @param oResponse {Object} DWR Response
* @private
*/
var _dwrSuccess = function(oResponse) {
// If response ID does not match last made request ID,
// silently fail and wait for the next response
if(oResponse && (this.connXhrMode == "ignoreStaleResponses") &&
(oResponse.tId != oQueue.conn.tId)) {
YAHOO.log("Ignored stale response", "warn", this.toString());
return null;
}
// Error if no response
else if(!oResponse) {
oSelf.fireEvent("dataErrorEvent", {request:oRequest,
callback:oCallback, caller:oCaller,
message:DS.ERROR_DATANULL});
YAHOO.log(DS.ERROR_DATANULL, "error", this.toString());
// Send error response back to the caller with the error flag on
DS.issueCallback(oCallback, [oRequest, {error:true}], true, oCaller);
return null;
}
// Forward to handler
else {
//oSelf.responseType = DS.TYPE_JSARRAY;
// Try to sniff data type if it has not been defined
if(oSelf.responseType === DS.TYPE_UNKNOWN) {
if(YAHOO.lang.isArray(oResponse)) { // array
oSelf.responseType = DS.TYPE_JSARRAY;
}
// xml
else if(oResponse && oResponse.nodeType && oResponse.nodeType == 9) {
oSelf.responseType = DS.TYPE_XML;
}
else if(oResponse && oRawResponse.nodeName && (oResponse.nodeName.toLowerCase() == "table")) { // table
oSelf.responseType = DS.TYPE_HTMLTABLE;
}
else if(YAHOO.lang.isObject(oResponse)) { // json
oSelf.responseType = DS.TYPE_JSON;
}
else if(YAHOO.lang.isString(oResponse)) { // text
oSelf.responseType = DS.TYPE_TEXT;
}
}
oSelf.handleResponse(oRequest, oResponse, oCallback, oCaller, tId);
}
};
/**
* Define DWR failure handler
*
* @method _dwrFailure
* @param oResponse {Object} Exception object
* @private
*/
var _dwrFailure = function(oResponse) {
this.fireEvent("dataErrorEvent", {request:oRequest,
callback:oCallback, caller:oCaller,
message:DS.ERROR_DATAINVALID});
YAHOO.log(DS.ERROR_DATAINVALID + ": " +
oResponse.statusText, "error", this.toString());
// Send failure response back to the caller with the error flag on
oResponse = oResponse || {};
oResponse.error = true;
DS.issueCallback(oCallback, [oRequest,oResponse], true, oCaller);
return null;
};
/**
* Define DWR call meta data
*
* @property _dwrCallMetaData
* @private
*/
var _dwrCallMetaData = {
callback:_dwrSuccess,
exceptionHandler:_dwrFailure,
scope: this
};
// Get ready to send the request URL
var dwrServiceMethod = this.liveData;
dwrServiceMethod.call(this, oRequest, _dwrCallMetaData)
return tId;
}
});
YAHOO.lang.augmentObject(javachap.util.DWRDataSource, DS);
And configure YUI AutoComplete to use the DWRDatasource. Here Userservice.getUsers is the javascript function that you want to invoke to fetch the data from the server.
// Use an DWRDataSource
var oDS = new javachap.util.DWRDataSource(UserService.getUsers);
// Instantiate the AutoComplete
var oAC = new YAHOO.widget.AutoComplete(
'userName', 'userNameContainer', oDS);
// we dont need '?query=sQuery', just return the sQuery instead.
oAC.generateRequest = function(sQuery) {
return sQuery;
};