How to Get Windows Phone 7 Device in INDIA

by silvercrux @ 17. December 2010 12:58

We are working on few applications and it was important for us to test the applications on REAL Windows Phone 7 Device. However, as you all are aware, Windows Phone 7 hasn’t launched yet in INDIA.

After looking at a lot of places, we found that our best bet was to get HTC HD7 device which is termed as “GLOBAL” from amazon. Although the price was a bit exorbitant, we had luxury of labeling this shiny new gadget expense as business expense Smile.

We checked custom duty implications of the same in INDIA and couldn’t find any definitive answer. But we decide to dive in. We ordered the phone from Amazon on November 29th and selected Priority Shipping (as one of our application was getting bad review because it was not tested on the device, we wanted it ASAP).

Come December 2 (just 3rd Business day), we received the shiny new HTC HD7 Global phone. Custom duty charged was just Rs.680 (out of which FedEx took like Rs.300 Handling). So as it turns out, Custom Duty on Cellphone is a mere 1% in INDIA. This can be useful for people searching for Custom duty to buy Iphones and other phones (Note this does not include Ipad as it is another form of gadget).

Ok, So once I got my HD7, all I did was to insert my AirTel sim and just punched in my LIVE ID and Facebook credentials and it aggregated all my Contacts within few minutes Smile. HTC HD7 is pure joy. There are few niggling issues in OS like Wifi doesn’t always work in all the public routers, few extra steps for easy things like turning Wifi on/off etc. But I suppose they will be fixed up in the time to come.

How about Apps ? Well that’s a different story because being in INDIA I can’t use my credit cards to buy applications. I can install the free ones without any issues though.





C# variance : The Co and Contra variance explained

by silvercrux @ 9. August 2010 23:07

This topic can be ideally explained with a simple and pragmatic 2 part Q and A.

What is Covariance and Contra variance in C# 4 ?

This can be best explained by an example. If you image there are 2 types : x and y, then exactly one of the statement is true :

1) x < y
2) x > y
3) x = y
4) x not related to y (Both are totally different having their own chain)

Memory locations in C# all have a type associated with them. At runtime you can store an object which is an instance of an equal or smaller type in that memory location.

So considering that :
Covariant : Is converting from narrower to a wider type
contra variant : Is Conversion from wider to a narrower type

Covariance basically means that the return value of a method that is referenced by your delegate can have a different return type than that specified by the delegate itself, so long as the return type of the method is a subclass of the return type of the delegate. Basically this means from going to a wider type from a narrower type.

 

Why do you care about Co and Contra variance ?

Prior to C# 4.0, language was not capable of working with co and contra variance conversion. Now it does support. So the question is why you might need them ? Well the answer is simple, now Inheritance hierarchy works across Generic types, thanks to Covariance and Contra variance support in C# 4.0.

Let's take an example (This would not work in versions prior to C# 4.0) :

Covariant

   1: class Fruit { }
   2:     class Apple : Fruit { } 
   3:  
   4:     class Program
   5:     {
   6:         delegate T MyFunc<out T>();
   7:         static void Main(string[] args)
   8:         {
   9:              MyFunc<Apple> apple1 = () => new Apple();
  10:              MyFunc<Fruit> fruit = apple1;
  11:         }
  12:     } 
  13:  

In the above code we are assigning a narrower type to a wider type. Notice the use of the word "out" in Delegate MyFunc definition

Contravariant

   1: class Fruit { }
   2:     class Apple : Fruit { } 
   3:  
   4:     class Program
   5:     {
   6:         delegate void MyAction<in T>(T a);
   7:         static void Main(string[] args)
   8:         {
   9:              MyFunc<Fruit> fruit = () => new Fruit();
  10:              MyFunc<Apple> apple1 = fruit;
  11:         }
  12:     }

In the above code we are assigning a narrower type to a wider type. Notice the use of the word "in" in Delegate MyFunc definition

I hope this clears the confusion about Co and Contra-variance. If it's still not clear we can talk via comments :)





C# 4.0 Named Parameters Explained

by silvercrux @ 9. August 2010 22:18

