Saturday, February 13, 2016

Apache Cordova - How to install Apache Cordova and run a project on Mac with Visual Studio IDE

Hello everyone,

   Today I am gonna a show you how to make it possible develop and debug Apache Cordova and Ionic projects using Visual Studio IDE on Mac.

First download Visual Studio Code at Microsoft page from your MAC:

https://code.visualstudio.com/Download

Then if you don't have HomeBrew installed, please do it.

Homebrew is a package manager for the Mac and it makes installing most open source sofware (like Node.JS) as simple as writing brew install node.

To install Homebrew just open Terminal and type ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)".



Now the Cordova piece of if:
Open a Terminal (on a Mac) and if you're planning on targeting iOS devices,
Install HomeBrew on your Mac.
Open a Terminal and run brew install ideviceinstaller ios-webkit-debug-proxy



Cordova debug environment

Go to your Visual Studio installed and open a cordova project code that you have or just download a sample on Github.

Type Command + P to open a terminal box in your Visual Studio and type ext install cordova


then

Now you need to enable the debug environment as well as your emulators. So  click on debug button from your Visual Studio code IDE .


Configure gear icon () to choose the Cordova debug environment.


Now you are good to go! Just select the emulator, device or browser that you want to launch it, hit play and go fot it!



and run:



Please find more about Apache Cordova here:
Apache Cordova Debugging Tools
Apache Cordova run Android app



I hope it helps you and happy codding,
Thiago Leoncio.

Saturday, February 6, 2016

3 big reasons why start coding in swift instead of Objective-C

1- Swift requires less code

Swift reduces the amount of code for string manipulation as well as repetitive statements. Developing with Objective-c, for example using strings of text is very boring and
requires several steps to combine 2 or more pieces of information. Swift endorse modern languages features(similar to Java features) like adding 2 or more strings together using “+” operator.
This is a key feature looking from developer perspective and time consuming.

Type -  The type system in Swift reduces the complexity of statements in your code. The compiler get the types easily. Swift support interpolation, which means that memory tokens are not needed. This
allows developers to insert anything to be provided as user-facing string.

In Objective-C we need to be worried about the tokens (%s, %d, %@) when we are outputting something. Remember, if you mess up the order of using the tokens the app will crash.

     


2- Swift is faster

According to Primate Labs, makers of the popular GeekBench performance tool, Swift was approaching the performance characteristics of C++ for compute-bound tasks in December 2014 using the Mandelbrot algorithm.

Primate Labs, in February 2015,  discovered that the Xcode 6.3 Beta improved Swift’s performance of the GEMM algorithm(a memory-bound algorithm with sequential access of large arrays) by a factor of 1.4. The initial FFT implementation for a memory-bound algorithm with random access of large arrays was a 2.6-fold performance improvement.

According to Primate Labs, the GEMM algorithm performance suggests the Swift compiler cannot vectorize code the C++ compiler can -- an easy performance gain that could be achieved in the next version of Swift.

Dropping legacy C, Swift is nearly on par with C++ for both the FFT and Mandelbrot algorithms.

3-Swift Playgrounds helps a lot

Playgrounds are great for developers. Playgrounds allow developers to test out  new algorithm or any graphics routine. So, you save tons of time doing simple coding of 20-30 lines without the need
of creating an full iPhone or iPad app.Apple has added inline code execution to Playgrounds to help programmers create a chunk of code or write an algorithm while getting feedback along the way.


I hope it helps and happy coding,
Thiago Leoncio.

---------------------------------------
Other great IOS articles:

IOS Exceptions:
http://thiagoleoncio.blogspot.com/2016/03/ios-exceptions.html

IOS - IOS App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.
http://thiagoleoncio.blogspot.com/2016/01/ios-app-transport-security-has-blocked.html


IOS - Video using 3D framework
http://thiagoleoncio.blogspot.com/2015/11/ios-application-using-3d-framework.html

IOS - Video Application with Json and Mysql connection
http://thiagoleoncio.blogspot.com/2015/09/ios-application-with-mysql-database.html

IOS - How to create Multiple views
http://thiagoleoncio.blogspot.com/2015/08/ios-how-to-create-multiple-views-in.html