Keep iPhone from sleeping

To stop your app from timing out and going to sleep you can use:
[UIApplication sharedApplication].idleTimerDisabled = YES;

This will, obviously, disable the idle timer and stop your iphone from automatically going into sleep mode.

Note: To re-enable the idle timer when you no longer need to keep the phone awake (generally after that view has been removed) using:
[UIApplication sharedApplication].idleTimerDisabled = NO;

Open URL in Browser for Windows Phone 8

using System;
using Microsoft.Phone.Tasks;

WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("http://msdn.microsoft.com", UriKind.Absolute);
webBrowserTask.Show();

Get Windows Phone Screen Size and Scale Factor

using System.Windows;  
public void GetScreenResolution()  
{  
     double w = Application.Current.Host.Content.ActualWidth;  
     double h = Application.Current.Host.Content.ActualHeight;  
     int scale = Application.Current.Host.Content.ScaleFactor;  
}

The following is an overview of the current characteristics of all these properties:
 WVGAHDWXGA
ActualWidth480480480
ActualHeight800853800
ScaleFactor (%)100150160
Resulting Size (Width/Height x Scale)480x800720x1280768x1280

Debug or Print Log in Windows Phone 8

System.Diagnostics.Debug.WriteLine("")

You can debug the native code in the windows phone Runtime Component by selecting the native debug engine for the UI Task. in this case you will also get the debug output.

to select the native debug engine for UI Task

1. Go to debug property page by right clicking on the project and selecting the "properties" menu followed by selecting the "Debug" tab.

2. Under the "UI Task" there is a drop down. select "Native Only"