Friday, September 12, 2014

Why do you need to use a VPN?

Here are three words for you: Virtual Private Network (more commonly referred to as VPN). If you've never heard of the term, or aren't sure about its exact nature in our info tech world, then chances are you've never utilized one. A VPN is facilitated for several reasons, by individuals and the business sector alike. Anyone who initiates one for their time on the internet will have a variety of reasons. They can vary according to the individual’s needs and wants;  scaling from minimal personal usage to access international television programs not available in their region, to encryption and security during time spent in cyberspace. In essence, a VPN is used to secure and encrypt communications when using an untrusted network which is in the public domain.

The latter is the more common theme. In this day and age where big brother seems to lurk in every corner of our internet browser, more and more people, and companies, are resorting to the use of a VPN provider. In fact, as people are educating themselves on the realms of the digital jungle that is fast becoming a second home, the VPN is becoming a common household name. And why not? With hackers at the ready to steal your sensitive information, and government regimes watching and monitoring your every move, the VPN is now an essential addition to add to our daily internet rituals. In essence, public networks are cesspits, and if we dwell in them too long, without the correct protective elements, then we tend to ‘pick up’ those bugs which dwell in them.

When you use a VPN, the usual presentation is to launch a VPN client on your personal computer. You log in; your computer then “exchanges trusted keys with a server,” and once both systems have been authentically verified, your communication on the internet is secure.

However, not all VPNs are created equally. When searching for the right VPN for your own use, it is important to know what it is you are signing up for, and who with. You need to take into consideration connectivity protocols, features and server locations. The best VPNs will offer a good selection on these criteria. Most importantly, the VPN Provider should have a so called ‘no-logging policy’ which ensures that no user activity will be logged.

You need to be aware of other considerations such as trusting your provider with your data. In other words, what do they log? Everything outside of your VPN server is secure from eavesdropping, but those sharing the same provider may have access to your data. Some VPN providers keep logs in case a government requests them, so decide what is acceptable to you when it comes to logging. 

Wednesday, September 10, 2014

Apple’s first crack on the release!

Let’s start with some general observations that apply to both the iPhone 6 and the iPhone 6 Plus. The iPhone 5 and 5S both had flat fronts, sides, and backs with well-defined edges, but those are gone in the iPhone 6. The glass on the front now curves down slightly all the way around the edge to meet the newly-curved sides and back of the phone. It sort of recalls the iPhone 3G or 3GS, which had similar curves but used plastic all the way around instead of aluminum and glass. 

The back of the phones are made out of aluminum with some clearly visible cutouts made to allow wireless signals in and out. The design as a whole is more reminiscent of the 2012 iPod Touch than current iPhones, an observation that extends to the slightly protruding camera lens. You won’t notice this bulge if you keep your phone in a case or sit it on a soft surface, but if you set the phone on a hard table it definitely will wobble a bit in place. Both phones feel lighter than you’d expect them to—4.55 ounces for the 6 and 6.07 ounces for the 6 Plus, compared to 5.64 ounces for the 5-inch HTC One M8 or 5.08 ounces for the new Moto X—but they still feel as sturdy as you’d expect from an Apple product.

The new screen is the star of the show here—the iPhone 6 has a 1334×750 display that retains the 326 PPI density of older Retina iPhones, it just fits more on the screen at once than the iPhone 5 or 5S can. All apps that have been optimized for the larger display can show more stuff at once than they could before, which is obvious if you open Safari or even the Settings app. Icons and buttons remain the same size they were before, in accordance with Apple’s best practices for app design—the Home screen can fit one additional horizontal row of icons than the iPhone 5 can, but you can still only fit in four icons per row.

To make one-handed usage easier on both phones, Apple has introduced a feature called “Reachability.” Double tap the TouchID button and the contents of the screen will shift downward, letting you reach the top half of your app’s contents even if you can only reach the bottom half of the phone’s actual screen. Once you’ve entered Reachability mode, you can also pull down from the top of the “window” to bring up the Notification Center.

We suspect that many iPhone 6 users (especially iPhone 6 Plus users) will simply adjust to using two hands more often with their iPhones, possibly without even realizing it. But Reachability feels like something best used only when you don’t have that option, rather than a great, easy way to handle all your navigation.

Sunday, July 20, 2014

BitLocker issues for Windows Phone Cyan Update

