google

Newest Post

Showing posts with label Windows 8. Show all posts
Showing posts with label Windows 8. Show all posts

Could not add reference to "System.Net.Http.Formatting" namespace in WPF web api client project

| Friday, December 12, 2014
Read more »
For adding the reference in your web api client

1. Right click on "References" in the solution.
2. Following window will open.


3. Select location "Extension" as shown above and check "System.Net.Http.Formatting" namespace
4. and DONE!!!

Integrating PushSharp In the WCF Restful Web Service to display Push Notifications in Apple, Android and Windows devices

| Monday, September 29, 2014
Read more »
Hello Folks, Today I will demonstrate the method of integrating the PushSharp library in WCF Restful Web Service to send the Push Notifications to Apple, Android and Windows devices.


This library and its documentation is available on the GitHub at following link

Redth/PushSharp


Create a new WCF web service in the Visual Studio(Here I am using Visual Studio 2012). After creating the Web Service, Go to Tools-> NuGet Package Manager -> Manage NuGet Packages for Solution as shown in following image.




In the Package Manager, Search "PushSharp" 


After installing PushSharp NuGet Package, following dlls will be added in the bin folder of the solution. 




Next are the lines of the code which are used to send the notifications from the web service. Please consider following is the minimalist code required to send notifications to devices. For additional functionality, please go through the samples given in the GitHub library of PushSharp.

For Sending Push Notifications to the Android device.

 public void SendAdnoirdPush(string APIKey, string DeviceID, string Message)  
   {  
     var push = new PushBroker();  
     push.RegisterGcmService(new GcmPushChannelSettings(APIKey));  
     push.QueueNotification(new GcmNotification().ForDeviceRegistrationId(DeviceID)  
             .WithJson("{\"alert\":\"" + Message + "\",\"badge\":7,\"sound\":\"sound.caf\"}"));  
   }  

APIKey of the App can be obtained from the Google Developer Console.
DeviceId of the device using the App.
Message to be displayed in the Notification.


For Sending Push Notifications to the iOS device.

 public void SendiOSPush(string DeviceID, string Message, string sound)  
   {  
     var push = new PushBroker();  
     var appleCert = File.ReadAllBytes(new DirectoryInfo(HostingEnvironment.ApplicationPhysicalPath) + "/pushNotificatio.p12");  
     push.RegisterAppleService(new ApplePushChannelSettings(true, appleCert, "CertificatePassword"));  
     push.QueueNotification(new AppleNotification()  
                   .ForDeviceToken(DeviceID)  
                   .WithAlert(Message)  
                   .WithBadge(7)  
       .WithSound(sound));  
     //.WithSound("sound.caf")); //default  
   }  

DeviceId of the device using the App.
Message to be displayed in the Notification
sound to be played with Notification

For implementing the iOS Notifications, a signed certificate is required to be generated from the Developer Console. That certificate is copied in the system and Path is given as in the method above. 
Please be careful while mapping the path of the certificate. The certificate is different for sandbox and production
RegisterAppleService requires the certificate password. 

For Sending Push Notifications to the Windows phone.

 public void SendWindowsPhonePush(string ChannelUri, string pageName, string Header, string Message)  
   {  
     var push = new PushBroker();  
     push.RegisterWindowsPhoneService();  
     push.QueueNotification(new WindowsPhoneToastNotification()  
     .ForEndpointUri(new Uri(ChannelUri))  
     .ForOSVersion(WindowsPhoneDeviceOSVersion.Eight)  
     .WithBatchingInterval(BatchingInterval.Immediate)  
     .WithNavigatePath("/" + pageName)  
     .WithText1(Header)  
     .WithText2(Message));  
   }  

ChannelUri is the unique identifier for each device using the App
pageName to navigate to when notification is clicked
Header to be displayed in the Notification Header
Message to be displayed in the Notification Message


and voila!!!! DONE

