Android / iOS app with Django as backend

I have a website project built in Django and want to create a mobile app for it. I've done a lot of research but was confused between native

and the hybrid

app. My project is a Quora clone and just a college project. I also saw PhoneGap

, Ionic

and Sencha

, but I'm really confused by how they all fit. Should I be using Ionic

with PhoneGap

or Apache Cordova or just Ionic

? What is the structure and where to start?

+3


source to share


2 answers


TL; DR : Start with Ionic . Ionic uses Cordoba "under the hood". No need for PhoneGap or Sencha, so don't get confused.

Disclaimer: This will sound like an advertisement, so I have to say that I am in no way affiliated with Ionic, I just love it so much that I share the love for it.

Let's do it step by step:

What is Ionic?

Ionic is the foundation for building hybrid mobile apps, and it is built on an ecosystem that includes Angular as the backbone of web applications and uses Cordova to build and package its own application. Ionic builds a native mobile app that can be installed via app stores and contains what is called a WebView (essentially a sandboxed browser window) with a JavaScript API within which the web app will run.

What is a hybrid mobile app?

If you are a web developer, you have a decent knowledge of HTML, CSS, and JavaScript. Also, you are most likely using one of the few popular frameworks these days like AngularJS. Until recently, if you wanted to make an app for (currently) the two most popular mobile operating systems iOS and Android, your only bet was to make so-called native apps using the SDK on the intended platform yourself. This, of course, meant that you had to make two versions of your application - both for iOS and Android. If you are a solo developer, the chances of owning them are not that high.



Nowadays, thankfully, with the Ionic Framework, you can build a single app using the skills you already have as a web developer and then deploy that codebase as an app for the iOS and Android stores. How cool, huh? So, a hybrid, because it is a "simple" web application wrapped in its own application with a so called WebView.

Why Ionic class?

Ionic is awesome because it is not "just" a framework. Instead, it has an entire ecosystem built around it. For example, Ionic allows you to:

  • create icons and screensavers for all devices and the size of the device with a single command: ionic resources

    . This alone saves you at least a day of preparing the image for different sizes.
  • update your apps instantly with code changes, even if you launch directly on your device with ionic run --livereload

  • Build and test iOS and Android versions side by side and see changes instantly with ionic serve --lab

  • share your apps with Ionic apps with clients, clients and testers around the world without going through the App Store with ionic share

  • it's easy to access the full built-in device functionality using ngCordova (you can use any Cordova plugin here - so there is really a lot more ionic than Cordova itself).
  • In addition, they (the Ionic team) create full-screen backend services and tools for your Ionic app like Deploy (to deploy a new version without going through Apple's analysis process!), Analytics , Push notifications .
  • The Ionic CLI (Command Line Interface) uses Cordova in the backend and allows you to build (directly using the Ionic CLI) iOS and Android apps (you do ionic build ios

    or ionic build android

    and woila)
  • Ionic uses Angular as its frontend framework, so if you're familiar with it, it will be a bonus. They work closely with the Angular 2.0 team .

How to start your project?

If you look at my answer to this question , you can see that if you already have an API defined in your Django backend, you can start using that pretty quickly by using your existing API and consuming it with Angular $ resource .

Hope this helps and you find fun with Ionic.

+9


source


Please note that mobile apps are also clients like the web browser. You can think of mobile apps as specialized browsers for specific websites / web APIs, or what you might call endpoints.

Clients talk to the server to request some resource and, if available, the server responds. How the response is handled by the client is where it starts to get confused because regardless of the server's response, it can be manipulated / presented in some way as being programmed in the client for the actual user.

As with a web browser, if you request HTML content, you end up with a nice web page with buttons and possibly animation, etc. You can also request the same content using the console terminal, but all you probably get is an ugly blob of HTML flooding your terminal. What for? Since the client, which is the console terminal, is not designed to render HTML, while the web browser.



Now for mobile apps: native mobile apps do not render HTML. These apps have their own interface already written in some other language like Java or Obj-C, but it can still request and process content from the web API (JSON, XML, etc.) to fill in the fields in the UI or show / hide depending on your access level.

I can't comment much on the specifics of mashups, so others are free to clear up any misconceptions. 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 interact with the hardware. As far as my opinion goes, 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 interact with. PhoneGap, Ionic and Sencha are mobile development platforms that can be used to build these mobile apps.

+5


source







All Articles