Lumia 930 – 1 week on #ConnectsTrial

For good part of last 6 months, I ensured that I took a moment to bug @Connects team w.r.t Lumia 930. Of course it wasn’t available back then.. they knew it, I knew it but that had to be done. I even reminded them that they never sent me a 1520 to review :) and I suppose it worked :)

On 14th of this month, I got an email stating that they have 930 and I could be the first one to get my hands on it.. quickly filled out the form.. bang bang.. they dispatch the device the next day. I patiently waited good part of the morning for DHL to bring it in… At noon, I get an email stating package awaiting to be collected!!

The packaging isn’t brick box like earlier Lumia models but a flatter version like the one for Lumia 630.. I suppose this is the packaging for gen 2 devices.
930-Pic1 930-Pic2 930-Pic3 930-Pic4

The device is striking.. even without switching it on that much is clear.. the screen reminds me of Lumia 800′s curved glass and it is ever so slightly curved. The aluminium and the back shell remind me of Lumia 925 but its significantly flatter.. in fact the dimensions of 930 are about the same as Nexus 5. The back is tapered to give a feeling of thinness. I am not a big fan of green but I’d take the green or orange models instead of white or black ones. The green gives a nice neon lightening effect on a white table.. it is remarkably pleasant.

The first thing I did after powering it on was restored a Lumia 1020 backup on it. The device did warm up during this time and while all Lumia devices do warm up, I think aluminium chassis aids heat flow. The AMOLED display is just gorgeous.. At 441 dpi, it is significant ahead of any other devices out there oh and its full HD – 1080p. The device use Snapdragon 800 chipset and comes with 2GB of RAM. The outcome, its snappy.

It comes with 20MP CMOS as opposed to 40MP CMOS in Lumia 1020 but the combination of faster SoC and smaller CMOS means that taking pictures is a pleasure.. Here is a test capture showing speed differences.. both 1020 and 930 are set on 10 second delay.. I have tried best to tap at same time

the lens in 930 is wide though not as much as that of 1020. min focus distance is similar to that of Lumia 1020. You can view some of the pictures I have uploaded and judge for yourself

https://www.facebook.com/media/set/?set=a.10152213561226921.1073741827.543056920&type=1&l=d8d7d8ce45

The battery life is similar to that of Lumia 1020.. my usage gives me just enough to last through the day. I have occasionally seen it warming up but I think a firmware might be due to fix that issue. Another side note, on a white background, I have seen the screen flicker a bit.. again a firmware update should sort that out.

I did power my 1020 a few times and I find it offensively slow and laggy. except for the 40 MP sensor I don’t cant think of anything that would pull me back.. I would trade it all in for a Lumia 930. Infact I am seriously thinking how on earth are @Connects team planning to get this device back.. they really think I am joking.. sigh.. I suppose they are in for a surprise :)

 

App tile transparency for WP8.1 apps #wpdev

One of my popular lines is “Don’t throw shit around.. what goes around comes around!” and rightly so. A few weeks back I was making fun of @dvlup for blogging about how to create transparent tiles for the WP apps :)

I know the irony isn’t lost on me. The idea is with WP8 apps, you create tile images which are transparent png with white bits.. if you had a star or a clock that would be white, the rest would be transparent and you used this. This would make your app’s tile transparent and if you had a fancy background, you would see through the tile.

Fast forward today, I was testing WP8.1 update to my alarm clock app. What does it do ? well shows you tile update every minute with a nicely rendered tile. and yes I made the tile transparent. But the tile comes up as grey.. WTH

alarmclock1

so I start looking around and I remember that Windows 8 app manifest had a background color, Open the Package.appmanifest and I find this

<m3:VisualElements
    DisplayName="AlarmClock"
    Square150x150Logo="Assets\SquareTile150x150.png"
    Square44x44Logo="Assets\Logo.png"
    Description="AlarmClock"
    ForegroundText="light"
    BackgroundColor="#464646">

