Apache Cordova and Visual Studio 2015 – To Do sample application

I want to explore Apache Cordova and the new tools available at Visual Studio 2015.

There is a sample application walkthrough we can use to practice Cordova with VS 2015, I selected the AngularJS version of the sample. You can also find the source code for the sample here Source Code Link.

The application keeps record of to do activities users enter. It stores the tasks in a local Html5 storage and, if you have access, in a Azure SQL server database using an Azure Mobile Service.

Had no issues following the walkthrough up to making it work with the local storage. The problem was when I tried to use Azure storage through the mobile service: the application simply didn’t  show any data neither saved it to the database.

It result that I had to configure the mobile service and add the table from it, so, I created another mobile service from Azure console, and followed the steps at the link Configure Mobile Service. Then, I went back to the code and set the Mobile Service API Key and the Url of the service at the service file azureStorage.js.

 

Running sample on Android VS 2015 emulator

Running sample on Android VS 2015 emulator

Cordova allows access to functionalities like geo location, camera, etc. while using JavaScript and AngularJS, TypeScript and other known web development frameworks.

I think there are good opportunities for taking advantage of all of these technologies so to quickly develop apps and avoid difficult to maintain mobile applications, developed in native to the device code.

I plan to keep improving on web development frameworks, specially JS, AngularJS and TypeScript. I’m sure we will find a good business use of them at my job at Zgura!

Cheers,

Danfer.

Learning AngularJS and use it with ASP.Net MVC – Controller on MVC view

I’ve been using book Build Single Page Application with ASP.Net MVC 5 and AngularJS.

On chapter 4, at Creating first angular controller, book’s code didn’t work in my case. I’m using Angular version 1.3.15.

I had to make following changes:

At _Layout.cshtml, identify the app:

<html ng-app=”myApp”>

At homeIndex.js (the file storing the angular controller definition):

//homeIndex.js

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

app.controller(‘homeIndexController’, function ($scope) {

$scope.fname = “John”;

$scope.lname = “Doe”;

});

 

And at the view, from where the angular controller is supposed to be called, Index.cshtml:

@section scripts

{

<script src=”~/js/homeIndex.js”></script>

}

<div ng-app=”myApp” ng-controller=”homeIndexController”>

Fname:- {{fname}} <br />

Lname:- {{lname}}

</div>

Will write this comment at Amazon too. Either AngularJS has changed since the version author was using (he says it is 1.2.26 or there may be some errors on sample code at the book.

Cheers.