Friday, December 28, 2012

SkypeCall from Windows8 Xaml

hi,

I got oppertunity to integrate skype call over windows8 through XAML.

Till date no SKD is avaiable to integrate this using XAML or C# in windows8. then what could be solution - ???

The simplest solution-
  • invoke web browser using XAML (I used webView control for this)
  • on page load of invoked URL write windows.location.href = callto:
Enjoy :)

Thursday, October 25, 2012

Office web App, Hello World - Agave


Office Web App

Hello world


Lastly I got chance to explore office web app. During my exploration I found it difficult to get all items, even for helloworld at one place. So trying to sum up here –

Prerequisite –

·         Office 13/15 – download here - http://superuser.com/questions/449923/office-2013-offline-installer

·         Install visual studio 2012

·         install Visual studio 2012 tools to create office web apps

All the packs are available in 32/64 bit versions.

Once you install all these you are ready to create your first web app –

Screen below shows ‘file-> new ->

 

 

 

Screen 2, after you click “OK” -
 
 

So office web app is nothing but HTML5 and javascript. The manifest.xml, keeps in information about your app. For all the old programmers –

Few Observations

1.    Office web App is html, so no COM and COM+ object.

2.    Essentially it is all about cloud / azure. Every new product/ enhancement is keeping this flavor. Which enables end user to work seamlessly from any device.

This changes the deployment options – The four possible deployment options are –

·         Market place (which is now a days de facto for almost every customization in MSFT)

·         SharePoint 2013 app catalog (wow!! finally I understood why app catalog in SPS 2013)

·         Exchange server for mail apps

·         Local folder deployment.

All this good so far – but I now with this much move to cloud I am puzzled –

How far this is going to help or where it will end?

Is that one day we will return to our local PC?

 

For more information about office web app follow MSDN blogs –

http://blogs.msdn.com/b/officeapps/

 

Friday, June 8, 2012

Changing video on mouse click for video tag in HTML5

hi,
I wanted to have TV kind of facility where I can chose video and on click of selected video, the video should display in designated area.Below is the snippet for creating TV.To achieve this, complete video tag must be re-written dynamically where value of source need to be set on every click. In below snippet test is the function invoked on mouse click within canvas

      function test(e) {

           var xPos = parseInt(e.offsetX);
           var yPos = parseInt(e.offsetY);
           DeleteNode();
           createNode();
           var viSource = document.getElementById("mySrc");
           if ((xPos>0 && xPos <136))
             if((yPos>50 && yPos<201))
             {
              viSource.src = "VideoTutorial/WindowsBlogWin8CPDemo_med_ch9.mp4";
              viSource.type = "video/MP4";
              //alert("value inside video tag::" + document.getElementById("videoDiv").innerHTML);
           }
     if ((xPos > 0 && xPos < 136))
               if ((yPos > 200 && yPos < 351)) {
                   viSource.src = "VideoTutorial/863_WinAzureForWin8Nick.mp4";
                  viSource.type = "video/MP4";
                  //alert("value inside video tag::" + document.getElementById("videoDiv").innerHTML);

               }

       }

 function DeleteNode() {
           var vDiv = document.getElementById("videoDiv");
           var videoElements = document.getElementsByTagName("video");
           if (videoElements.length > 0) {
               vDiv.removeChild(document.getElementById("myvideo"));
           }
           //alert("Div Element after deleting existing video node: "+vDiv.innerHTML);

          }

       function createNode() {
             var vDiv = document.getElementById("videoDiv");
             var videoElements = document.getElementsByTagName("video");
             if (videoElements.length == 0) {
                 var vVideo = document.createElement("video")
                 vVideo.id = "myvideo";
                vVideo.setAttribute("width", "400px");
                 vVideo.setAttribute("height", "300px");
                 vVideo.setAttribute("autoplay", "autoplay");
                 vVideo.setAttribute("controls", "controls");
                 vDiv.appendChild(vVideo);
                 var source = document.createElement("source")
                 source.id = "mySrc";
                 vVideo.appendChild(source);

             }
            //alert("Div element after creating video node: "+vDiv.innerHTML);

           }

          And the output will look like -

Enjoy

Wednesday, May 2, 2012

Metro App invoking WCF service , Simples WCF, Metro App Consuming WCF.


Metro App invoking WCF service





Hi All,



I created the very basic Metro App “Split application”. The post is can be segregated in two halves. The first one explains about the default coding which comes automatically when developer choose the template “SplitApplication” from visual Studio 2011, and second half talks about customization in data part of UI.

The first half of Story

 The default application creates data source in-memory and displays that. I consumed web service and created navigation page.

The Key learning’s are –

·         The source which is going to be binding either to dataGrid or ListView should be ObservabaleCollection

·         In GridView to make item clickable “IsItemClickEnabled” must be true.

·         Get ready to code async way.



Below is the diagram for default source code and application given –

The Flow of events for the sample split application is  ->

·         App.Xaml.cs loads the Items.xaml .

·         The item.xaml is bind to SourceData, which provides the ObservableCollection of Data.