Prior to C# 4.0, we have to remember (though intellisense helped!) the order of each argument to use it in the consuming code.

C# 4.0 introduces a new concept which frees you to provide value to arguments in a specified order. For example, a function that calculates dearness allowance for an employee can be called in the standard way by sending arguments for salary and inflation percentage by position, in the order defined by the function.

   1: GetDearnessAllowance(5000, 9);


If you do not remember the order of the parameters but you do know their names, you can send the arguments in either order, weight first or height first.

   1: GetDearnessAllowance(wage: 5000, inflation: 9);

 

OR

   1: GetDearnessAllowance(inflation: 9, wage: 5000);

Named arguments also improve the readability of your code by identifying what each argument represents.

A named argument can follow positional arguments, as shown here.

   1: GetDearnessAllowance(5000, inflation: 9);

However, a positional argument cannot follow a named argument. The following statement causes a compiler error.

   1: //GetDearnessAllowance(weight: 5000, 9);

 

We hope this clears up the matter.





Registration for Windows Mobile Marketplace - wp7dev

by silvercrux @ 28. June 2010 17:48

We finally registered for Windows Mobile Marketplace. We received multiple confirmations that registrations for Current Windows Mobile Marketplace will be valid for Windows Phone 7 development.

We registered for Windows Mobile Marketplace mainly to get more documentation and benefits related to Windows Phone 7. We also stake claim on Developer version of Windows Phone :)

Signup process for Windows Mobile Marketplace was simple :

  • Requires a Windows Live ID
  • You get to pick whether you are registering as : Business, Individual or Student. We picked as an individual to get rid of sign up woes. Signing up as business requires Company related documents which as a new company we don’t have. We are in process of applying for the same. We signed up as an individual and hope that we may be able to change it in future.
  • They charge $99 fee to signup. I don’t know how but $99!=Rs.5010. I don’t know how MS converts the currency! $1=Rs.46 at the time of signup.
  • They sent your order to GeoTrust to Verify you as a legitimate person.
  • For India, Geotrust asked us about Passport or Driving License copy faxed to phone number.
  • We are still awaiting a “verification” call from them. It’s been already 4 days.

One mistake we did while Signing up and I hope you guys don’t do that is : I didn’t provide cell number as Phone #2.

Once the signup will be complete, we will be shown as Verified Publisher :)

Now on to good stuff, submitting my video to claim WP7 developer Handset :). It is coming in 1-2 days.

BTW, We did email Brandon Watson about our business ideas. I think with posting of Video on YouTube, we will be done with staking claim on that developer Phone :)

UPDATE : We are now approved in Windows Marketplace. Waiting for Microsoft to start accepting applications Smile





Announcing Support for Windows Phone 7 applications

by silvercrux @ 21. June 2010 11:02

We at SilverCrux are ready to announce our big for the Windows Phone 7 Platform. We are going to do something around 6-7 applications that should be available for the Windows Phone 7 launch this holiday season.

We are going to accepting Windows Phone application development projects for outsource as well from October, 2010. Our rates for outsource development on Windows Phone 7 will be quote based, but our quotes will be based on efforts priced at something like $35/hour.

For our products line up, we are not ready to reveal the whole line up. What we are going to do however is do a series of blog posts that will be working towards our first application Pregnancy related. We are thinking about naming it PregnancyTrack .

PregnancyTrack will be pregnancy related application that will helps:

  • Help to Plan Pregnancy – Indicate hot dates, apply some gender determinations etc.
  • Keeps track of Pregnancy when Pregnancy is achieved, things like week by week development information, Important information, Set up Reminders for Doctor visits etc.
  • Once Delivery is complete, it keeps track of baby’s progress upto 12 months timeline. Also contains most important information related to dealing Colic issues, Gripes, Stool etc.

We are thinking that the application will be priced around $2.99

Now back to technical stuff, since this blog is thoroughly technical :

  • This will be a Silverlight based application
  • For internal database kind of activities, we will be relying on XML and Linq to XML magic.
  • For most up to date informations, we will be relying on WCF Services hosted at our product microsite : Pregnancy by Week

