Trimming Phonegap when not using any native features, is it possible? - iphone

I'm developing a simple lightweight webbapp which I intend to wrap as a Phonegap app for iPhone and possibly Android.
The thing is, I don't actually use ANY of the native features available via Phonegap, such as the camera or GPS. Do you know any ways for me to trim Phonegap so that I can have an app which is as light-weight and fast as possible?
For example, can I trim or even leave out phonegap.js? Any objecive-c code or resources that can be dropped?
Alternatively, does anyone know of some other bare bones webview wrapper which is lighter than Phonegap to begin with?
Thanks

Yes, it's possible. You likely can leave out phonegap.js, or at least substantially trim it.
PhoneGap provides two distinct sets of capabilities:
Provide a set of JavaScript APIs to access native capabilities
Wrap a set of HTML assets into a native application
For Android, #2 is completely implemented in phonegap.jar. #1 requires the addition of phonegap.js. Thus if you don't need the APIs, you don't need phonegap.js. I haven't tested on IOS, but would expect it to be a similar story.

Related

Can a native ipad app written in HTML5+Javascript+CSS accomplish the same things as one written in objective C

I would like to build an iphone/ipad app that has social networking capabilities and the ability to sell magazines and specific articles. I would also like this app to be able to be as flexible as possible for future features.
Should I insist the developer use objective C or could he accomplish the same thing with HTML5 etc..
If you're the client, and have specific technical requirements, you should document them from a technical POV. If not, well that's why you're hiring a developer--for their expertise.
There's pros and cons to each and we'd need to have a lot more project details to be of any specific help for you.
Do note that selling items via an app has its own set of red tape political issues with Apple. You may want to tackle that aspect of the project first. If you don't want to route any payments through Apple so they can take their cut, then you might want to rethink the app model and consider a mobile web site avenue instead.
UPDATE:
In general, here's some high-level comparisons:
Native Apps:
Pros
can access native device functionality directly
can leverage the native UI more directly
can be much more performant in situations like heavy game animation, 3-d, image/video editing, ec.
may be smaller file sizes
Cons
have to be written per-device
different devices use different native IDEs and Languages
HTML5/Phonegap apps
can be written with cross-platform Web standards
can still leverage native device features to an extent
are easier to port from device to device (though still takes effort)
Cons
you won't be creating graphic-heavy game-type apps with it now
may be a bit slower than a native app
Pure HTML5 local web app
This is different than something like a phonegap solution. PhoneGap takes HTML5 and compiles it into native code. That means you can send it through the app store. There's another option, however, where you put the HTML5 app on your web server, and then a user requests to keep it locally on their device. The advantage is that this allows you to bypass the app store completely (though in most situations, people prefer to go through the app store)
I would say, "no", you shouldn't insist the developer use Objective-C. At least not unless other requirements not mentioned dictate the need for a native app. As DA mentioned, there are App Store policies that would need to be complied with for native apps that can be avoided by creating a web app. Also, if you choose, it would be easier to produce a web app that could be used across other platforms rather than being restricted to the iPad.

Crossplatform framework is suitable to do all things in Mobile Application as Native?

