PhoneGap is another best solutions for cross platform mobile application development. Using PhoneGap we can develop apps for not only iOS, Android. even we can develop for Windows Phone, BlackBerry, Bada, Nokia, and Web OS… Because PhoneGap just need a Web browser control. So, Most of the smartphones supports HTML5 things. So, create for multiple platforms PhoneGap is best solution. But it have some drawback like slow in scrolling and etc.. . Where Titanium good best in Android and iOS devices.
Here is steps to create PhoneGap app with Titanium ACS API
–> Create ACS Application, go to appcelerator.com and login with your developer account and go to my apps page there you can see ACS only. Click on that
–> Set name and description
–> In that Application page you can see APP Key and OAuth Consumer Key and OAuth Secret key. This are very useful when your working with ACS APIs in PhoneGap.
–> Remember about White List. Here I am allowing all domains.
this is how I design
You can Get this HTML file Code here https://github.com/rish7/TiGap/blob/013bbe39bf6e9d5ade15f479d5a3786b1cc5a1ef/www/index.html
–> As I said above here we are going to using APP key or oAuth details
If you planing with APP Key
var sdk = new Cocoafish(‘/***YOUR ACS APP KEY HERE***/’);
or if you want to go with OAuth
var sdk = new Cocoafish(‘/***oAuth Consumer KEY HERE***/’,’/***oAuth Secret KEY HERE***/’);
Then create a Data variable to set need input values in that ready to send with sendRequest method call.
sdk.sendRequest(‘users/create.json’, ‘POST’, data, callback);
in this above I am send user Data to create. So, i used users/create.json. If we are going to create new event. Then events/create.json and send needed data with POST request (or whatever it is) with data object and callback function. This Call back function with fire when the actions completed with success or failure result. using Data.meta you can get the information about success call. you can get the full HTML code from my GITHUB https://github.com/rish7/TiGap/
Enjoy while coding and sharing…!