Sunday, November 30, 2014

Alor Setar Cafe

Just want to keep track of these Cafe in Alor Setar. Wonder how long they will last...

  1. Cube Coffee 
  2. Coffeebooks & Rain 
  3. 1973 Espresso Cafe 
  4. Coffee Lips Cafe 
  5. Parrot Espresso Cafe 
  6. Coffee Diem
  7. Oh Bella Cafe
  8. Coffee D
  9. Bon Bon Ya 
  10. Coffee Lunatic 
  11. Mc Cafe 
  12. Habit Art Cafe 
  13. Bites Cafe & Galary
  14. Le' Medina Patisserie
  15. Secret Recipes 
  16. Coffee Lap
  17. Green Leaf 
  18. Uncle Jonh
  19. Georgetown Cafe 
  20. Oldtown Cafe 
  21. Coffebean ( Coming Soon )
  22. Starbucks ( Coming Soon )
  23. Deco Cafe ( Coming Soon )
  24. Coffee Tiffz Gallery ( Coming Soon )
  25. Paper Plane Cafe ( Coming Soon )
  26. The Hat Cabin ( Coming Soon )
  27. Coffee Lips ( Comimg Soon )

Thursday, November 13, 2014

What did "cordova create" do?

Just for curiosity, I ran this command to find out.

$ cordova create myapp1 com.otccomputing.myapp1 "My App 1"
Creating a new cordova project with name "My App 1" and id "com.otccomputing.myapp1" at location "/Users/guest/apps/myapp1"

And here we go.  I expand all the sub folder in myapp1.

Now let's take a look at those files.

config.xml, used by cordova to do compile/build/plugin whatever task. Without it, it is just not a cordova project anymore.
The content in config.xml is simple and easy to digest. 
id = a unique identity used to identify your app
version = as named. etc. 1.0.0, 2.0.0, 3.0.4...
description: write anything you want
author: change it to your detail - email, website
content: which file cordova will start with - don't change this one.

We now look at index.html

The most important 2 lines are:

cordova.js MUST be there. Otherwise your apps just won't work. I don't know what black magic behind it but - leave it there.
index.js is not that important, your apps may still work if it doesn't exist but lets have a look.

The main thing here is event listening. index.js listen to 'deviceready' event, which is fired by cordova after some backend initialization is ready. You might consider trigger some function in your app AFTER 'deviceready' is triggered or they may not work. Most plugin in GitHub will mention this requirement in their documentation. 
the receivedEvent() implementation can be ignored or you can put in your own login here.

So for development strategy, I usually work on my HTML, JS,CSS in an IDE, test them on the browser, looks good, then move then into the www folder and do further integration. 

Bottom line, as long as config.xml is there, cordova.js in included in your index.html, things will work.