Struggling between native and phonegap, simple app

2019-01-08 04:02发布

I'm going to make a native (meaning; not in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c.

The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to handle some of the application specific Facebook-friend relations. Like the highscores in a game, for example - stuff like that.

I'm a web-developer, and don't know neither java or objective-c, yet. I've never used Phonegap before, so I don't know if it's capable of fulfilling my requirements.

So my question is as follows; Can I use Phonegap for my app, or do I need to dive into a new language?

10条回答
我命由我不由天
2楼-- · 2019-01-08 04:24

I also find a every good article here http://www.comentum.com/phonegap-vs-native-app-development.html, it compares these two ways in different categories.

The summary is as below:

  1. Design of Interfaces (Same)
  2. Cost (Hybrid has Advantage)
  3. Development Timeline (Hybrid has Advantage)
  4. User Experience and Performance (Native has Advantage)
  5. Maintainability (Same)
  6. No Limitations (Native has Advantage)
  7. Security (Same)
  8. Support and Resources (Native has Advantage)
  9. Tools and Debugging (Native has Advantage)
  10. Platform Independent (Hybrid has Advantage)
  11. Popularity (Same)
查看更多
霸刀☆藐视天下
3楼-- · 2019-01-08 04:30

There's also AppGyver Steroids that unites PhoneGap and Native UI very well.

With Steroids you can add things like native tabs, native navigation bar, native animations and transitions, native modal windows, native drawer/panel (facebooks side menu) etc. to your PhoneGap app. Basically, anywhere CSS + JS don't cut it, Steroids reaches into the native layer to perform the action.

Also, with steroids, you can (although you don't have to) use multi-page architecture (multiple webviews) rather than single. With single page apps, all things like transitions are just CSS workarounds, and as Mani said, even modern tablets and phones aren't fast enough to make them smooth. It's always obvious when it's a phonegap app, especially when you've got a bunch of processes going, or if you're scrolling since JS processes are haulted (being fixed in iOS 8).

Using the multi-page architecture means you get 100% native performance (because those parts actually are native). And unlike phonegap, you'll get consistent user interface behavior and easier debugging (with a single page app, it's often difficult to recreate a particular state in your app). Multi page makes it far easier to develop and maintain your apps since your codebase stays cleaner.

Check the demo: http://youtu.be/oXWwDMdoTCk?t=20m17s

查看更多
孤傲高冷的网名
4楼-- · 2019-01-08 04:30

One overlooked of the great options here is development with Xamarin.

Though it doesn't help to utilize OP's web developer skills, it has many pros compared to PhoneGap and almost no cons.

