Sunday, December 13, 2015

Installing IONIC in mac and using android studio to emulate a sample android app


The following set of steps need to be configured to install ionic in macintosh and execute an android application on an emulator -

1.Download the emulator for android.
2.Launch the .dmg file.
3.Drag and drop the Android Studio into the Applications folder.
4.Open Android studio and follow the setup wizard.
5.Modify your .bash_profile in /Users/<youruserdirectory> to
contain the following -

a.Java SDK path – export JAVA_HOME =<Path/to/java/home/directory>
b.Android SDK path – export AND_SDK_HOME=/Users/youuserdirectory/Library/Android/sdk
6. Export path to contain the above variables -
export PATH=$PATH:$JAVA_HOME/bin:AND_SK_HOME/tools
7.Download the project – ionic-starter-tabs as sample to test from GitHub
8.Create a new directory and clone the project to the directory
9.Execute the below command

$sudo npm install -g ionic cordova
10.Execute the below command to create a new ionic project

$ ionic start myApp tabs
11.Execute the below command to run the project.
$cd myApp
$ionic platform add android
12. Install the correct add ons or software version of android using the
android manager.

13.Run the following command -
$ionic build android
$ionic emulate android

If all the above steps are executed correctly then the app will open up
in the android emulator.



Wednesday, September 9, 2015

Highlights of Apple September 2015 event

Highlights of Apple September 2015 event

Apple Watch

Healthcare

-- Airstrip -

  • Monitoring heart rate
  • Patient Date 
  • Taking quick action.

Bands
New Bands

OS2

IPad

IPad Pro

  • Timing controller
  • Photo alignment technigue
  • Oxide TFT material
  • Variable refresh rate
  • 3rd generation 64-bit chip
  • with 2x memory
  • Desktop class performance
  • GPU - performance 360x in last 5 yrs
  • Faster than 80% of portable PCs.
  • All day battery life - 10 hrs
  • Sound system - 4 speaker audio system
  • 802.11 ac with MIMO
  • Automatic balancing left and right, top & bottom.
  • 3x audio of ipad air.
  • Smart keyboard.
  • Buttefly design for dome switch - connector technology

Stylus for iPad pro - Apple Pencil.

  • Detects - force & pressure and helps trace draw. 
  • side by side and top pressure points give different shades.
  • Recharge connector.
  • Excellent features - draw and convert shapes to graphs.
  • Multitasking apps - comparing apps side by side.
  • Microsoft & Adobe apps demoed.
  • Excellent features for healthcare segment - visualize the model of the bone, 
  • Draw and cut through to get the result of anatomy and share the same.

Apple Tv

  • Powerful Hardware
  • Modern OS
  • New user experience
  • Developer tools
  • App store


  • All content across apps in a single screen.


  • Touch remote.
  • Screensavers with realistic moving pictures.
  • Day and night shots.
  • Access to photos.
  • Thumb detection to give 3d movement.
  • Click and swipe.
  • Siri does playback.
  • Also enables subtitles with an automatic playback with skip back 15 secs.
  • Siri interaction to search content.
  • Displays all essential movies using interaction based searches.
  • Swipe down to get quick access to button.
  • Ask Siri info about who stars.
  • Get sports or weather updates while watching the movie.
  • Operating system on apple tv - it's called TV OS.
  • Amazing apps - Guitar Hero, Shodowmatic & Zova, Madefire, Airbnb, Zillow - MLB app - scores information on app when watching game - notification for two games and split tv

Stats

  • 64 bit A8 chip
  • Bluetooth 4.0
  • 802.11 ac Wi-fi with MIMO
  • IR receiver


  • Communicates via bluetooth - no need to point remote to apple tv box 
  • Accelorometer & gyroscope
  • Charge lasts for 3 months.

IPhone

  • IPhone 6 - most popular phones.
  • Dual ion exchange glass on top.
  • 3D Touch.
  • Force in iPhone - peek & pop.
  • Zoom in and out without losing the content,
  • Cover glass and backlight technology combined with accelerometer along with tactic engine.
  • Force touch enables user to zoom into a message and 
  • Reply without multiple clicks.
  • Peek in at incoming flight time within messages.
  • Single gesture swipe across various apps.

Stats
  • A9 Chip, 64bit
  • 70% faster than A8 
  • 90% faster at graphics apps.
  • Motion co-processor - M9 - for health and fitness data.
  • Touch ID sensor - 2x as fast
  • 12MP iSight camera, 50% more pixels.
  • Deep trench isolation used to give better pictures.
  • 4K videos.
  • 5MP facetime camera.
  • True tone flash.
  • Retina flash - 3x brighter for flash photos 
  • on facetime camera.
  • Live photos - to capture effects.
  • Photo face in apple watch - can have live photos.
  • Developer APIs - Facebook supporting live photos.