I am working in iPhone SDK.I have to convert from it to Crossplatform which may be either phonegap or titanium.As a iPhone Native application developer, I have some questions based on cross paltform.please consider the questions for other platforms android,etc also.I have already seen the stackoverflow Link.
1)Is it possible to get equal functionalities of all APIs which are in iPhone SDK through HTML5 and javascript?
2)If Apple releases New Version of iPhone SDK,will New APIs be included ASAP in Crossplatform?
3)If The App crashes in some situation, can I fix immediately through Device Debugging as we do in native Language?
4)The applications developed by Cross platform will be approved by Apple legaly?For example If i want to do live streaming in iphone , The restrictions have mentioned in Apple website.has it been followed by crossplatform?
5)will Application developed by cross platform take more memory?I mention the size of device build for appstore?If we develop the same through objective C,will size be reduced?
***My Conclusion is When we want to develop simple Applications for Multiple devices,crossplatform is suitable.Am I right?***I hope doing through native language(iphonensdk, Android) will avoid lot of Unnecessary things.
No.
If the API can be made available, it depends on how fast the creators of the framework implement it.
In principle, yes, as those frameworks employ a limited amount of OS capabilities to run web-technology (in most cases). This "wrapper" behaves as any native app does. For the content however the rules of the frameworks development language apply. It may be harder compared to native development to track down errors, since they must "pass the shell". Html errors for example may produce the same error for their enclosing webview again and again, despite being different in origin.
Propably.
That's hard to tell. It may depend on the framework. I wouldn't worry about the code as other ressources like imagery are usually the heavier load. But it may be very well the case that those frameworks bring along imagery necessary for their UI elements, since they do not rely on OS elements entirely. Compared to a native app which comes with no extra ressources at all, a crossplatform app with the same functionality might take more memory.
As to your conclusion: You're right. However I'd still encourage anyone to develop native applications whenever possible. Crossplatform frameworks tend to be slower at runtime and, in some cases, produce very ugly apps. I know several examples of apps which have been created with a variety of crossplatforms and I don't like any of them. They just don't feel right. Partly that's due to their UI elements which don't look and feel as you'd expect it on the platform you're on.
The principle behind crossplatform frameworks may appear to be logical, tempting and in some cases, straight economics mandate their use. But, for the time being, I find the results far from being satisfactory and for that reason would never touch a crossplatform framework.
In my experience (with a closed, private, expensive x-platform thing purchased by the employer), it was utterly frustrating, and incredibly difficult. Therefore, it is my preference to maintain multiple native apps.
The UI considerations that can be made/handled by the native app, as well as the functionality and speed gained by doing it natively, IMHO, far outweigh the benefit of having to write it 2 or 3 times.
In an ideal world, you would have a specialist for each platform that can lead the team on the "deep" things, and then everyone can generalize for all of the platforms, increasing their depth through the course of the project.

Multi-Mobile Device Application Architecture