hmmm no alpha value to make it transparent. So I tried to set BackgroundColor to Transparent.. nope.. transparent ? Bingo!!

<m3:VisualElements
    DisplayName="AlarmClock"
    Square150x150Logo="Assets\SquareTile150x150.png"
    Square44x44Logo="Assets\Logo.png"
    Description="AlarmClock"
    ForegroundText="light"
    BackgroundColor="transparent">

alarmclock2
Now if you used transparent png for tiles, your WP 8.1 app’s tiles are transparent.

Image scaling related crashes on 1080p devices #wpdev

Back in March one of the 1Shot camera app users emailed me stating that the app crashes when using he uses digital zoom on Lumia 1520. I couldn’t reproduce the issue on my 1020. I then borrowed a friend’s 1520 and hmm sure I could reproduce it but I couldn’t catch the exception.

So we left it at that.. fast forward on Friday I get a mail back from chap in question and he states that he’s running latest greatest version of preview and the freaky crash is still happening. Luckily I have the 1520 at my desk and decided to put it to good use over the weekend.

So I put VS configuration in Debug mode and I set VS to catch all thrown exceptions. Run app and swipe left right and top bottom and every so often the app crashes.. no exception being caught.. the app just disappears and we are back to home screen. The only clue was the output of debug mode.. The program ‘[4880] AgHost.exe’ has exited with code -1073741819 (0xc0000005) ‘Access violation’.

The sad reality, the debug output is littered with messages starting ‘AgHost.exe’ (CoreCLR: Silverlight AppDomain): A quick check on the net showed that AgHost.exe is used to manage access through identity verification.. great. The error code wasn’t particularly useful either.

In this particular case, the error only occurred when zooming in. My implementation of digital zoom was scaling the preview image for the live view. The only action associated with crash was zooming in and out. As it happens, I detect manipulation delta and compute scale..

private void LivePreviewTapTarget_ManipulationDelta(object sender, System.Windows.Input.ManipulationDeltaEventArgs e)
{
    if (!this.viewModel.CaptureInitiated && AppSettings.InternalAppSettings.DragZoom)
    {
        SetDragToScale(e.CumulativeManipulation.Translation);
        e.Handled = true;
    }
}

void SetDragToScale(System.Windows.Point pScale)
{
    double x = Math.Abs(pScale.X);
    double y = Math.Abs(pScale.Y);

    double manipulation = x > y ? pScale.X : pScale.Y;

    bool zoomOut = manipulation >= 0 ? false : true;

    double scale = (this.viewModel.HasHighResolutionCamera ? 0.01 : 0.005) * Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));

    if (zoomOut)
        this.viewModel.ViewScale = initialScale + scale;
    else
        this.viewModel.ViewScale = initialScale - scale;

    System.Diagnostics.Debug.WriteLine("zoomout {0}, scale {1}", zoomOut, scale);
}

My initial thought was that it being a newer SoC, the Xaml Renderer was somehow being proactive somewhere and getting itself in a mess.

Test 1: show less frames and show larger jumps so there is less rendering. For High Res camera I used constant of 0.01.. increase it to 0.05.

The resultant build crashed very very fast. hardly took a swipe or two to head back to home screen.

So I wanted to try the reverse but by laptop decided to shutdown and I was too knackered to continue yesterday.
Earlier today I had a chat with Bill Reiss.. he mentioned that he had some problems with 1520 too and that it had something to do with how large the image becomes on 1080p screen.

So I decided to continue where I left yesterday but with a reduction only for 1080p devices.
Test 2: reduce the multiplication constant to 0.0015 if a 1080p device is detected.
Result: Significant reduction in crashes.. I can still get it to crash but not that often. Here is the changed version

int DeviceScaleFactor = -1;
private void GetScaleFactor()
{
    object physicalScreenResolutionObject;

    if (DeviceExtendedProperties.TryGetValue("PhysicalScreenResolution", out physicalScreenResolutionObject))
    {
        var physicalScreenResolution = (Size)physicalScreenResolutionObject;

        DeviceScaleFactor = (int)(physicalScreenResolution.Width / 4.8);
    }
    else
    {
        DeviceScaleFactor = Application.Current.Host.Content.ScaleFactor;
    }
}

