Skip to main content

Cordova, db tips and where to start


Cordova is used to build hybrid applications, it uses a set of build tools to create native language output(apache ant, xcode, java etc.). Code once, deploy to many. There are so many articles out there on both sides of the argument, should I build native or hybrid.
Going native will have the drawback of having to almost completely rewrite for each OS, the obvious result will be longer dev time.
Hybrid will have loads more configuration and tweaking but can cut dev time by a lot.
For an absolute beginner I would suggest heading over to telerik and checking out there online hybrid builder. It's really easy to use, has a ton of great working examples and comes with a 30 day evaluation with full access to all of their services.
They also support and promote the new nativescript language which I think is something to consider, still young but looks amazing.
Plus their VisualStudio App builder plugin is really something special, and I would buy their service just for this great building tool alone.
So take some time and think on these...
  • Decide what your application's needs are
  • Decide what frameworks best solves your application needs
  • Do research on how these frameworks integrate and compliment each other
Determine what frameworks you will be using with cordova, for instance if you are going to use ionic I suggest looking at Angular + firebase.
If you're trying to keep it clean, or using JQuery then you should start looking at yourweb storage solutions (localstorage, sqlite, webdb).
But with all of these you will probably end up having to use some sort of middleware likeNode + Express to build a RESTful API. It's never a bad idea to learn RESTful structure, as in my opinion this will just increase in importance as javascript becomes the preference for web applications and integration of new and old services.
There are also nosql DBs like MongoDB or Couch/pouchDB (Apache) If you are heading in the MeteorJS direction you will be using MongoDB, were as Couch/Pouch seem to be where real time sync storage is heading. Both have tons of great tutorials and functional material out there.
I also found some great frameworks like localForage that makes using localstorage incredible easy and gives you callbacks on stored data. The main planning point around local storage is that no one browser or device has a set storage size, but there are ways to determine size and availability.
These are just some of the things that I had to work with to get cordova applications up and running that integrates with Web APIs.
  1. If it complicates things, you probably don't need it.
  2. Modular is always better.
  3. And always, always, always check for device ready before you load anything else.
  1. document.addEventListener("deviceready", onDeviceReady, false);
  2. function onDeviceReady() {
  3. // Now safe to use device APIs
  4. }
I hope this helps, happy coding.

If you need help setting up your development environment check out this post.

Comments

Popular posts from this blog

Review : The new Pushtape Installation profile for Drupal 7 - Yay or nay?

AuthorRank: Google Have you heard of Pushtape?  Don't worry me neither.  But after this blog post we will definitely be sure if its a Drupal yay or nay.  The reason I chose this Installation profile as the theme for my post is simple, to make sites for bands in your community is an easy way to get your foot in the web development scene if you are just starting out.  All band sites basically works in the same way which means that you can just duplicate your site structure every time. OK so here we go. Pushtape is a new Installation Profile for Drupal 7 that focuses on musicians, it comes supplied with a discography framework, you can very easily post new events like shows, there is a custom photo gallery where you can upload multiple photos as a set and of course a nice looking news type blog for all those quick updates. The installation was really easy, clean, very well customized and quick. I use WebMatr...

Application development environment setup

Setup for application development right click and save images for bigger version Installing Java JAVA JDK Download In my experience I have found that starting your enviroment setup with java is best. In the system variables I made a new variable called it JAVA_HOME , and I set the value to: C:\Program Files\Java\jdk1.7.0_79 . After that, I edited PATH , which is also in the system variables and I added : ;%JAVA_HOME%\bin . In command prompt enter javac -version, if you see a return message javac 1.7.0_79 or something similar you can continue, I cant tell you how important it is to get this right, just know that things will go wrong at unexpected times. Installing Android SDK ANDROID SDK download List item In the system variables I made a new variable called it ANDROID_HOME , and I set the value to: C:\Program Files (x86)\Android\android-sdk . After that, I edited path , which is also in the system variables and I added : %ANDROID_HOME/tools% %ANDROID_HOM...