The Lumia Cyan Update has only just started rolling out for the Lumia 625 and Lumia 925, but already we're seeing some of the first bugs come to light. According to a lengthy thread on the Nokia support forum, consumers are experiencing issues after upgrading their Lumia Windows Phones running the 8.1 Preview for Developers and using BitLocker full disk encryption.
The BitLocker encryption appears to cause the smartphone to hang on boot, making it unusable. All that's presented to the user is a message to connect the device to a PC. Luckily, there's a solution, but it requires a full reset the Windows Phone using Nokia's software suite.

To recover this drive, plug in the USB drive that has the BitLocker recovery key:

BitLocker needs your recovery key to unlock your drive because the trusted platform module is not accessible.

For more information on how to retrieve this key, go to http://windows.microsoft.com/recoverykeyfaq from another PC or mobile device.

Press Enter to Reboot and try again

Press Esc or the windows key for other recovery options"

As noted above, there is a solution to this problem, which is to completely reset the device using Nokia's software recovery suite. This should return everything back to normal. According to reports on the same thread (as well as elsewhere), those who upgrade from Windows Phone 8.0 Update 3 to Windows Phone 8.1 and Lumia Cyan have no issues.

It is important to note that regular consumer level devices are not having this problem as BitLocker is an optional security tool enabled through corporate device policies. Although this may be a headache for an IT department, it should not affect the majority of consumers. Indeed, Windows Phone Central has not been flooded with tips on this yet.
 

Wednesday, June 18, 2014

Pinch To Zoom functionality in Windows Phone

If you're building a WP8 exclusive app you can use the new ManipulationDeltaEventArgs.PinchManipulation for pinch & zoom effects. Here's a basic example of how to use ManipulationDeltaEventArgs.PinchManipulation data to scale, move and rotate an image.
 
First, we'll create a basic image hovering in the middle of a grid:
 
<Grid x:Name="ContentPanel">
<Image Source="Assets\Headset.png" Width="200" Height="150" ManipulationDelta="Image_ManipulationDelta" x:Name="img" >
<Image.RenderTransform>
<CompositeTransform CenterX="100" CenterY="75" />
</Image.RenderTransform>
</Image>
</Grid>
 
Next, we'll handle the ManipulationDelta event, check if it's a Pinch Manipulation and apply the correct Silverlight transformations on our UIElement.
 
private void Image_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
{
if (e.PinchManipulation != null)
{
        
var transform = (CompositeTransform)img.RenderTransform;
 
// Scale Manipulation
transform.ScaleX = e.PinchManipulation.CumulativeScale;
transform.ScaleY = e.PinchManipulation.CumulativeScale;
 
// Translate manipulation
var originalCenter = e.PinchManipulation.Original.Center;
var newCenter = e.PinchManipulation.Current.Center;
transform.TranslateX = newCenter.X - originalCenter.X;
transform.TranslateY = newCenter.Y - originalCenter.Y;
 
// Rotation manipulation
transform.Rotation = angleBetween2Lines(
e.PinchManipulation.Current,
e.PinchManipulation.Original);
 
// end
 
e.Handled = true;
 
}
}
 

public static double angleBetween2Lines(PinchContactPoints line1, PinchContactPoints line2)
{
if (line1 != null && line2 != null)
{
double angle1 = Math.Atan2(line1.PrimaryContact.Y - line1.SecondaryContact.Y, line1.PrimaryContact.X - line1.SecondaryContact.X);
double angle2 = Math.Atan2(line2.PrimaryContact.Y - line2.SecondaryContact.Y, line2.PrimaryContact.X - line2.SecondaryContact.X);
return (angle1 - angle2) * 180 / Math.PI;
}
else
{
return 0.0;
}
}



Scaling: PinchManipulation actually tracks scaling for us, so all we had to do is apply PinchManipulation.CumulativeScale to the scaling factor.

Transform: PinchManipulation tracks the original center and the new center (calculated between the two touch points). By subtracting the new center from the old center we can tell how much the UIElement needs to move and apply that to a translate transform. Note that a better solution here would also account for multiple Manipulation sessions by tracking cumulative original centers which this code doesn't.

Rotation: We figured out the angle between the two touch points and applied it as the rotation transform.
 
 

Monday, June 9, 2014

Find listbox item after tap and hold

First, make sure to put your gesture listener not under the ListBox itself, but in the top level container of the ListBox's data template (the StackPanel in this example):