void SetDragToScale(System.Windows.Point pScale)
{
    double x = Math.Abs(pScale.X);
    double y = Math.Abs(pScale.Y);

    double manipulation = x > y ? pScale.X : pScale.Y;

    bool zoomOut = manipulation >= 0 ? false : true;

    if (this.DeviceScaleFactor == -1)
    {
        this.GetScaleFactor();
    }

    double scale = (this.viewModel.HasHighResolutionCamera ? 0.01 : 0.005) * Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));

    if (DeviceScaleFactor == 225)
    {
        scale = 0.0015 * Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));
    }

    if (zoomOut)
        this.viewModel.ViewScale = initialScale + scale;
    else
        this.viewModel.ViewScale = initialScale - scale;

    System.Diagnostics.Debug.WriteLine("zoomout {0}, scale {1}", zoomOut, scale);
}

if the Device scale factor is 225, its a 1080p device and one should exercise caution.

My thoughts on Lumia 630

Towards the end of May 2014, Microsoft Mobile aka Nokia Devices released their first / last windows phone device. Its was different on many scales – it was the first device to feature Windows Phone 8.1 – Windows Phone Blue. Prior to that only developers had access to the Blue builds thanks to the Dev Preview Program.

Thanks to @Connects team I had a Lumia 630 at my desk on 2nd June.
 1Shot_20140602_100914 1Shot_20140624_143725

It comes in a very compact box as compared to previous Lumia devices. The colour of the device I got was gorgeous orange. Its very bright and nice at the same time. This is the first device that my daughter wanted.. She has played with a variety of Lumia devices before - 800, 620, 820, 920, 925 and 1020 (cyan, black, yellow, white & silver) and never asked for one

The device resembles previous Lumia devices in terms of over all layout. Micro USB at the bottom, the power and volume buttons on the side. Headphone jack at the top. The few missing ones at the camera button and hardware buttons for back, windows and search. Soft buttons make appearance when the screen is powered and provide haptic feedback. Camera can be launched by using camera app or by pinning camera to notifications bar – quick launch area.

1Shot_20140624_143858 1Shot_20140624_143939

Hardware:

  • Quad core Snapdragon S400 1.2GHz
  • 4.5 inch IPS LCD display with Gorilla Glass 3.
  • 5MP rear camera
  • 512MB RAM

It does not come with Ambient Light Sensor, Proximity Sensor or Front facing camera. Rear camera does not have flash of any sorts. Even Lumia 520 shipped with Ambient Light Sensor and Proximity sensors. 620 had LED flash to go along. Not this one. Lack of ambient sensor means no automatic brightness control – you need to manually keep a lid on it.. With camera and brightness control occupying 2 of the 4 quick launch buttons, you’d start wishing for more.

The only hardware issue I had was that it refused to see my home Wi-Fi network. I have it set on 802.11n which works fine on Lumia 920 / 925 and 1020 but not on 630.. oh well. Camera is okay for most  casual snappers – simple 5MP snapper.

Its not a bad device – most apps start just fine. The processor handles most tasks easily. 512MB RAM limitation however does hit many apps and games and there’s just nothing you can do about it. This device would have fit perfectly to match Moto E and Moto G devices with other low-end devices adding to the mix.

However I have been disappointed to an extent.. the device isn’t available at advertised £89.99. Recently MicroMax India announced 2 Windows phone device that will be priced better than Lumia 630. Both of these devices run Snapdragon 200 (Dual core) with 1GB RAM. Beyond the hype, most should go for larger memory than more cores. Earlier today morning Microsoft launched Nokia X2 – the 2nd iteration of the android line up. Spec-wise even that has a better setup than 630 and is priced lower.