Wireless
  • LTE - 2x as fast & 23 bands.
  • Wifi - 2x faster.
  • iOS9.
  • App to move from android to iPhone.
Accessories - New docks & leather covers.

IPhone Upgrade Program 

iOS9 availability - September 16th

Wednesday, June 10, 2015

WWDC 2015 - Apple Updates


WWDC 2015 - Yosemite 55% adoption rate, 7% windows.

Cursor detection.
Safari - pinned sites, media controls.
Spotlight updates - additional info.
Search updates for folders - customised search as in Google.
Windows sizing and work side by side feature.
Drag in media from safari to notes.

Performance optimisation -
1.4x cancellation
2x switching apps
4x mail messages
4x pdf preview
Metal for graphics - 50% rendering performance
OpenCl & OpenGL
10x speed improvement for games.
EPIC - for games

IOS - 9
83% adoption rate, 12% android.
Siri- updates - change in UI, app integration, reminders - location based.
Proactive Assistant - running - change of songs - offer up
Invitations automatically put on the calendar.
Suggestions for contacts and incoming calls.
Suggestions for contacts, app, relevant locations and search.
Search Api - deep link to application content found via search Api.
All search on device - under control.

Apple Pay
2500
Discover  induction.
1 Million locations accepting Apple pay.
Apple pay induction to UK.
Add store credit and debit cards.
Loyalty and rewards cards.


Notes - enhanced to include bullets, images and drawings.
Add a link to notes.

Maps - transit enhacements.

News - application personalised news.

IPAD - keyboard to track pad.
Multitasking support - task switcher redefined layout,
Split view, multi app, multi touch.
Watch video and multitask with the another app.

Low power mode extends battery life to 3 more hours.
IOS 9 - Lowered space from 4g to 1.6g - more space.

Dev Tools
UI Texting to X-Code.
Game play kit.
Replay kit,  Model I/O.
HealthKit - Hydration, uv exposure and productive health.
Access home remotely via iKit.

Swift enhancements - Swift 2.
Whole module optimisation - language features, see interfaces, protocol extensions.
Swift is open sourced.

Compiler, Standard libraries and Os 10 - beta comes in July.

Sunday, May 17, 2015

Continuous Integration in the JavaScript World (for Angular JS type of environments)


What if I had automated continuous integration type of environment in JavaScript world?


This question leads to a series of questions -

1. How will you automate the build process?

2. How do you know your code will work correctly?

3. How will you achieve the confidence that a newly introduced piece of code contains sufficient validation mechanisms to prove it works correctly?

4. How will you prevent unvalidated code to be included in the main line?

5. What will you do to ensure code is well documented?

6. How do we automate and reduce merge time and reduce wait time for a person working on same module in code?


The answers to these questions are in the tools currently available in the JS world today - 


1. How will you automate the build process?  -- Do you know a tool named 'Grunt' does exactly that.

2. How do I know that my code will work on different browser environments? -- Do you know an npm plugin named 'Karma' does exactly that.

3. How do you know your code will work correctly? -- Do you know an npm plugin named 'Jasmine, Mocha' does exactly that.

3. How will you achieve the confidence that a newly introduced piece of code contains sufficient validation mechanisms to prove it works correctly? -- Do you know an npm plugin named 'Istanbul' does exactly that.

4. How will you prevent unvalidated code to be included in the main line? -- Do you know an npm plugin named 'Threshold' does exactly that.

5. What will you do to ensure code is well documented? -- Do you know an npm plugin named 'Jshint, Jslint' does exactly that.

6. How do we automate and reduce merge time and reduce wait time for a person working on same module in code? -- Do you know a distributed repository named 'Git' does exactly that.

7. How will you automate the build process? -- Do you know an open build server named 'Bamboo, Jenkins' does exactly that.

In my next article I will be expanding on a sample application and detailing how to create such an environment.

Tuesday, January 20, 2015

Angular JS & Jasmine - Creating a sample application & running tests on functions

Angular Js & Jasmine work together to define the UI coding and unit testing framework of modern times 



I am exploring a sample application which demonstrates :

1. Necessary plumbing for making a simple angular js application work.
2. Defining unit tests.
3. Passing values in unit test mocks to test functions in developed code.


The following files are essential for the framework -

1. app.js - (holds the app module & controller module)
2. index.html - (view for your application)
3. style.css -  (for styling)
4. jasmine-test.js - (test framework code)
5. jasmine-test-runner.html - (test configuration)

You might need to download a framwork like npm to execute angular code and run tests via karma on jasmine. Karma can be installed using npm commands.


1. app.js

var app = angular.module('app', []);