Now we haven’t signed up for Windows Mobile Marketplace because we are just awaiting for things to get little clearer. For eg, we aren’t sure if current Marketplace membership enrolment will be valid for Windows Phone 7 application submissions etc. We are also interested in applying for Windows Phone 7 developer phone, but aren’t sure yet how-to do it. If there is any Windows Phone team member reading this, please clarify how to signup for developer phone ? . We are based in INDIA and aren’t sure about your policies regarding giving access of the Developer Phones to developers in INDIA. Even if Windows Phone 7 doesn’t launch here, we still do lot of work for our US Clients and are heavily motivated towards developing for the Windows Phone 7.

In next few blog posts, we are going to walk-through this application from : Photoshop Designs to silverlight implementations. I also want to clarify that this won’t be an open-source project. So guys please don’t ask for Source. We will discuss implementation details but not full source-code.





C# 4.0 Optional Parameters Explained

by silvercrux @ 21. May 2010 00:00

With release of the C# 4, the gap of features between VB.NET and C# just became narrower. C# 4.0 has introduced a new “Optional Parameters” support. So instead of explicitly passing in value for each variable in a method/constructor you can rely on default value defined in the method signature.

Let’s take a simple example :

 

public void AddPerson(string Name,int Age=30)
{
...
}

In this Example, now under C# 4.0, you can call this method as

 

AddPerson("Joe") //Age will implicitly be 30

 

Though theoretically this looks a nice shortcut, practical use of this may be discouraged. Adding an optional parameter to a public method that’s called from an external assembly requires recompilation of both assemblies – just as if the parameters were mandatory. This is so because this is just a syntactic sugar coat by the C# compiler. Behind the scenes C# compiler inserts code equivalent to AddPerson(“Joe”,30).

It is for this very reason optional parameters should be avoided in public methods that are supposedly going to be used by External assemblies.





Reference : Anders Hejlsberg Keynote at TechDays 2010

by silvercrux @ 8. April 2010 12:24

I think this video is an excellent watch for anyone doing any kind of programming. It discusses past about programming languages, what are the current trends of programming and a reasonable estimate of what we can expect in the future :) .

Anders discusses how various languages are becoming more and more “multiple paradigm” and borrowing features from each other. He gives examples of how static languages like C# are borrowing from dynamic languages like javascript and how dynamic languages are borrowing features from static languages.

He points out that current general purpose languages like C# and Java etc are more declarative on “how” rather than “what”. Over time he thinks, languages will be much more smarter and we will be able to tell them “what” to do and they will do it in smarter way. Obviously this pointer goes to DSLs in general :).

It is a sheer fun to listen to Anders. That is 1 hour pretty well spent . Anyone having anything to do with C#, it’s a must watch.





New Application for Client/Order Tracking

by silvercrux @ 15. March 2010 12:18

So we are starting up with a new portal for easier access between me and my clients. I want to do this in a controlled fashion rather then email/twitter/im etc.

The purpose of this application is going to be :

Client

  • Signup and Pay
  • Submit Work details and related milestones
  • Collaborate with Staff
  • Request for Proposals
  • View Proposals and approve it.
  • View Invoices and Pay for it
  • Update Project specific Deliverables

Staff

  • Collaborate on client’s work
  • Submit Proposals
  • See and manage their priorities
  • Update progress on milestones and work items

Admin

  • Client Admin
  • Client Assignments to Managers
  • Invoicing and Payments
  • Proposals and their status Reminders
  • Client History
  • Client Notes
  • Case Management

Ok I know for some of you this might be boring details. For those who are still here : I could have used BaseCamp + Freshbooks + Proposable + whatever utility Web 2.0 companies. However I don’t want to go that route, for simple reason is I would have to customize a lot based on my business workflow. To give you an example, our Client’s can hire employees based on different models, in order to ensure their effectiveness we are going to give our clients access to our staff’s actual screenshots something like odesk. Long story short : We want to do customizable portal from start. Since we are a Microsoft Shop, we couldn’t adopt open source / PHP scripts.