<ListBox>  
    <ListBox.ItemTemplate>  
        <DataTemplate>   
            <StackPanel>   
                <toolkit:GestureService.GestureListener>   
                    <toolkit:GestureListener Hold="ListItem_Hold"/>   
                </toolkit:GestureService.GestureListener>   
                <TextBlock Text="{Binding LineOne}"/>   
                <TextBlock Text="{Binding LineTwo}"/>   
            </StackPanel>   
        </DataTemplate>  
    </ListBox.ItemTemplate>  
</ListBox> 

In the Hold event handler, the sender will be the StackPanel of the current ListBoxItem. The DataContext of the StackPanel is the view model item (it is like listbox.SelectedItem when an item is selected, however note that a hold gesture won't actually cause an item to be selected).

private void ListItem_Hold(object sender, GestureEventArgs e) 
        { 
            // sender is the StackPanel in this example 
            var holdItem = (sender as StackPanel).DataContext; 
 
            // holdItem has the type of the view model 
        } 

Sunday, June 8, 2014

Clearing backstack in NavigationService

You can use NavigationService.RemoveBackEntry:
For instance, to remove all entries from the stack:
while (this.NavigationService.BackStack.Any())
{
   this.NavigationService.RemoveBackEntry();
}

Also, if you want to remove only the previous page after checking its URI:
var previousPage = this.NavigationService.BackStack.FirstOrDefault();

if (previousPage != null && previousPage.Source.ToString().StartsWith("/MainPage.xaml"))
{
    this.NavigationService.RemoveBackEntry();
}

Friday, June 6, 2014

Watermark effect on a TextBox in Windows Phone

You need to use PhoneTextBox from windows phone toolkit for this.
  1. You can download it from here.
  2. You can also directly add it to your project by typing the following into your package manager console :
    PM> Install-Package WPtoolkit
Now, add a reference of toolkit inside "phone:PhoneApplicationPage" tag in the xaml page as follows: xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
Finally, use PhoneTextBox control....
<toolkit:PhoneTextBox Hint="Username"/>

Hope it helps :)

Monday, April 28, 2014

Error 0×80080008 While Updating Windows Apps In Windows 8

Windows Update plays a significant role in proper functionality of Windows Apps. So if you’re going to update an app, it basically uses the Windows Update resources to get the update. Due to this correlation, if something goes wrong with Windows Updates, it gets reflected as an error with apps. Till now, we have seen fixes for different errors related to Windows Apps and each fix was unique of its kind. Today, I'm going to share you the possible workaround for the error 0×80080008 while updating Windows.

1. Press Windows Key + R, type notepad to open Notepad.

FIX Error 0x80080008 While Updating Windows Apps In Windows 8 1 FIX : Error 0x80080008 While Updating Windows Apps In Windows 8

2. Copy and paste following commands in Notepad:
REGSVR32 WUPS2.DLL /S
REGSVR32 WUPS.DLL /S
REGSVR32 WUAUENG.DLL /S
REGSVR32 WUAPI.DLL /S
REGSVR32 WUCLTUX.DLL /S
REGSVR32 WUWEBV.DLL /S
REGSVR32 JSCRIPT.DLL /S
REGSVR32 MSXML3.DLL /S
FIX Error 0x80080008 While Updating Windows Apps In Windows 8 2 FIX : Error 0x80080008 While Updating Windows Apps In Windows 8

3. Now save the Notepad file with your desired file name but give it asformat of .bat e.g. register.bat. Select the Save as type as All Files. Right click on this file and select Run as administrator. If you are prompted for an administrator password or for confirmation, type the password, or click Yes.

FIX Error 0x80080008 While Updating Windows Apps In Windows 8 3 FIX : Error 0x80080008 While Updating Windows Apps In Windows 8

You’ll see the Command Prompt processing the commands. After successfully executing commands you should reboot and re-try to update your pending apps, this should work fine now.
Hope this helps!

 

Tuesday, February 18, 2014

How to send automated emails with attachments from Windows Phone apps

Step1: Download the LiveMailMesage tool (note that it comes with a FREE trial) and add references to your Windows Phone application project.

Step2: Create a new LiveMailMesage object:
 
LiveMailMessage mailMessage = new LiveMailMessage();

Step3: Set a Live/Hotmail account needed to connect to Microsoft Live SMTP mail server:
 
 
mailMessage.MicrosoftAccountEmail = myMicrosoftAccountEmail ;
mailMessage.MicrosoftAccountPassword = myMicrosoftAccountPassword;

