Christopher Carlsson
Christopher Carlsson

Reputation: 125

Android application - develop for iPhone how?

We're some students from Sweden, and we've developed an Android application in a school project. The application has been noticed by a number of significant (to us) people who're very interested in our idea, but think it's necessary to develop an iPhone application to give it even a small chance of succeeding. The problem is that we've only studied Java, for a little less than a year. We had to learn Android 'on-the-go'. We don't really know how to take this fairly advanced Android application and turn it into an iPhone application.

We've explored the possibilities of using some kind of framework, and one that has caught our eyes is "PhoneGap". But we don't know if it's advanced enough for our purposes. In the Android version we have a client (the phone), which in turn contacts a TCP-server that in turn contacts a MySQL server to get the information needed. The information is then sent back to the application and handled. The data we get back almost always gets put in some kind of list that fills up our view.

Can PhoneGap handle objects like this? Can it calculate the data we get back and dynamically add it to the client? Is PhoneGap even "secure"? Or would you recommend going in a completely different direction - like learning to program for the iPhone "for real"? How time consuming would this be for a group of people who're familiar to objectoriented programming and has written mobile applications for another platform?

Hope that someone has the time to read through all of this, we would really appreciate any help that we can get! Thanks in advance!

Upvotes: 3

Views: 266

Answers (1)

balexandre
balexandre

Reputation: 75073

PhoneGap is the way to go, it's a simple framework that gets your application (must be developed in HTML/Javascript) and adds it's own layer so you can, from your web application call the hardware functions, such as camera, accelerometer, contacts, photos, etc... (the entire list s available on PhoneGap Docs)

First of all, to be able to use PhoneGap to aim to all different OS supported by PhoneGap, you need to convert your app to a WebApp.

Because you have learn Java and Android, download the PhoneGap zip file, and use \lib\android to start developing it.

Remember to read the readme.md to see what to do first.

Regarding security, that's easy as PhoneGap converts your web application into a native app and for such, all security you have in a native app, will be implemented in the output from PhoneGap.


Regarding TCP Communications, I don't see anything on the web for it, but, can you use a web socket to do the same, if you can, it will save you some headaches, if not, you can search a plugin in PhoneGap plugins area and see how they develop plugins cross-devices and develop your own... javascript is way simpler to learn than Java or Android ;)


How to start

PhoneGap is a javascript framework. First you should develop your web application, start with jQuery Mobile for example, and make you app run in a web browser, upload it to a host (or localhost, as long it's accessible from your network as well) and see it on your mobile devices.

If you need to access core functions of the phone (for example, add a phone contact based on the data received) you can't access this through a web application, you will need to use PhoneGap API for that, and for this example have something like:

var myContact = navigator.contacts.create({"displayName": "Test User"});

You can find several tutorials on PhoneGap Wiki as well, and more on Getting Started.

Note: PluralSight has also a good PhoneGap Video Tutorial using jQuery Mobile, but they are aiming for a Windows Phone 7 application instead an Android one, but is a good starting point, and the changes between WP7 and Android in only in the PhoneGap Build part, that's all.

The course takes 2h06, and with a free account, you have 2 hours of Video for free, so... it's a great way to start :)

Upvotes: 3

Related Questions