Phonegap and iPhone apps - ios

I want to build an iPhone app, but I only know PHP, JavaScript, CSS and HTML. I heard that I can use Phonegap to build the app in javascript and it converts the JavaScript to Objective-C. Is that true? The phone gap documentation was hard to understand. What other solutions do I have?

Yes and no.
Phonegap (nowadays known as Apache Cordova) enables you to bundle web pages/applications as native phone apps. It also provides you with some JavaScript bindings to native phone APIs that you otherwise wouldn't be able to access (=with a plain webpage). These bindings include (just to name a few) Accelerometer, Camera and Compass. That's pretty much all it does - you still have to figure out how to write your application with JavaScript, HTML and CSS.
Try out how it works by checking out "Getting Started with iOS".

If you know all these languages you mentioned that is well enough for developing an iOS App(as well as you can develop the same apps in Android).
I would suggest you to go for PhoneGap(Cordova) framework to develop these apps. Using this framework you'll have to use HTML/HTML5, JavaScript, CSS, PHP and get the iOS App running on your device. Here to StartWith and then check out APIDocs. You will always get a lot of tutorials on google itself.
You can also refer This Question for gathering some knowledge about other frameworks available in market.
Hope it helps.

I would suggest Phonegap, but you can't use PHP with Phonegap apps directly... There are a few hacks around this though.
Although Phonegap is supposed to be "one codebase, distribute everywhere", if you want a really great looking app you'll have to spend a liitle time adjusting the UX for every platform or device. The thing I really like about Phonegap is that you can open up a HTML page locally on your browser and move thing around in firebug, making the process faster.

Related

List all device information with Flutter on iOs

I am facing the project which should be as many other "boost cleaners". I'd appreciate any advise on this theme. As far as my research goes, I see, that it is quite more difficult to do in iOS, rather then Android. I don't hope for any good lib out there, and should probably do platform channels.
In general I need right now somehow get all device info - memory, battery, installed apps, cache, etc.
AS I've said, I had done a bit of research, and see the problem as stated.
If you can use Libraries for it i don't think there is any library which can support all info so you will have to use multiple libraries.
Just make sure library should support all the platform you want to build you apps on.
https://pub.dev/packages/system_info_plus.
https://pub.dev/packages/battery_info.
https://pub.dev/packages/device_info_plus.
https://pub.dev/packages/installed_apps (Only Android)

Which hybrid mobile app framework to use

I know that hybrid apps are much easier to use, so I need to choose a best one for my application that I already have as website, done in PHP. These are my options:
1.PhoneGap
2.AppDeck
3.Titanium
4.Ionic
Any suggestions on which is the best one to use?
Try to use PhoneGap since it is the most mature one.
Ionic is pretty much based on Cordova (which is based on PhoneGap)
But i'd go for Ionic from that list, seems to have lots of support being it and are adding stuff to it regularly.
From this I will recommend you Ionic.
It's as phonegap build on Cordova but Ionic seems to be the most hot hybrid platform right now

Can't access camera PhoneGap 3.3

The Problem
I'm attempting to build my first PhoneGap app for iOS. I am using version 3.3.x.
For whatever reason, I can't seem to get the Camera feature to work on my iPhone 5S (haven't tested any other devices).
What I've tried
I've installed the Camera Plugin
I've added the feature to the config.xml file on the platform/ios/www level.
I've tried using PhoneGap docs examples.
I've tried using other online examples.
I've tried buying the PhoneGap 3 book and going step-by-step through their method.
None of that seems to matter
What works
I've used a <input type="file" accept="image/*;capture=camera">, this works, but it's not really what I'm looking for. I'm trying to actually access the Camera API.
Geolocation plugin I've tried and it works fine.
Accessing external API's I have gotten to work.
What also doesn't work
Contacts Plugin also doesn't seem to be working with the examples on the PhoneGap Docs.
Possible Clues
I am running / building the app from within Xcode. I've also tried building using the Command-Line Tool but I'm not sure how to run it on my iPhone once it's been built through CLT. I don't know if this matters or not.
There seems to be a "lag" in launch time when I include any scripts associated with the Camera API.
Since I've used so many different code snippets from verified sources, I doubt it has to do with the js, html or css that I'm writing. I believe this to be a dependency issue, but I have no idea what it could be, and there's not much help out there for PhoneGap yet.
Any advice or suggestions would be greatly appreciated!

Using Protocol buffers in PhoneGap - iOS

I have used the c++ google protobuf classes in iOS using the native app approach, i.e. using Xcode, objective c, cocoa etc.
Now, I want to migrate to hybrid apps and I have explored the options on web, and according to my requirements i'm down to PhoneGap and Titanium. That will require me to use JavaScirpt, HTML5 (JavaScript only in Titanium as per my understanding) jQuery etc.
My question is, HOW am i supposed to access the my c++ protobuf classes from javascript. (i have no expertise in JavaScript).
I am also open to opinions on which hybrid-app framework to use.
Lords of web-dev....guide me.
With PhoneGap, if there is a phone feature that the PhoneGap APIs do not currently expose, or if you have some specialised native algorithm / function that you wish to access, then you need to write a plugin.
PhoneGap plugins provide a standardised mechanism for packing native code and accessing its functionality via JavaScript. See the PhoneGap Plugin Development Guide.
Personally I think PhoneGap is the best hybrid framework, it had been around for a while, is well documented, and has a healthy community.
This is an old question, but you can always use the 100% JavaScript implementation of ProtoBuf in your JavaScript code. It works well, and you can even precompile the .proto file if you want.
In Cordova it would be better to create a plug-in, but if you don't have time or skill to do that, the linked code works well.

Integrating phoneGap with native iOS app

i'm trying to create an app which uses the combination of native functionality and the phoneGap framework. The native app has a button, upon the click of which the phoneGap ui has to be added to the view. Is there any way to achieve this? Are there any tutorials for the same?
Yes, this is possible. Although you might be getting yourself into some headaches. My app kind of goes the other way around, it's mostly phonegap, but occasionally i'll pop open a view that is native. Here is the link to code that shows an excellent example of how to switch between the iOS and phonegap worlds.
new updated recommended article (see update below)
These files represent a standard plugin used in phonegap. In this particular plugin, a native view is opened on top of a phonegap view. Notice you have a custom xib and everything. This plugin can be modified to display any xib with any functionality you could think of.
If you implement this plugin you will easily see how to jump back and forth. I've successfully heavily modified these classes to add LOTS of native capabilities to my phonegap project. Also you should probably check out the official phonegap guide to phonegap plugins. Here
Important Edit
Was informed original linkwas broken (not terribly surprised as this answer is very old and i've long since moved away from Phonegap) so I replaced the original link with an article that shows how to do these plugins well. In the article it explains the link is broken and gives several links where these older files are maintained, but in fact those are broken as well. Here is a branch of one of them I found that still hosts the original files on an "archive" branch. But I haven't investigated whether these files are wildly different from my original work. Good luck!
That's not how Phonegap is meant to be used.
To achieve what you are asking for you just need to create a Phonegap app and add the extra native functionality by writing a Phonegap plugin in Objective-C. You may add as much native code as you want.
I'm actually wanting to do the same thing as the original poster. Theoretically it would be comparatively easy, but non-trival to do. I'd love it if there was a PhoneGapView that one could integrate into an existing project. Bonus points if said PhoneGapView could be integrated in Interface Builder as a re-sizeable and re-positional object, basically think of it as an Object that extends UIWebView.
This is wishful thinking on my part seeing as this is how the higher-ups want my project.

Resources