Above methods can also be combined into one method to send notification to all types of devices., also If notifications are to be sent to multiple devices of same OS, then a "for" loop can be traversed as per the requirement for each method.

Update the .edmx file when the database changes

| Saturday, May 17, 2014
Read more »
To update the .edmx file when the database changes

  1. In the Model Browser, right-click the .edmx file and select Update Model from Database.
  2. The Update Model Wizard starts. If there is no database connection specified, the Choose Your Database Connection dialog box appears. Otherwise, the Choose Your Database Objects dialog box appears. 
  3. If the Choose Your Database Connection dialog box appears, specify a database connection. Otherwise, go to the next step.
  4. For details about specifying a connection, see Choose Your Data Connection Dialog Box (Entity Data Model Wizard). When you have specified the connection, click Next to display the Choose Your Database Objects dialog box.
  5. Click the Add tab.
    Nodes for tables, views, and stored procedures are displayed. If any objects have been added to the database (or were not included in the previous storage model), you can expand the corresponding node to view the objects that are available to add to the conceptual model.
  6.  If an object has been deleted from the conceptual model but has not also been deleted from the storage model, the object will not be available to add to the conceptual model.
  7. Expand the Tables, Views, and Stored Procedures nodes, and check the objects you want to add to the .edmx file.
  8. Click the Refresh tab.
    Nodes for tables, views, and stored procedures that are included in the existing storage model are displayed. Any changes that have been made to these database objects will be reflected in the updated storage model. Changes to the conceptual model are made when columns are added to a table or view.
  9. Click the Delete tab.
    Nodes for tables, views, and stored procedures are displayed. If an object has been deleted from the database and was included in the previous storage model, you can expand the corresponding node. The objects in these nodes will be deleted from the updated model.
    Click Finish to update the .edmx file with the database changes.

Reference - MSDN

Update the .edmx file when the database changes

Posted by : Stranger
Date :Saturday, May 17, 2014
With 0comments

Windows 8 keyboard shortcuts

| Friday, January 18, 2013
Read more »
Knowing at least some of the Windows 8 keyboard shortcuts will make your Windows 8 experience much more enjoyable. Try to memorize these top Windows 8 shortcut keys.

  • Press the Windows key to enter the tiled Start screen.
  • The Windows key + M minimizes everything that's showing on the desktop.
  • The Windows key + E opens Explorer for quick access to folders.
  • On the Start screen, press the Windows key + D to instantly get to the desktop.
  • The Windows key + Tab opens a list of currently running programs.
  • The Windows key + Print Screen takes a screenshot and saves it in a Screenshots folder nested in your Pictures folder. 
  • To take a screenshot on a Windows 8 tablet, simultaneously press the Windows button and the volume-down button on the tablet chassis.
  • The Windows key + Q opens a global search menu. Type what you're looking for and where you would like to look.
  • The Windows key + W opens a search in your system settings to quickly locate and change system properties.
  • The Windows key + F opens a file and folder search.
  • The Windows key + Pause opens the system properties page to show you a quick rundown of your specs.
  • The Windows key + "," (that's the comma sign!) makes all current windows transparent, giving you a peek at the desktop as long as you hold down the Windows key.
  • The Windows key + "." (the period) snaps a window to the right or left side (toggling each time you press ".").
  • The Windows key + R prompts the Run command—useful for quickly launching apps and other routines with a command prompt.
  • The Windows key + X opens the Quick Access Menu, exposing system functionality such as the Command Prompt, Disk Management, File Explorer, Run, and more. Alternatively, you can right-click on the bottom right corner of the screen to spawn the Quick Access Menu.
  • The Windows key + I opens the settings menu, giving you quick access to the Control Panel, Personalization, and your Power button, among other features.
  • The Windows key + O locks orientation on devices with an accelerometer.

Windows 8 keyboard shortcuts

Posted by : Stranger
Date :Friday, January 18, 2013
With 3comments
Tag :
Prev
▲Top▲