네이티브와 폰갭 사이의 어려움, 간단한 앱 요구 사항
기본 ( 브라우저가 아닌 ) 모바일 앱을 만들 것입니다. 저는 웹 개발자이기 때문에 Phonegap을 사용해 볼 것인지 아니면 Java 또는 Objective-C로 네이티브 앱을 빌드해야하는지 결정하는 데 어려움을 겪고 있습니다.
앱 요구 사항은 간단합니다. GPS / wifi 위치, Facebook 통합 및 애플리케이션 특정 Facebook 친구 관계를 처리하려면 데이터베이스가 필요합니다. 예를 들어 게임의 최고 점수처럼.
저는 웹 개발자이고 아직 Java 나 Objective-C를 모릅니다. 나는 전에 Phonegap을 사용한 적이 없기 때문에 그것이 내 요구 사항을 충족시킬 수 있는지 모르겠습니다.
그래서 내 질문은 다음과 같습니다. 내 앱에 Phonegap을 사용할 수 있습니까? 아니면 새로운 언어를 사용해야합니까?
관련 :
이 기사의 더 큰 버전은 여기 에서 찾을 수 있습니다. 투명하게하기 위해 내 개인 블로그입니다.
하이브리드 vs 네이티브 앱
하이브리드 앱 :
찬성:
- 특히 오랜 웹 개발자 인 경우 더 빠른 개발.
- 사용 가능한 모든 플랫폼에서 하나의 언어를 사용할 수 있습니다. 물론 이것은 Phonegap 래퍼가 필요합니다. 개발을 위해 Objective C, Java 또는 C #을 배울 필요가 없습니다. Phonegap 구현의 기본 사항 만 이해하면됩니다. 위에서 언급 한 언어를 조금 가지고 놀아야하지만 이해할 필요는 없습니다.
- Phonegap은 iOS 기본 탭 표시 줄 또는 Android 기본 탭 표시 줄 등과 같은 일부 기본 기능을 제공 할 수 있습니다.
- 예산 비용을 낮추고 지지자와 개발자로 구성된 거대한 커뮤니티.
- 하이브리드 앱은 가장 일반적인 장치 API에 대한 두 가지 접근 방식의 많은 이점과 광범위한 장치 범위를 제공하는 동시에 완전한 네이티브 앱에 더 일반적인 전문 기술, 더 큰 예산 및 더 긴 시장 출시 시간을 요구하지 않습니다.
단점 :
- 당신은 문자 그대로 그리고 은유 적으로 얼마 후 피를 흘릴 것입니다.
- 휴대폰 (오늘날의 태블릿까지도)은 하이브리드 앱을 원활하게 실행할 수있을만큼 빠르지 않으며 모바일 JavaScript 기능은 기껏해야합니다. Android 플랫폼은 악몽이며 페이지 전환은 CSS / CSS3 구현 부족은 말할 것도없이 원활하게 작동하지 않습니다. 네이티브 Android 2.X 및 4.X에 차이가 있다고 생각하는 경우 Android 2.X 잘못된 JavaScript / CSS 구현을 살펴보십시오. iOS 요금은 더 좋지만 페이지 전환이 훨씬 더 나은 CSS3 구현이 여전히 부족합니다. 이 짧은 네이티브 앱을 만들기 위해 항상 더 나은 사용자 경험과 일반적인 느낌을 갖게됩니다.
- 앱을 수정 한 다음 빌드하는 데 훨씬 더 많은 시간을 할애하게됩니다. 각각의 모든 플랫폼을위한 앱을 만드는 것은 목의 고통입니다. 다른 플랫폼의 브라우저는 모든 최신 HTML 기능과 API를 균일하게 지원하지 않으므로 개발 및 테스트가 어려울 수 있습니다.
- 좋은 디자이너가 없다면 앱을 만들려고하지 마십시오. 외모가 전부입니다.
- 무엇을하는지 모르면 앱이 Apple 앱 스토어에 대한 권한을받지 못할 가능성이 높습니다. Google Play 스토어에서도 타사 Phonegap PayPal 플러그인을 발견하면 앱을 차단합니다.
기본 앱 :
찬성:
- 기본 모바일 앱은 최고의 사용자 경험을 제공 할 수 있습니다. 빠르고 유동적이며 장치 기능에 대한 최상의 액세스를 제공 할 수 있으며 앱 스토어에서 찾을 수 있습니다.
- 의심 할 여지없이 네이티브 앱은 기본 모바일 플랫폼에 대한 전체 액세스 권한을 갖습니다. 기본 앱은 일반적으로 매우 빠르고 세련되어 고성능 앱이나 게임에 적합합니다. 이것으로 충분합니다.
단점 :
- 더 큰 예산, Windows 모바일 앱을 원한다면 C #을 포함하여 Java 및 Objective C 지식을 갖춘 사람이 적어도 필요합니다. 예, 스스로 배울 수는 있지만 짧은 시간에 그렇게 할 것이라는 환상 아래 살지는 마십시오. 개발을 한 적이 없다면 Objective C를 선택하십시오 (iOS는 여전히 더 나은 플랫폼입니다). 다른 경우에는 Java를 선택하십시오. Java에는 사용 가능한 다른 언어와 유사한 구문이 있으므로 C #에서 Java로 또는 그 반대로 쉽게 이동할 수 있습니다. Objective C는 자체 세계입니다. 다소 드문 구문이 있습니다.
- 모든 것을 개발하는 데 더 오랜 시간이 걸릴 수 있으며 시간은 돈입니다. 이것은 앱의 복잡성에 따라 다릅니다.
귀하의 경우 웹 개발 / 디자인 기술이 우수하거나 디자이너가 좋은 경우 하이브리드 앱을 선택해야합니다. 이 앱이 복잡 할 경우에만 네이티브로 전환하세요. 하이브리드 앱으로 원하는 모든 작업을 수행 할 수 있습니다. 그리고 훌륭하고 지원하는 커뮤니티를 찾을 수 있습니다.
하이브리드 앱
내가 이전에 언급하지 않은 것은 여기서 특별히주의해야합니다. 노련한 개발자라도 해결할 수없는 많은 문제를 발견하게 될 것입니다. 하이브리드 개발을 기본 웹 개발로 착각해서는 안됩니다.
모든 모바일 플랫폼에는 장치에 따라 다르게 동작하는 것은 말할 것도없고 고유 한 문제가 있습니다. 기본 앱은 거의 모든 장치에서 성공적으로 작동하므로 가능하면 항상 느린 장치에서 작동하는 앱을 만드십시오.
마지막으로 하이브리드 앱을 만들 때 앱 개발에는 시간의 약 30 % -50 %가 소요되고 나머지는 특정 플랫폼 디버깅 및 학습에 사용된다는 것입니다. 저를 믿으십시오. 수년간의 모바일 개발 후에도 때때로 혼자서 해결할 수 없거나 충분히 빨리 해결할 수없는 문제에 직면하고 있습니다.
따라서 모바일 프레임 워크를 선택할 때주의하고 2-3을 선택하고 며칠 동안 이에 대해 읽으십시오.
연결
다음은 결정에 도움이되는 몇 가지 링크입니다.
PhoneGap + jQuery Mobile 1.4 자습서 -PhoneGap 및 jQuery Mobile의 마지막 버전에 대한 단계별 자습서입니다.
PhoneGap + jQuery Mobile 1.4 자습서-MacOS 버전 -MacOS에서 PhoneGap 배포를위한 단계별 자습서입니다. jQuery Mobile 부분은 이전 기사에서 다루었으며 반복되는 내용은 없습니다.
jQuery Mobile vs Sencha Touch -jQuery Mobile Sencha Touch 비교
jQuery Mobile vs Kendo UI -jQuery Mobile Kendo UI 비교
가장 잘 알려진 7 가지 HTML5 모바일 프레임 워크 -이름이 모든 것을 알려줍니다
덜 알려진 HTML5 모바일 프레임 워크 7 가지 -이름이 모든 것을 알려줍니다
애플리케이션에 애니메이션 효과가없고 단순하다면 웹 (Phonegap) cz에서 더 적은 시간에 생성하는 것을 선호합니다. 여러 유형의 모바일 OS에서 실행할 수 있습니다. 앱에 더 많은 UI 효과와 애니메이션이 포함되어 있다면 네이티브를 사용하는 것이 가장 좋습니다.
웹뷰 (Phonegap)에서 개발하더라도 Android 및 iOS에서 몇 가지 기본 단계를 배워야합니다.
Phonegap이 장치에서 수행하는 방법
Ios ios webview에서 애니메이션 및 뷰로드가 좌초되고 좋으며 애니메이션 효과는 명확하게 관찰 할 수 있습니다
Android
html 코드를 실행하는 동안 Android 용 기기 버전과 기기 회사를 고려해야합니다. Android의 일부 높은 구성 기기는보다 명확하고 효율적인 애니메이션 표시를 제공하지만 일부 기기 (대부분 구 버전 및 일부 회사 기기)는 좋은 애니메이션 효과를 제공하지 못합니다. , 렌더링 효과는 Android의 기기마다 다릅니다.
Phonegap에 대한 겸손한 의견으로는 단순한 앱을 개발할 수 있습니다. 문서는 충분하지 않으며 다른 사람들이 말한 것처럼 앱을 빌드하는 것보다 버그를 수정하고 플러그인을 찾는 데 훨씬 더 많은 시간을 할애 할 것입니다. Android 나 iOS 등 무엇이든 배우기 위해 노력할 것 입니다. 여러분의 시간을 투자 한 것으로 생각합니다. (예, 제 의견은 약간 편향되어 있습니다).
마지막으로 PhoneGap은 모두 html, css 및 javascript였습니다. 따라서 집에서 바로 느낄 수 있습니다. PhoneGap은 GPS 위치를 처리 할 수 있습니다 . PhoneGap 문서에서이 문서를 참조하십시오 . Objective C를 선택하는지 여부는 웹 개발에서 약간의 출발이므로 새로운 언어를 얼마나 빨리 선택하는지에 따라 달라집니다.
그것은 전적으로 귀하의 필요에 달려 있습니다
몇 달 동안 첫 번째 앱 (네이티브 Android, 데이터베이스 기반, 편안한 연결 앱)을 게시 한 후 phonegap을 사용하여 앱을 다시 작성하기로 결정했습니다 (앱을 iOS에 복제하고 싶기 때문에 ObjC에서 수행하는 대신 자바 스크립트를 사용하지 않는 이유 ?)
Android에서 모든 것을 처음부터 배우고 코딩하는 데 3 주가 소요되었습니다. ListAdapter를 내 서버의 Restful Service와 동기화하는 방법, 앱을 테마로 지정하는 방법 (특히 투명, 테두리 등의 특수 효과에 관해서는 제 생각에는 상당히 어렵습니다. ) 및 코드 기반을 효과적으로 구성하는 방법 (Java에 익숙하다면 대부분의 튜토리얼이 작성하는 내용이므로 모든 클래스가 서로 매우 결합되어 있음을 알게 될 것입니다)
When on Phonegap, everything is done in 1 week. Css, html, with onsenui
and angular
make the GUI development just like about 1 st year student 's assignment and theming is just a piece of cake. I don't need to run it on the real device, just use browser during the development, change code and refresh are enough. Angular
provides 2 way binding with the DOM, and this makes a huge awesomeness when collecting and showing data. For example:
<ul ng-each="for sentence in sentences" >
<li>{{ sentence.title }} </li>
</ul>
When the variable sentences
is changed (retrieved from server), the DOM is automatically changed as well. However, javascript is only javascript. I found myself struggling many time when debugging the app, especially when doing the MapReduce functions with PouchDB (big mistake, have to go back to cordova-sqlite-plugin
tonight) and most of the time, I have to read the log in order to figure out the problem (Chrome 's tools and Firebug cannot catch the breakpoint). Also, it is hard to restructure your app (javascript, again) so if you don't organise carefully your code base at the first sign, you might end up with a mess (and debugging is a real pain, again). PhoneGap is also Web based, so sometimes, you will hear that "because on this platform, it does not support that bla bla bla" (e.g, localStorage
) and you have to stand for it if you cannot find any good plugin.
Conclusion Except for the limitation of the web-based storage, PhoneGap works quite well with the database driven, simple GUI app (and most of the database driven apps currently has a simple GUI anyway). If you gonna develop that kind of app, then stick with it
check out using ionic, backed by angular.js to offset some of the cons mentioned in the accepted answer. Tutorial for launching an employee directory app: http://coenraets.org/blog/2014/02/sample-mobile-application-with-ionic-and-angularjs/
@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:
- 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.- 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.
- 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.
- 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.
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
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:
- Design of Interfaces (Same)
- Cost (Hybrid has Advantage)
- Development Timeline (Hybrid has Advantage)
- User Experience and Performance (Native has Advantage)
- Maintainability (Same)
- No Limitations (Native has Advantage)
- Security (Same)
- Support and Resources (Native has Advantage)
- Tools and Debugging (Native has Advantage)
- Platform Independent (Hybrid has Advantage)
- Popularity (Same)
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.
'code' 카테고리의 다른 글
추가 옵션 또는 매개 변수가있는 모카 테스트 (0) | 2020.10.18 |
---|---|
CSS3 Flex : 자식을 오른쪽으로 당기기 (0) | 2020.10.18 |
Java Swing-JScrollPane 사용 및 맨 위로 스크롤 (0) | 2020.10.18 |
PHP read_exif_data 및 방향 조정 (0) | 2020.10.18 |
Java에서 while 루프를 어떻게 종료합니까? (0) | 2020.10.18 |