Step4: Set some mail data:
 
 
 
mailMessage.To = myTo;
mailMessage.Subject = mySubject;
mailMessage.Body = myBody; //accepts text or HTML

Step5:  Add some attachments (max attach limit size currently is 50MB) , note that you can also use different  resources or a IsolatedStorage path:

 
 
 
 
mailMessage.AddAttachment("\resources\file.jpg");
mailMessage.AddAttachment("\rex\file.wav");
mailMessage.AddAttachment("\myFolder\file.mp3");
mailMessage.AddAttachment("\downloads\file.mp4");
 
Step6: Set message event handlers (send operation is asyncronous and not UI blocking)
 
 
 
mailMessage.Error +=  mailMessage_Error;
mailMessage.MailSent += mailMessage_MailSent;
mailMessage.Progress += mailMessage_Progress;

Step7:  Send email (async, runs on a separated thread) :
 
mailMessage.SendMail();

Tuesday, February 11, 2014

Enable NuGet package restore in Visual Studio

Having a build process for each solution is very useful, but we can have some errors like these:
  • C:\Builds\[…]\.nuget\nuget.targets(76,9): error : Package restore is disabled by default. To give consent, open the Visual Studio Options dialog, click on Package Manager node and check ‘Allow NuGet to download missing packages during build.’ You can also give consent by setting the environment variable ‘EnableNuGetPackageRestore’ to ‘true’.
  • C:\Builds\[…]\.nuget\nuget.targets(76,9): error MSB3073: The command “”C:\Builds\[…]\.nuget\nuget.exe” install “C:\Builds\[…]\packages.config” -source “” -o “C:\Builds\[…]\packages”" exited with code 1.
We use NuGet in Visual Studio 2012 RC with TFS 2012 RC: we want to enable missing NuGet packages restoring and we would prefer to not check-in packages into source control. So, in Visual Studio Solution Explorer, right click on solution and click on “Enable NuGet Package Restore”:

Solution: Enable NuGet Package Restore

Do you want to configure this solution to download and restore missing NuGet packages during build? Yes, of course:
NuGet Package Manager: Enable NuGet Package Restore

A .nuget folder is added to the root of the solution.
NuGet Package Manager: finished configuring this solution to restore NuGet packages on build

 

Monday, February 10, 2014

I/O Device Error

What Are the Common I/O Device Error Messages?

Unfortunately, the I/O device error can generated more than one error message. Some of the most commonly encountered messages associated with the error include:
-          The request could not be performed because of an I/O device error
-          Only part of a readprocessmemory request was completed
-          Only part of a writeprocessmemory request was completed

Windows may display a “Windows error code” along with the plain language error message. The I/O device error codes that are associated with the error include: error 6, error 21, error 103, error 105, and error 131.

Why Does the I/O Device Error Occur?

There are a number of potential causes for I/O device errors on computers that run the Windows Operating System (OS). These include:
-          Outdated or corrupt driver installation for the affected hardware device.
-          Windows using an incompatible transfer mode for the hardware.
-          Faulty or loose connection with the hardware.
-          The portable media (CD, DVD, or SD card) is damaged or excessively dirty.

Basic I/O Device Error Troubleshooting

Before throwing away a “faulty” CD/DVD, or delving into more complex troubleshooting, there are some basic steps computer users can attempt to clear the I/O device error. If the steps do not solve the issue, they may help pinpoint what is causing the error to be thrown and save time in fixing the issue.

Step 1 – Restart the computer that is throwing the I/O device error.

Step 2 – Attempt to access the disk, drive, or portable media again.

Step 3 – If the error is still being thrown, try to access the disk on another computer (if available). This will help identify if the error is with the drive, IDE channel, or media (disk) itself.

Step 4 – If the disk/media opens on the alternative computer, there is an issue with the primary PC (drive, IDE, or connection). If it does not, there could be a problem with the media itself or IDE channel. If you do not have another computer available and the error is being thrown when attempting to read a CD/DVD or SD card, insert a different disk or card into the respective computer’s drive to see if it can be read. If it works, then the issue is with the disk/drive/device you are trying to use. If not, then it is with the IDE, drive, or connection on your primary computer.

How to Check Hardware Connections

Loose drive or hardware connections are a common cause of the I/O device error.

Step 1 – If the device throwing the error is an external hard drive, reseat the USB or fire wire connection to your computer.