From being happy about a decent low-end device, today I am left unsure about what’s its place would be in the market. Nokia Lumia 520 captured 30% of Windows Phone market in a month and helped Windows Phone in many markets. I am not so sure of 630.. lets hope Microsoft Mobile has more tricks up its sleeves.

1Shot_20140624_143908 1Shot_20140624_144042

 

 

 

Cineworld – Transparent tiles and Uri Schema

Traditionally Windows Phone allowed Tile images to be transparent or otherwise. With advent of Windows Phone 8.1 and start screen background, devs are pretty hyped up about using transparent images.

For once I myself received a request for cineworld app. so the cycle tile is been done away with (if you have it pinned, cycle tile will continue to update as was before.. ) if you repin you get flip tile with primary background transparent.

I was also asked for Uri Schema for cineworld app. I have added 3.

cineworld:film?1234

cineworld:cinema?22

cineworld:search?xmen days of

the film uri schema takes EDI value.

Where did the SystemTray vanish with #WinPRT #wpdev?

With Silverlight WP8 API, SystemTray is exposed in PhoneApplicationPage through Microsoft.Phone.Shell.

<phone:PhoneApplicationPage
    shell:SystemTray.IsVisible="True" 
    shell:SystemTray.BackgroundColor="AliceBlue"
    shell:SystemTray.ForegroundColor="Black"
    shell:SystemTray.Opacity="0.75">
    <shell:SystemTray.ProgressIndicator>
        <shell:ProgressIndicator />
    </shell:SystemTray.ProgressIndicator>
</phone:PhoneApplicationPage>
SystemTray.BackgroundColor = Colors.Cyan;
SystemTray.ForegroundColor = Colors.White;
SystemTray.IsVisible = true;
SystemTray.Opacity = 0.8;
SystemTray.ProgressIndicator = new ProgressIndicator() { IsIndeterminate = true, IsVisible = true };

it was very easily done through xaml itself. You could do it from codebehind by accessing static properties of SystemTray class.
However with WinPRT, the Page class does not expose SystemTray and now it lives as Windows.UI.ViewManagement.StatusBar.
No xaml declarative business here.

var statusBar = StatusBar.GetForCurrentView();
statusBar.BackgroundColor = Colors.Black;
statusBar.BackgroundOpacity = 0.8;
statusBar.ForegroundColor = Colors.White;
statusBar.ProgressIndicator.Text = "loading";
await statusBar.ShowAsync();

If I find anything declarative, I will post those at a later date.

Backbutton handling with #winprt and Windows Phone 8.1 #wpdev

Back with WP8 and Silverlight API, handling hardware back button was easy peasy. By default, PhoneApplicationPage exposed an eventhandler called BackKeyPress. Developers could chose to subscribe to this event handler and handle the back button.

<phone:PhoneApplicationPage shell:SystemTray.IsVisible="True" BackKeyPress="PhoneApplicationPage_BackKeyPress">
...
...
...
</phone:PhoneApplicationPage>
private void PhoneApplicationPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
{
    if (this.DrawingCanvas.Visibility == System.Windows.Visibility.Visible)
    {
        this.DrawingCanvas.Visibility = this.ColorSlider.Visibility = System.Windows.Visibility.Collapsed;
        this.piWords.IsLocked = false;
        e.Cancel = true;
    }
}

As you can see, in the back key press, I check to see if certain view is being shown and if so, I hide it that rather than navigating page backstack.

That was Silverlight / WP API.. how would we do that in WP8.1 / WinPRT API ?
Windows.Phone.UI.Input namespace contains a class called HardwareButtons. just remember this is WP8.1 WinPRT API only – not supported on Windows store apps. Sadly no XAML wiring up.. lets go to codebehind and subscribe to it


public MainPage()
{
    this.InitializeComponent();

    this.NavigationCacheMode = NavigationCacheMode.Required;

    HardwareButtons.BackPressed += HardwareButtons_BackPressed;
}

void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
{
    if (some_condition)
    {
        e.Handled = true;
    }
}

That’s about it.. thank goodness I still have Dev preview documentation lying around :)