I have a website project built in Django and want to build a mobile app for it. I did a lot of research but was confused between native
and hybrid
app. My project is basically a Quora clone and just a college project. I also saw PhoneGap
, Ionic
and Sencha
but I am really confused about how they all fit. Do I have to use Ionic
with PhoneGap
or Apache Cordova or just Ionic
? What is the structure and where should I start?
相关问题
- Plugin with id 'com.google.gms.google-services
- Should I use CSS3 media queries to deliver differe
- How to pass form data from Ionic 3 to PHP file?
- apk big size with ionic 4 build
- Ionic Spinner not showing up
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Ionic 4: Hardware Back Button Reloading Applicatio
- Phonegap - Error - Keystore alias not recognized
- Can't use serve with Cordova / Phonegap hellow
- ionic - Copy/paste in input field in iOS 10 not wo
- PhoneGap iOS 7 and localStorage
- deviceready not firing in cordova
- net::ERR_CONNECTION_REFUSED ionic
TL;DR: Start with Ionic. Ionic uses Cordova "under the hood". No need for PhoneGap or Sencha, so don't be confused by that.
Disclaimer: This will sound like advertisement, so I have to say I'm in no way affiliated with Ionic, I just happen to like it so much that I'm sharing the love for it.
Let's take this one step by step:
What is Ionic?
Ionic is a framework for building hybrid mobile apps, and it's built on an ecosystem that includes Angular as the web application framework and uses Cordova for the building and packaging of the native app. Ionic creates a native mobile app that can be installed via the app stores, and contains what is called a WebView (essentially an isolated browser window) with a JavaScript API inside which the web application will run.
What is hybrid mobile app?
If you're a web developer, you have a decent knowledge of HTML, CSS and JavaScript. Also, you're most likely using one of the ever so slightly popular frameworks these days like AngularJS. Up until fairly recently if you wanted to make an app for (currently) two most popular mobile operating systems iOS and Android your only bet was to make the so-called native applications using the SDKs of the intended platform itself. This, of course, meant that you needed to make two versions of your application - both for iOS and Android. If you are a solo developer chances that you're proficient in both are not so high.
Nowadays, luckily, with the Ionic Framework you can create one application by using the skills you already have as a web developer and then deploy this one codebase as an app to both iOS and Android stores. How cool is that, right? So, hybrid because it's a "simple" web app wrapped inside the native app with a so-called WebView.
Why is Ionic cool?
Ionic is awesome because it's not "just" a framework. Instead, it has a whole ecosystem built around it. For example, Ionic allows you to:
ionic resources
. This alone saves you at least a day of image preparing for various sizes.ionic run --livereload
ionic serve --lab
ionic share
ionic build ios
orionic build android
and woila)How to start your project?
If you take a look at my answer to this question you'll see that if you already have an API defined in your Django backend, then you can start using it quite quickly by leveraging the existing API and consuming it with Angular $resource.
Hope this helps and that you find using Ionic a pleasure.
Take note that mobile apps are also clients just like a web browser. You can think of mobile apps as specialized browsers for particular websites/web APIs or what you can call endpoints.
Clients communicate with a server to request some resource, and if available, the server responds. How the response is treated by the client is where it begins to get messy, because whatever the response the server gave, it can be manipulated/presented in any way as programmed in the client to the actual human user.
Like in a web browser, if you request HTML content, then you get a nice webpage with buttons and probably animation and stuff. You can also request the same content using a console terminal, but all you will probably get is an ugly blob of HTML flooding your terminal. Why? Because the client that is the console terminal is not designed to render HTML, while a web browser is.
Now for mobile apps: Native mobile apps do not render HTML. These kinds of apps have their UI already written in some other language like Java or Obj-C, but it can still request and process content from a Web API (JSON, XML, etc) in order to populate fields in its UI or to show/hide buttons depending on your access level.
I cannot comment much on the specifics of hybrid apps, so others may feel free to clear up any misconceptions as well. Hybrid apps can render HTML in some parts of the app, while retaining that native aspect in some other parts of the app so that the app can interface with hardware. As far as my opinion is concerned, a hybrid mobile app is just a native app with a browser-ish interface wrapped inside.
Django is just a web framework that you can use to write websites or web APIs that your mobile app can communicate with. PhoneGap, Ionic and Sencha are mobile development frameworks that can be used to create those mobile apps.