·         GridView and ListView are in item.xaml are bind to ObservableCollections of SampleData. [The controls in xaml are using resource which are defined in StandarStyle.xaml inside common folder. The standard250X250Itemtemplate defines title and subtitle by default, modification in these resource  will have effect in display of controls.]

·         The GridView in item.xaml has IsItemClicabk true and event receiver is attached to “ItemClick’ which navigates and load to SplitPage.

My Experiment with custom WCFService

The second half of Story



Create one WCF service, which reads data from xml file and returns it.

Two public methods – GetAllBooks() and GetBookByID()

Create one page – myItems.

Goto App.xaml  write - _rootFrame.Navigate(typeof(myItems));



Add reference to custom web service.

Goto myItems.xaml.

Open “OnNaviagte”;

Bind your collection which returns ObservableCollection of object. [This will make changes to UI hence it must be in different thread] so the code is like –

Protected override void OnNavigatedTo(NavigationEventArgs e)

{

This.DefaultViewModel[“Items”] = e.Parameter;

BookStoreService.Service1Client  svr = new BookStoreService.Service1Client();

Svr.OpenAsync();

System.Threaading.Tasks.Task> result = svr.GetAllBookAsync();

Dispatcher.Invoke(Windows.UI.Core.CoreDispatcherPriority.Normal,(obj,invokeArgs) =>

{

itemGridView.ItemsSource = result.Result;

},this.null);

}

Go to Item_Click event. { this.Frame.Navigate(typeof(mySplitPage),e.Clickedtem));

From this code you got it J Add another page of type split and name it to myitemDetail.

 Do F5..You are done. !!

Friday, April 20, 2012

HTML5, Offline, AppCache, .cache = text/cahce-manifest


Hi,

Since I started on HTML5, metro and win8. The interesting things are , IndexDB, offline etc. sadly I couldn't find end-end simple how to get offline working. Below I will explain the simplest How to -

1.      Create asp.net site. Simple site given by Visual Studio.

2.      Think about the resource you want to cache, since this is simplest; I limited myself to cache one image file.

3.      Create a web application in IIS and set virtual directory.

For this web application set the MIME type

            File type = .cache

            Map to – text/cache-manifest

4.      Go to page where is defined.

5.      Modify this with  

6.      Create a file give the same name as defined in manifest=. So I am giving it simple.cache

Simple.cache should look like –



CACHE MANIFEST

CACHE:

<> (with extension and relatives ness>>



Since my cache file is simple.cache, and image file I plan to cache is “mylogo.png” (this is stored in root location for site) so the overall file is



CACHE MANIFEST

CACHE:

mylogo.png



Now run your site. Since the server is available it will run without any problem.

Now stop IIS and rerun site. This time the UI is different as it is coming under offline capability.



Now if you are starting IIS again and want to see original site delete cache from bowser setting. Without this, cached version will be displayed for this simple site.



Enjoy!!




Tuesday, April 17, 2012

Windows 8 - Series 1 (XAML)

Recently I got chance to explore windows8 , windows phone etc. and I felt creating App for windows8 will involve good learning from developer perspective. reasons -
The thought process about UI has to change, its not conventional UI , navigation being changed drastically.
The javascript involves good syntax learning and API learning.
only XAML remains closely same, not exactly same.
The better way to rephrase above is -
XAML UI developers are Metro style app developers
Existing XAML assets and knowledge carry forward
XAML and C++, like peanut butter and chocolate
And Also I figureed out some differences between silverlight and Metro App as well -
Silverlight Application
Silverlight depends on browser to provide networking code
Silverlight sends navigation command to browser..
Silverlight is supported OOB in SharePoint.
Silverlight needs browser to host application and application interacts with browser first.
Navigation is done through XAML pages
Metro App
WinRTrelies on underline system service to provide networking code
WinRTmanages navigation through system commands
SharePoint including HTML5 is supported only on latest browser.
Metro App directly runs on WinRT.
Navigation is done through type, x:Class.
XAML for Windows Runtime currently doesn't support custom markup extensions.
Keep Watching – Now I have content to post J

Tuesday, February 28, 2012

Windows Phone SDK7.1 on windows 7 sp1- compatibility issue

hi All,

 
Since I am back to work and hence trying to explore all new. for the same I wanted to explore Windows Phone, hence I saved the vm_web2.exe on hard disk and was trying to install.

 
every time I was getting error - compatibility error goto http://go.microsoft.com/fwlink/?LinkId=143397.

 
I tried -

 
  1. Unsitall Visual studio 2010 professional.
  2. right click on vm_web.exe, properties ->CompatibilityTab.
  3. played with regirtry Entries
 
Nothing worked, finally I landed to download page again and instead of saving to hard disk , I installed from there and every thing is working fine.

 
what a fix :d

 
Save your time and try this as well.

new SPSITE("") error - could find web application at URL

hi All,

I am back Almost after a year :)
When creating console application for sharepoint , today again I got good old error saying could not find the web application. recalled all the thread and now noting down the solution -

Project properties -> target .net framework should be 3.5
and Target  CPU must be "Any" from "Build Tab".

Enjoy coding :)