angular.module('app')
  .controller('MainCtrl', function($scope) {
    $scope.title = 'Median Calculator App';
    var items =[];
    var medianVal ={};
    $scope.medianVal = medianVal;
    $scope.items = items;
    $scope.apply;
   
   $scope.addItem = function(item) {
   
    /** Module to add items on the list **/
    $scope.items.push(item);
    $scope.item = {};
   }
    $scope.apply;
   
    $scope.getCurrentMedian = function median(items) {

    /** Module to calculate median **/
    $scope.sortedItems = items.sort( function(a,b) {return a - b;} );
   
    $scope.medianVal ='';
     
    var half = Math.floor(items.length/2);
   
    if(items.length % 2) {
          $scope.medianVal = items[half];
     
    }
    else {
         $scope.medianVal = (parseInt(items[half-1])+parseInt(items[half]))/2.0;
      }        
       
        return $scope.medianVal;
    }
  });

2. index.html

<!DOCTYPE html>
<html ng-app="app">

<head>
  <link data-require="bootstrap-css@*" data-semver="3.2.0" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
  <link rel="stylesheet" href="style.css" />
</head>

<body ng-controller="MainCtrl">
  <h1>{{title}}</h1>
  <form>
    <label for="Value">Add Value:</label>
    <input type="number" name="value" ng-model="item.value" ng-validate="integer" class="my-input" size="5">
    <input type="Button" value="Add" ng-click="addItem(item.value)" />
  </form>
  <hr />
  <section>
    <input type="Button" value="Get Median! " ng-click="getCurrentMedian(items)" />
    Current Median: <pre> {{medianVal}}</pre>
    <!-- display current media here-->
   
    Values entered : <pre> {{items}}</pre>

  </section>

  <hr>
  <a href="jasmine-test-runner.html">Run Unit Tests</a>
  <script data-require="angular.js@*" data-semver="1.3.5" src="https://code.angularjs.org/1.3.5/angular.js"></script>
  <script src="app.js"></script>
</body>

</html>

3. style.css

/* Styles go here */


  .my-input {
    webkit-transition:all linear 0.5s;
    transition:all linear 0.5s;
    background: transparent;
  }
  .my-input.ng-invalid {
    color:white;
    background: red;
  }


4. jasmine-test.js

var controller, scope;

beforeEach(module('app'));

beforeEach(inject(function($controller, $rootScope) {
     scope = $rootScope.$new();
     controller = $controller('MainCtrl', {
          $scope: scope
     });
}));

describe("Sample Test Suite", function() {

  it("sample thrutiness test", function() {
    expect(true).toBeTruthy();
  });

});

describe("Get Current Median", function() {

    it("should calculate median for even set", function() {
      
        var inputargs  = [5,1,-7,7,8,3];
        
        var answer = scope.getCurrentMedian(inputargs);
       
        expect(answer).toEqual(4);

    });
    
    it("should calculate median for odd set", function() {
      
        var inputargs  = [5,1,-7,7,8,3,9];
        
        var answer = scope.getCurrentMedian(inputargs);
       
        expect(answer).toEqual(5);

    });

});

5. jasmine-test-runner.html

<!DOCTYPE html>
<html>
<head>
  <link data-require="jasmine@*" data-semver="2.0.0" rel="stylesheet" href="//cdn.jsdelivr.net/jasmine/2.0.0/jasmine.css" />
  <script data-require="jasmine@*" data-semver="2.0.0" src="//cdn.jsdelivr.net/jasmine/2.0.0/jasmine.js"></script>
  <script data-require="jasmine@*" data-semver="2.0.0" src="//cdn.jsdelivr.net/jasmine/2.0.0/jasmine-html.js"></script>
  <script data-require="jasmine@*" data-semver="2.0.0" src="//cdn.jsdelivr.net/jasmine/2.0.0/boot.js"></script>
  <script data-require="angular.js@*" data-semver="1.3.5" src="https://code.angularjs.org/1.3.5/angular.js"></script>
  <script data-require="angular.js@*" data-semver="1.3.5" src="https://code.angularjs.org/1.3.5/angular-mocks.js"></script>
  <script src="app.js"></script>
  <script src="jasmine-test.js"></script>
  <!-- add tests file references here if need be-->
  
  <!-- documentation for jasmine can be found at http://jasmine.github.io/2.0/introduction.html -->
</head>
<body></body>
</html>


All the configuration parameters for libraries point to environments on the internet.

You may also use the plunkr environment to run the configuration for a quick run and test of functions.


For command-line, you can use -

npm install
(to install the application)

npm start
 (to start the application, check the results in a web browser)

npm run test-single-run
 (to run one set of the tests)

Pardon me for the brevity on blogging due to lack of time but I think I tried to cover the important aspects for a newbie.

I will cover the steps on configuration of angular & jasmine on a standalone in a separate blog.