Xamarin vs PhoneGap Pros:

  • Mature framework providing access to the most (if not all) native features of mobile devices.
  • Learn only one language (C# for the most developers) for all mobile platforms.
  • Have a performance of native apps on iOS/Windows Mobile (since app is compiled into the native code) and very close one on Android (it still compiles to a native APK, but has to have a thin wrapper that translates .NET class library API into Android classes API at the runtime).
  • Maintained by Microsoft which supports the overall generous quality of the platform itself and development tools. For instance, you will use Visual Studio and it's probably the best IDE around and now has free Community edition with every feature available that you'll need for Xamarin development.

Xamarin vs PhoneGap Cons:

  • Needs some time investments for pure web developers to switch to C# and Xamarin class library API.

Therefore, Xamarin is a very solid option for cross-platform development nowadays.

查看更多
何必那么认真
5楼-- · 2019-01-08 04:34

Last I looked into it PhoneGap was all html,css, and javascript. So, you may feel right at home. PhoneGap can handle GPS location, see this article from PhoneGap's documentation. Whether or not you want to pick up Objective C would depend on how fast you pick up new languages as it is a bit of a departure from web development.

查看更多
成全新的幸福
6楼-- · 2019-01-08 04:38

@Gajotres wrote a great response, but hybrid app performance has come a long way since 2012. I answered a related question that covers the difference between hybrid and native app development in 2017.

The moral of the story is that hybrid app development has improved tremendously in the past few years, but it still cannot match native for certain use cases.

With tools like Ionic (first released in 2013) and React Native (first released in 2015) it is easier than ever to build hybrid apps with native-like components. Hybrid apps are now faster, less buggy, and able to interact more deeply with the native UI.

The threshold for hybrid app performance is substantially higher than just a few years ago, but there is still a point at which you may need to develop your app in a native language.

Original Answer:

Yes, the general sentiment is that Hybrid apps are inferior to Native apps. While this can be frustrating for developers more familiar with web technologies, it does come for good reason:

  1. Inability to interact with native components: Although plugins such as cordova-plugin-statusbar exist, there are limitations interacting with and manipulating native components using web technologies. One great (and frustrating) issue I have personally run into is the inability to have an input at the top of they keyboard as the keyboard animates in. This sounds like a nonissue until you look at an app where this is an essential feature such as in a chat app like Slack.
  2. 300ms delay: Although modern browsers are beginning to phase this out, the fraction of a second delay present on Hybrid apps makes the app feel slow and non-native. This issue is becoming less of a factor as more users adopt workarounds such as FastClick.js and some frameworks such as Ionic eliminate it by default.
  3. The haters are right (sort of): While Hybrid app development has come a long way, there are still minor glitches and laggy functions that are just not present in a Native app. Screen transitions, app switching, and battery life are still common areas for bugs to appear and likely will be for some time, even if they are starting to become less and less noticeable.
  4. There are some great Native solutions: With newer languages such as Apple's Swift it is becoming easier to code in a Native language. That being said, tools such as React Native fall into a gray area between Native and Hybrid by allowing developers to code in friendly technologies such as JavaScript but compile into native code.

The moral of the story is that it really depends what is important to your specific use case. Hybrid apps have become a viable option and are no longer an embarrassing side show. Conversely, there are still minor aspects of interacting with the Native UX that are not yet possible except with a Native app.

Overall, I recommend mapping out your project and determining if your app needs any of the benefits of a Native app. With tools such as Ionic View app it is easy to put together a basic mockup of your app and test on a real device whether or not a Hybrid app will work for you.

查看更多
该账号已被封号
7楼-- · 2019-01-08 04:41

Related:

Larger version of this article can also be found HERE, to be transparent it is my personal blog.

Hybrid vs Native apps

Hybrid apps:

Pro:

  • Quicker development, especially if you're a a longtime web developer.
  • 1 language can be used on every available platform. This, of course, requires a Phonegap wrapper. You don't need to learn Objective C, Java, or C# to do any development. You need only to understand the basics of the Phonegap implementation. You will need to play with above-mentioned languages a bit but you don't need to understand them.
  • Phonegap can offer some native capabilities like iOS native tab bar or Android native tab bar and so much more.
  • Lower budget costs and a huge community of supporters and developers.
  • A hybrid app offers many of the advantages of both approaches access to the most common device APIs, and broad device coverage while not requiring the specialized skills, bigger budgets and longer time to market that are more typical of fully native apps.

Cons:

  • You will piss blood after some time, literally and metaphorically.
  • Mobile phones (even today's tablets) are not fast enough to smoothly run a hybrid app, mobile JavaScript capabilities are bed at best. Android platform is a nightmare, page transitions don't work smoothly not to mention lacking CSS/CSS3 implementation. If you think native Android 2.X and 4.X have differences take a look a Android 2.X bad JavaScript / CSS implementation. iOS fares better but still has a lacking CSS3 implementation thou much better page transitions. To make this short native apps will always have a better user experience and general feeling.
  • You will spend much more time fixing the app then building it. Creating an app for each and every platform is a pain in the neck. Browsers on different platforms do not uniformly support all the latest HTML features and APIs, which can make developing and testing a challenge.
  • If you don't have a good designer, don't even try to build an app; looks are everything.
  • If you don't know what are you doing there's a good chance your app will not get permission for Apple app store. Even Google Play Store will ban your app if they discover a 3rd party Phonegap PayPal plugin.

Native apps:

Pro:

  • A native mobile app can produce the best user experience — fast and fluid, can give you the best access to device features, and can be discovered in the app stores.
  • Without a doubt, native apps have full access to the underlying mobile platform. Native apps are usually very fast and polished, making them great for high performance apps or games. This is more then enough.

Cons:

  • Bigger budget, you will need at least a person/s with Java and Objective C knowledge, even C# if you want a Windows mobile app. Yes you can learn it yourself but don't live under the illusion you will do so in a short time. If you have never done any development, choose Objective C (iOS is still a better platform). In other cases choose Java. Java has a syntax similar to other available languages, so it is easy to jump from C# to Java and vice-versa. Objective C is a world of it own. It has a rather uncommon syntax.
  • It might take you a longer period of time to develop all of them and time is money. This depends on the complexity of the apps.

In your case, if you have a good web development/design skills and/or have a good designer you should choose a hybrid app. Go native only if this app is going to be a complex one. Everything you want can be done with a hybrid app. And you will find a great and supporting community.

Hybrid apps

What I didn't previously mentioned you need to be specially careful here. Even if you are seasoned developer you will find a lot of problems you can't solve. Hybrid development should not be mistaken for a basic web development.

Every mobile platform has its own set of problems, not to mention that mobile phones behave differently depending on a device. If possible always create a app that works on a slower devices because native app will successfully work on almost any device.

There's one last thing, when creating hybrid apps, app development will take you about 30%-50% of your time, rest goes to specific platform debugging and learning. Believe me, even after several years of mobile development sometimes I am facing problems I can't solve alone or fast enough.

So be careful when choosing mobile framework, pick 2-3 and spend several days reading about them.

Links

Here are few links to help you decide:

PhoneGap + jQuery Mobile 1.4 tutorial - This is a step by step tutorial for PhoneGap and last version of jQuery Mobile

PhoneGap + jQuery Mobile 1.4 tutorial - MacOS version - This is a step by step tutorial for PhoneGap deployment on MacOS. jQuery Mobile part is covered in a previous article, no point in repeating things.

jQuery Mobile vs Sencha Touch - jQuery Mobile Sencha Touch comparison

jQuery Mobile vs Kendo UI - jQuery Mobile Kendo UI comparison

7 best known HTML5 mobile frameworks - Name tells everything

7 less known HTML5 mobile frameworks - Name tells everything

查看更多
登录 后发表回答