Tuesday, March 27, 2018

share resource group between apps

  1. override public class func defaultDirectoryURL() -> URL {  
  2.      let url = FileManager.default.containerURLForSecurityApplicationGroupIdentifier("your.group.name")!  
  3.     return url  
  4. }  

Monday, October 26, 2015

evaluateScripts([“ARRAY OF JS URLS”], function(success) {
// do work here once the JavaScript files have been evaluated
}]

App.onLaunch = function(options) {
  // 1
  var javascriptFiles = [
    `${options.BASEURL}js/Presenter.js`
  ];
  // 2
  evaluateScripts(javascriptFiles, function(success) {
    if(success) {
      var alert = createAlert("Hello World!", "");
      Presenter.modalDialogPresenter(alert);
    } else {
      // 3 Handle the error CHALLENGE!//inside else statement of evaluateScripts. 
    }
  });
}

Friday, October 25, 2013

Phonegap Installation with plugins

Used to installe it with PhoneGap 3.0 version, but problem happens, the plugins can be downloaded but not working at all. Give it a try again today, seems all working fine now.

3.1.0

Follow this guide

http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html

Sample to use Camera

http://docs.phonegap.com/en/2.4.0/cordova_camera_camera.md.html


Some commands updated on 3.1

phonegap local plugin list

phonegap local plugin remove org.apache.cordova.dialogs


phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git

Tuesday, July 2, 2013

BB10 debug log


t is documented, it's just not obvious.

It's mentioned in the release notes as the first item under Known Limitations.


The qDebug() function
  • In this release, the qDebug() function does not work the same way as it did in previous releases. Previously, when you used this function in your JavaScript/QML code, the function sent the debug information to the console, and you could view the information in the Console view in the IDE. Now, this function does not send output to the console. Instead, this function sends debug information to the slogger2 log.

    To see debug information that is output from qDebug(), you need to access the slogger2 logs as follows:

    1. In the IDE, in the Target Navigator view, right-click the device target. Click Launch SSH Session.
    2. In the terminal that appears, do one of the following:
         a. To view the current slogger2 logs, type slog2info.
         b. To view real-time output for the processes that are being debugged (for applications that are running in development mode), type slog2info -w.
         c. To view help information on slogger2, type slog2info -h.

    You can also access the log files directly in the /tmp/slogger22 on the device and run these logs through slog2info at a later time.

Tuesday, April 30, 2013

what is a csr file

In public key infrastructure (PKI) systems, a certificate signing request (also CSR or certification request) is a message sent from an applicant to a certificate authority in order to apply for adigital identity certificate. The most common format for CSRs is the PKCS#10 specification and another is the Signed Public Key and Challenge Spkac format generated by some web browsers.

You may display the information contained in csr


openssl req -text -in request.csr



Actually PKCS #12 is the successor to Microsoft's "PFX".[6] But confusingly the terms "PKCS #12 file" and "PFX file" are sometimes used interchangeably.[4] [5] [7]
Microsoft's "PFX" has received heavy criticism of being one of the most complex cryptographic protocols.[7]

Many different file types are produced and consumed when creating an SSL certificate.
  • .csr file is a certificate signing request which initiates your certificate request with a certificate provider and contains administrative information about your organization.
  • .key file is the private key used for your site’s SSL-enabled requests.
  • .pem and .crt extensions are often used interchangeably and are both base64 ASCII encoded files. The technical difference is that .pem files contain both the certificate and key whereas a .crt file only contains the certificate. In reality this distinction is often ignored.
  • .cer - certificate stored in the X.509 standard format. This certificate contains information about the certificate's owner... along with public and private keys.
    .pvk - files are used to store private keys for code signing. You can also create a certificate based on .pvk private key file.
    .pfx - stands for personal exchange format. It is used to exchange public and private objects in a single file. A pfx file can be created from .cer file. Can also be used to create a Software Publisher Certificate.

Export private key pem from p12

openssl pkcs12 -nocerts -out private_key.pem -in abc.p12
Export public key pem from p12
openssl pkcs12 -in abc.p12 -out myPublicKey.pem -clcerts -nokeys

KISS - keep it simple or stupid

Design pattern is abused using everywhere now, and KISS is not mentioned recently.


List of software development philosophies

From Wikipedia, the free encyclopedia
This is a list of approaches, styles, and philosophies in software development. It contains also software development processessoftware development methodologies and single practices, principles and laws.

Monday, April 29, 2013

xcode ant build


        Compiling...
failonerror="true">



An XCode build from the command line looks like:
xcodebuild -configuration ${BUILD_TYPE} -target ${TARGET_NAME} -arch ${CPU_ARCHITECTURE} -sdk ${SIMULATOR_OR_IOS_SDK} 
BUILD_TYPE is something like "Release" or "Debug" (those are the defaults, you may have added others to the project)
TARGET_NAME is the name of the target you are building (by default the same name as your project)
CPU_ARCHITECTURE is the CPU you are building for, one of:
i386armv6armv7
Use i386 for simulator builds, and use either armv6 or armv7 for device builds - note that some other devices cannot run armv7 code, so usually when building libraries it's a good idea to build all of these architectures and then glue them together using lipo.
SIMULATOR_OR_IOS_SDK is what you are looking for, it's either iphoneos or iphonesimulator. Those values use the latest version of the SDK that the installed XCode supports, you can get a list of supported SDK's with:
xcodebuild -showsdks
Which returns a list like:
Mac OS X SDKs:
    Current Mac OS                  -sdk 
    Mac OS X 10.6                   -sdk macosx10.6

iOS SDKs:
    iOS 4.2                         -sdk iphoneos4.2

iOS Simulator SDKs:
    Simulator - iOS 3.2             -sdk iphonesimulator3.2
    Simulator - iOS 4.0             -sdk iphonesimulator4.0
    Simulator - iOS 4.1             -sdk iphonesimulator4.1
    Simulator - iOS 4.2             -sdk iphonesimulator4.2
xcodebuild has more flags than that, but those are the ones you'd commonly use after using XCode to set up the build properties. You don't have to use all of them, but it's probably a good idea to be clear about what you are building - otherwise I believe your last settings are used.