I'm considering building an application for Windows Phone 7, Android, iphone, ipad, and potentially more. Since i'm going to be leveraging a similar look and feel and content, it seems to me like it might be worthwhile to try to create a common base structure that I could reuse across environments.
For instance, i could define the structure of the UI using XML or something, or utilize some common construction of the application which I could build a translator to gen the code in other environments, or even something else. I'm in the very, very beginning stages of thought, and was wondering if anyone has tried this and come up with a good approach? Any ideas?
Thanks.
Beyond simple applications, it not going to happen.
The are a number of problems you will face like:
Different native programming languages on different mobile platforms.
Different UI paradigms on the different mobile platforms.
Very different screen sizes even on the same mobile platform (e.g. iphone vs ipad).
UI Localisation
To really take advantage of each mobile platform, you need to build the UI for that platform to maximise it's UI paradigm. It also matters what screen sizes you want to support, catering for small screen sizes can hamstring you in what you can display in the UI unless you build different screen layout for different screen sizes to give a better UI experience (a lot of work). This can be a big problem on one platform let alone expanding it to other platforms.
For the platforms listed, you can try using mono, but that will only help in the following ways:
One programming language (C#) instead of a different language per platform.
Application engine logic can be shared between platforms.
Native UI per application.
The cons of using mono would be:
You still need to write the UI layer per platform as mono binds to the underlying UI api.
Mono runtime overhead in size and sometimes speed.
Mono on the mobile platforms are still new, I have developed one iphone application in monotouch and I found lots of first-release type problems with it.
If you don't mind some of the con's then mono can be a great platform for developing certain levels of applications.
I have found that trying to define a master UI layout just doesn't work in all situations in any application that gets to complex in the information it needs to display to the user. No matter how "complex" you can define the layout, something will break it. You either have to live with a "bad" UI in some cases or have a maintenance overhead.
I like to develop an application for the mobile platform to try can get the most out of that platform and it's features. This may mean that other platform versions of the app may work differently but at least it will feel correct on that platform.
There are some x-platform kits: appcelerator, phonegap, etc. Or you could go the hybrid route and use something like mono as a half measure, then there is the possibility of building a web app with html5.
I wouldn't try to roll my own, that's for sure
Be careful when translating iPad to Android designs. Hopefully this article can help you out:
http://morriscodes.blogspot.com/2012/09/designing-for-android-tablets-vs-ipad.html

How can I code an efficient mobile site like gmail's?

My web site has a different mobile version that's suited for iPhone/Android devices. The problem, however, seems to be in the site's performance. It's really slow and heavy, even though I'm not loading any images.
On the other hand, when I use Gmail's or YouTube's mobile version, they're so fast they almost perform like a native mobile application.
How do they do that?
Your help is much appreciated :)
See my comment. Also, if the slowness you perceive is when interacting with the site it could be that it lacks the ability to accept touch events. On mobile web, if you have not wired up the UI for js touch events the experience will seem slower because the device browser has to fall back to standard click and other mouseevents which are not optimal. Frameworks such as mootools and jquerymobile/jqtouch have these events baked in. Take a look at the mootools solution which has quite a good write up: http://davidwalsh.name/mootools-touch
They probably making use of local storage http://dev.w3.org/html5/webstorage/
Are your pages too large? Try to use gzip and/or reduce output
Your server's connection speed may also be responsible of slowness
Well, You don't need to include any javascript framework to make it fast clickable.
By implementing some JavaScript you can achieve that. Google has released a solution for that
https://developers.google.com/mobile/articles/fast_buttons
This will allow visitor to interact with application native way. From Android 4 (as far as I remember) version by setting viewport meta tag the browser will automatically apply the fast click functionality.
For the animation issue always use Hardware accelerated animation with a fall back for older mobile browser. Using hardware accelerated animation it will make your application smooth as silk.
Follow this guideline and you can make your application as fast as gmail / youtube mobile version.
http://www.html5rocks.com/en/tutorials/speed/html5/
Best of luck.
Your webapp is consuming too much RAM. Don't use so many libraries and don't attach so many event handlers.

Native app for iPhone!

I want to develop a native universal app(i.e for iPhone and iPad) for my orgaization.I want to include some of the essential features of the organiztion website into my native app.For obvious reasons i cant store this huge data into iPhone itself.so data will be fetched from the server but application would be a native app.so are there any APIs available to do this?
I always find it's easier to start using sample code, and lucky for you Apple provides a lot of this. Here is the reference library for all kinds of goodies to learn off of and hack your way through: http://developer.apple.com/iphone/library/navigation/index.html#section=Resource%20Types&topic=Sample%20Code
A few noted ones... (I left out some advanced ones like BonjourWeb Reachability and AdvancedURLConnections but look at those once you gain a little more understanding)
URL Cache: http://developer.apple.com/iphone/library/samplecode/URLCache/Introduction/Intro.html
RSS Feed Parser: http://developer.apple.com/iphone/library/samplecode/SeismicXML/Introduction/Intro.html
MailComposer: http://developer.apple.com/iphone/library/samplecode/MailComposer/Introduction/Intro.html
Also, a couple books you should get to start your journey on iOS (these are two of the best and easy to understand IMO):
http://apress.com/book/view/9781430224594
http://apress.com/book/view/9781430225058
UIWebView will show any web page you point it to.
Maybe do a mixed approach with some stuff built right into the app, and the bigger or frequently changing parts load from the web.
You can use the UIWebView to access your organization's website from inside a native application...
While I agree that you may need to do your research first, the IPhone/Ipad SDK includes a very easy to use XML parser (NSXMLParser). I would suggest you devise a XML web service for retrieving the data from your company's servers and parse it on the ipad/iphone to the presentation you require.
Best of luck, i've found objective-c very rewarding/challenging.