Step 2 – If the error persists, connect the drive to an alternative USB port on the computer. If you are using a USB hub, connect the drive directly to one of the computer’s USB ports.

Step 3 – Obtain a replacement cable for the drive and reconnect to the computer.

Step 4 – Attempt to read or write to the drive or disk again. If the error continues to be thrown, the connection is not the likely cause of the problem. If you suspect the problem is with the internal hard drive on your computer, attempting to reconnect the drive is not recommended for the casual user as significant damage can result to the computer if the task is conducted improperly.

Change the IDE Channel Transfer Properties

Another cause of the I/O device error is that Windows has the transfer mode for the drive or device set incorrectly. The transfer mode can be changed or corrected by the end-user if logged in to the computer in administrator mode.

Step 1 – Select the “Start” menu button and then right click the “My Computer” icon.

Step 2 – Choose the “Manage” menu option on the subsequently displayed menu. Then, click or choose the “Device Manager” menu option located beneath the “Computer Management” window.

Step 3 – Select the menu icon to expand the “IDE ATA/ATAPI” controller display. There will be one or many listings for IDE ATA/ATAPI channels available on the computer.

Step 4 – Right click the channel that corresponds to the drive that is throwing the I/O device error. If you can’t determine which IDE channel is the appropriate one for the error being thrown on your computer choose the one labeled “Secondary IDE Channel.”

Step 5 – Select the “Properties” menu option followed by opening the “Advanced Settings” menu tab.

Step 6 – Choose the “PIO Only” menu option located in the “Transfer Mode” box. This will be the device corresponding for the drive throwing the error. On most computers, the correct option will be “Device 0.” Ensure you do not change the Primary IDE Channel Device 0 when manipulating the IDE properties since this is normally the system disk. Modifying the transfer mode for this disk can result in the Windows OS failing to work properly. On computers running the Windows 7 OS, uncheck the “Enable DMA” menu option to disable DMA. This is equivalent to the “PIO Only” setting on older versions of the Windows OS.

Step 7 – Select or click the “Ok” menu button and exit the configuration applications. On the Advanced Settings tab, select PIO Only in the Transfer Mode box for the device that represents the appropriate drive. Typically, this is Device 0. Then, click OK and exit all windows.

Step 8 – Restart your computer and test the drive or device that is throwing the I/O device error.

Step 9 – If the device or drive does not work after restart, then it may not be located under the secondary IDE channel device 0. If this is the case, change device 0’s transfer mode back to DMA, and repeat the process for the Primary IDE channel device 1 and then the Secondary IDE channel device 1 if the primary does not work (remembering not to change the Primary IDE channel device 0). After each change, restart the computer.

Verify the Status of the Device in Windows Device Manager

If changing the IDE channel device settings does not work, the drive status can be verified and troubleshoot via Windows Device Manager.

Step 1 – Select the “Start” menu and then click the “Control Panel” menu option.

Step 2 – Choose the “Performance and Maintenance” menu choice and then click the “System” menu option.

Step 3 – Choose the “Hardware” menu tab and open the “Device Manager.”

Step 4 – Locate the device that is throwing the I/O device error by expanding the menu items under the applicable category in the device manager.

Step 5 – If you note a red “X” on the menu icon located next to the device description, the hardware periphery has been disabled by the OS.

Step 6 – Open the “General” menu tab and select the “Enable Device” menu option located beneath the “Device Status” menu section.

Step 7 – Click the “Ok” menu button and follow the default menu prompts that follow. After the enabling device wizard exits, test the disk or drive that is throwing the error.

Step 8 – If the disk or drive does not work or continues to throw the same I/O error, select the “General” menu tab and click the “Troubleshoot” menu option found under the “Device Status” section.

Step 9 – Press the “Ok” menu button and follow the menu prompts. If there is still an error displayed, then the device driver likely requires updating.

Step 10 – Select the “Driver” menu tab. Then, click the “Update Driver” menu option and follow the default OS prompts.

Step 11 – Restart the computer and test the hardware throwing the I/O error.

Thursday, January 30, 2014

How to Launch the Application Details Page in Windows Phone Store using C#?

Below is a sample code snippet that demonstrates how to use the MarketplaceDetailTask. Modify the Content Identifier to specify the app for which the details page needs to be shown.

MarketplaceDetailTask task = new MarketplaceDetailTask();

task.ContentIdentifier = "<App ID>";

task.ContentType = MarketplaceContentType.Applications;

task.Show();