So brand new project, one question comes up in true developer’s mind is what architecture/technologies to use etc :

  • .NET 4.0
  • ASP.NET MVC 2.0
  • Entity Framework (started to learn nHibernate, but I don’t want to wait on this. Will try to keep architecture independent of Persistance Libraries).
  • jQuery UI
  • Blueprint Grid Framework
  • .LessCSS
  • Log4Net for Logging
  • Lucene for Search and Retrieval
  • Microsoft AJAX Framework and DataAnnotations classes.
  • SQL Server 2008
  • Reporting Services for SQL Server 2008 (for Client Reporting)
  • Silverlight 4 to provide Whiteboarding and share Annotations between Client and Staff
  • Share Models between Silverlight, MVC and WCF layers (I may have to expose my logic at some point to other clients for eg : Ticket System etc)

In my next post I will give you rough idea of my architecture. Your feedback is vital as I am willing to learn everything I can :)





C# 101: Virtual Function Members Vs Abstract Function Members

by silvercrux @ 12. March 2010 12:13

This series is going to be a C# refresher that reminds you of C# features you sometimes forget.

A function can be marked as virtual when you don’t want your sub-classes to compulsorily provide implementation of some specialized form. So you can treat virtual as opposite of abstract, where you have to compulsorily provide implementation.

Consider this small fragment :

   1: public abstract class Person
   2: {
   3:     public abstract string Name {get;}
   4:     public virtual decimal TotalDebts
   5:     {
   6:         get
   7:         {
   8:             return 0;
   9:         }
  10:     }
  11: }
  12:  
  13: public class RichPerson : Person
  14: {
  15:     public override string Name 
  16:     {
  17:         get {return "I am Rich";}
  18:     }
  19: }
  20:  
  21: public class PoorPerson : Person
  22: {
  23:     public override string Name 
  24:     {
  25:         get {return "I am just a Poor guy";}
  26:     }
  27:     
  28:     public override decimal TotalDebts
  29:     {
  30:         get{return 1000000;}
  31:     }
  32: }

In this example the property “Name” declared in Line 3 is abstract while property “TotalDebts” in Line 4 is virtual.  The difference is while it is compulsory for deriving class to override “Name”, it is optional for deriving class to override “TotalDebts”. In this particular case PoorPerson is under heavy debt and implements TotalDebts to return his TotalDebts.





TekPub.com : First Impressions

by silvercrux @ 5. March 2010 12:22

Well it’s Friday again and in INDIA, where I am based at, it is almost Friday evening. So it’s that time of the week when all of us want to learn and do something new for the weekend.

I have been trying to wrap my head around ASP.NET MVC and bought a book last week title “ASP.NET MVC Quickly” from Packt Publishing. I went through whole book last weekend and when I finished the book I felt pretty confident of understanding the core concepts and thought I could start a small little project on Monday night.

My hopes were shattered though as soon as I start writing something meaningful in ASP.NET MVC. I constantly felt the need to know how to do this and how to do that. Even in simplest of tasks like Html.ActionLink, I was struggling to find how to pass values into the controller. I managed to do it by doing a quick google lookup but I realized that I am not ready.

Being a 1 person – startup, I didn’t want to invest a whole lot of time and energy into books and playing with samples. I wanted to write something meaningful even though I was learning.

My Objectives were :

  1. Learn MVC Quickly
  2. Start using it for something productive
  3. Spend reasonable amount. I set aside Rs.1000/month that is roughly $20 so I would have wanted to stay in that budget :)

I was aware of tekpub.com before, but this week I decided that enough is enough and I need to be learning and using these things almost yesterday.

So I finally signed up for monthly subscription of TekPub.com and watched first video. So far things are looking great.

I would personally suggest anyone interested in learning ASP.NET MVC should sign up for that course ASAP. Get rid of your lizard brain :)

Ok, I will post my views after going through the videos a bit more.

So far I had 2 minor complains :

  • Speed of video stream is terrible. I know it’s not my internet because I am able to watch other sites just fine. I would suggest they should use Amazon Cloud front or similar
  • Not being able to download videos :(. In monthly subscription they don’t give downloads. In poor bandwidth country like INDIA, I would have appreciated it.

 

That's it, I will post more of my findings next week :)



MVC



© Copyright SilverCrux Technologies. All rights reserved. We provide website html services.