December 20, 2013
@ 12:00 AM
Node.js is javascript running on the server side,  just like powershell, but it can cross platform.
As I understand, it is good for small function service.

it's popular because it have a great library and easy to use.

ref:
http://www.nodebeginner.org/index-zh-cn.html


 
Categories: node.js

Below are my full steps of integrating sqlcipher, openssl with sqlite plugin from a fresh Cordova projects.

1. Create a new cordova project folder

$ Sudo Cordova  create newProjectName

you can update the config.xml for you project name and bindId now. And downalod all pugings include sqlite plugin to plugin folders.

copy you html and js to www folder.

2. Create a new XCode projet for iOs

$ Cordova platform add ios

3. Copy icon files and splash files t  the iOS project resource folder.

4. Copy openssl-Xcode to ios folder

Openssl-xcode project skeleton can be get from:

$git clone https://github.com/sqlcipher/openssl-xcode.git

Make sure there is openssl folder in the openssl-xcode folder

Download openssl

$ curl -o openssl-1.0.0e.tar.gz http://www.openssl.org/source/openssl-1.0.0e.tar.gz

Upzip it to Openssl-xcode project folder and rename openssl-1.0.0e to openssl

5 copy sqlCipher folder to ios folder. sqlcipher can be get from

$ git clone https://github.com/sqlcipher/sqlcipher.git

6.  Open project, remove SqlitePlugin.m     and SqlitePlugin.h references
Go to Project Targets, in Build Phase tab, remove libsqlite3.dylib

7. Add openssl and sqlcipher sub-projects:
 File->Add files to project, add openssl-xcode   as sub-project.  Repeat steps to add  sqlcipher as sub-project

8.  Build Configures

   a. Root project, Build Phases ->Target Dependencies, Add  sqlcipher and crypto

   b. Root project. Build Phases-> Link binary with libraries,  add libcrypto.a and libsqlcipher.a

   c. In the two sub-projects.  Build Setting ->Architectures -> Base SDK, make sure both are set to "Latest IOS"

   d. Under "Other C Flags", add -DSQLITE_HAS_CODEC to the Debug and Release C Flag settings. This will ensure that the SQLite key management functions are defined for use by the application.

   e. because sqlcipher has reference to security.framework, if you got the linked reference issure for sqlcipher, you may also need add the secruity.framework reference  in the root project

9. Build the project, the libcrypto.a and libsqlcipher.a will be created.

10 Add sqlite plugin files and reference back

a.      Select plugins, File->Add files to project, add SQLitePlugin.h and SqlitePlugin.m back to project

b.      Make sure libsqlite3.dylib was removed from Link Binary with libraries, because we are using sqlcipher replace it.

11 Build again, It should be no errors

12. Follow the sqliteplugin instruction to add the sqlcipher code. uncomments the line 192 for "sqlite3_key(" to enable sqlcipher

the key is passed from parametters

const char *key = [[options objectForKey:@"key"] UTF8String];
if(key != NULL) sqlite3_key(db, key, strlen(key));

13. Finally step, don't forget include cordova.js in your html

 <script type="text/javascript" src="cordova.js"></script> 
14.  you sqlitedb can be find in you mac:

~Library\Application Support\iPhone Simulator\[ios_version]\Applications\[appguid]\cocument\[dbname]


 
Categories: Mobile | XCode iOS

Apple Push Notification Service

http://www.raywenderlich.com/32960



PushPlugin:

https://github.com/phonegap-build/PushPlugin

http://devgirl.org/tag/cordova-push-notifications/


 Choosing proviling profile and export ad hoc ipx file

http://help.testflightapp.com/customer/portal/articles/1333914-how-to-create-an-ipa-xcode-5-


 
Categories: Mobile | XCode iOS