Xamarin, no show images in the device but only in the simulator

In my project I have some images to display. The funny thing is I can see images in the simulator but not in a real device.

Simulator

Simulator-Screen Shot

iPhone (real device)

iPhone-Screenshot

Solution

iPhone is case-sensitive and the name of your images must be specified correctly. iOS Simulator probably is not case-sensitive and then it displays images with every name.

An error occurs with MobileCenter for Xamarin iOS

I added Microsoft Mobile Center to my project after creating the app there. On MobileCenter documentation you can know the Install Identifier for your application (MobileCenter documentation is here).

System.Guid installId = MobileCenter.InstallId;

This function is working fine if you have Android or iOS 10. With iOS less than 10 an error occurs:

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

and the StackTrace is similar to

at System.Guid+GuidResult.SetFailure (System.Guid+ParseFailureKind failure, System.String failureMessageID, System.Object failureMessageFormatArgument, System.String failureArgumentName, System.Exception innerException) [0x00030] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/referencesource/mscorlib/system/guid.cs:198 \n at System.Guid+GuidResult.SetFailure (System.Guid+ParseFailureKind failure, System.String failureMessageID) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/referencesource/mscorlib/system/guid.cs:184 \n at System.Guid.TryParseGuidWithDashes (System.String guidString, System.Guid+GuidResult& result) [0x0008f] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/referencesource/mscorlib/system/guid.cs:695 \n at System.Guid.TryParseGuid (System.String g, System.Guid+GuidStyles flags, System.Guid+GuidResult& result) [0x00115] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/referencesource/mscorlib/system/guid.cs:443 \n at System.Guid.Parse (System.String input) [0x00021] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.4.0.123/src/mono/mcs/class/referencesource/mscorlib/system/guid.cs:262 \n at Microsoft.Azure.Mobile.MobileCenter.get_InstallId () [0x0000a] in :0 \n at myInventories.Helpers.LogHelpers.SendMessageToAzure (System.String EventName, System.String PageName, System.String BaseClass, myInventories.Logs.ActionType Action, System.String MoreInfo, System.Collections.Generic.Dictionary`2[TKey,TValue] DictionaryInfo) [0x00008] in /Users/enricorossini/Projects/myInventories/myInventories/myInventories/Helpers/LogHelpers.cs:72

To avoid this error you have to check the OS version.

Implementation

In your solution you have to add in all projects Device Information Plugin (for NuGet Xam.Plugin.DeviceInfo). Then you check easily the OS version with

// check the OS version to avoid error on MobileCenter
string MobileId = "";
var osInfo = CrossDeviceInfo.Current;
if ((osInfo.Platform == Plugin.DeviceInfo.Abstractions.Platform.iOS) && 
    (osInfo.VersionNumber.Major < 10)) 
{
    MobileId = "Unknown";
}
else {
    MobileId = MobileCenter.InstallId.ToString();
}

Happy coding!

Xamarin Forms and Google Mobile Ads for iOS: update

In my previous post I explaind how to add on your application advertising. In those days Xamarin has removed from the Component Store the component called Google Mobile Ads for iOS.

Now you have to install another component called Firebase AdMob for iOS.

Firebase_admob_ios

After installed this component you can see in your Output window a similar info without see an advert in your app:

2016-11-18 11:28:14.853 WordBankEasy.iOS[11103:2250070] <Google> You must set the rootViewController property of <GADBannerView: 0x1034702c0; frame = (-10 0; 320 50); clipsToBounds = YES; layer = <CALayer: 0x174e39d40>> before loading a request.

To fix this issue you have to find before the right UIViewController. For that you can use the following code:

    UIViewController viewController = null;
    foreach (UIWindow rootView in UIApplication.SharedApplication.Windows) {
        if (rootView != null) {
            viewController = rootView.RootViewController;
        }
    }

    adView = new BannerView(size: AdSizeCons.Banner,
                            origin: new CGPoint(-10, 0))
    {
        AdUnitID = AdmobID,
        RootViewController = viewController
    };

Happy coding!

Microsoft warns iOS isn't as secure as you think

Microsoft_Cybercrime_Center

Microsoft has warned customers that iOS is no more secure than Android, contradicting commonly held beliefs about the relative security of the two platforms. The company said that recent attacks targeting iOS prove it's as vulnerable as Android.

Brad Anderson, Microsoft's corporate vice president for enterprise and client mobility, set out his views in a company blog post last week. He used the Pegasus iOS spyware, revealed last month, as an example of severe vulnerabilities present in iOS. Pegasus is capable of monitoring everything a user does on their device, leaving them vulnerable to further attack.

The malware was analysed by Lookout Security, a Microsoft partner. In its report, Lookout described Pegasus as "the most sophisticated attack we've seen on any endpoint." Since it originates from a leading iOS security firm, Anderson said the statement reveals a lot about the state of security on Apple's platform.

Anderson is attempting to challenge the trust that consumers typically place in Apple. Android threats are far more numerous and gain more widespread attention than attacks on iOS. iOS is not immune to potentially devastating malware though, in contradiction of the views of some customers. Anderson said Pegasus should be a "pretty startling wake-up call" that everyone is "under constant persistent attack" on every platform.

Microsoft executives have reportedly indicated "unwavering implicit trust" in Apple's iOS "countless times," revealing how strong the association between Apple and security has become. The belief that Apple's platform is stronger than Android appears to derive from iOS' closed nature. Because it's a more controlled ecosystem, the attack surface is lower than for Android malware.

This view is dangerous, according to Anderson. Every mobile device is at constant risk of attack, regardless of the platform it runs. "I know for a fact that all the providers of mobile operating systems go to superhuman lengths to harden their platforms and do everything they can to deliver the most secure operating system possible," said Anderson.

However, iOS, Android and Windows all have vulnerabilities that expose them to potentially devastating attacks. Some platforms are targeted more frequently than others but this shouldn't influence people to make assumptions about a platform's security. Pegasus demonstrates that even a closed ecosystem can be infiltrated by some of the most complex mobile malware ever observed.

Coming from Microsoft, Anderson's argument represents a powerful message to businesses and consumers that iOS may not be all it seems. Pegasus has proven iOS presents a viable attack vector to cybercriminals. It has also demonstrated that malware has been commercialised to the point that it's an off-the-shelf product, available for purchase from the secretive NSO Group. According to Microsoft, the idea of a single platform being more secure than others is an urban myth. In real-world terms, any device can be hacked and every user is a target.

“System.IO.FileNotFoundException” using controls from another assembly in Xamarin Forms on iOS.

I was building a Xamarin solution with my components like that:

ProjectList

All my components (PSC.Xamarin.Controls.*) are working fine in other solutions.Always fine for Windows or UWP solutions. A problem was born when I started to deployed my solutions on iOS. When on the app I opened a page with my controls I always received an error like:

FileNotFoundException

System.IO.FileNotFoundException: Could not load file or assembly 'PSC.Xamarin.Controls.BindablePicker' or one of its dependencies. The system cannot find the file specified.

I can check my references and deployment settings in all ways, it turns out there’s probably a bug in Xamarin Forms’ iOS implementation. If you use controls and only controls from a PCL or dll that does not contain other code that is called from the app, apparently Xamarin on iOS ‘forgets’ to load/deploy the assembly (or something like that). But there is a work around.

The work around is as simple as it is weird. You go the iOS app’s AppDelegate class, and you add a reference to your class(es). If this is not enough, in the FinishedLaunching function you have to add a new instance to your control as in the following example:

using System;
using System.Collections.Generic;
using System.Linq;
using PSC.Xamarin.Controls.BindablePicker;

using Foundation;
using UIKit;

namespace myInventories.iOS {
    [Register("AppDelegate")]
    public partial class AppDelegate : 
        global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate {
        public override bool FinishedLaunching(UIApplication app, 
            NSDictionary options) {
            global::Xamarin.Forms.Forms.Init();

            // initialize my components
            // this is a work around only for iOS. 
            // If you don't do that, you received an error like 
            // System.IO.FileNotFoundException
            BindablePicker temporary = new BindablePicker();

            Xamarin.FormsMaps.Init();
            LoadApplication(new App());

            return base.FinishedLaunching(app, options);
        }
    }
}

Happy coding!

Xamarin Forms and Google Mobile Ads for iOS

If you have a new Xamarin Project and you want to add an advertising, the simple way it is to use Google Admob. This implementation is only for Android and iOS.

One of the first things people think about when developing for a new platform / using a new technology is monetization; and in my case the question is: how easy is it to integrate AdMob? For Xamarin Forms the answer would be: “It depends” – it depends on luck & on the complexity of what you want to achieve; but I will detail this as we move along.

The first thing you need to do is add the required components to your projects. For this walktrough I will be using Visual Studio but it should be relatively the same when using Xamarin Studio. Here, things go separate ways for each of the platforms:

  • for Android – add the Google Play Services component
  • for iOS – add the AdMob component
  • for Windows Phone – download the SDK from here and add it as a reference

By now, you Android project should no longer be building & you should be receiving a COMPILETODALVIK : UNEXPECTED TOP-LEVEL error. To fix that, go into your Droid project properties, select the Android Options tab and then under Advanced modify the value for the Java Max Heap Size to 1G. Your project should now build without any errors.

Next, inside your shared / PCL project add a new Content View and call it AdMobView. Remove the code generated inside it’s constructor & it should look like this:

public class AdMobView : ContentView
{
    public AdMobView() { }
}

Add this new view to your page. In XAML you can do it like this:

<controls:AdMobView WidthRequest="320" HeightRequest="50" />

Make sure NOTHING interferes with the control. By nothing I mean – overlapping controls, page padding, control margins / spacing, etc. If you have something overlapping the ad control, ads will not display & you won’t receive an error, so be careful.

Android

Add a new class called AdMobRenderer with the code below. Make sure to keep the ExportRenderer attribute above the namespace, otherwise the magic won’t happen.

using WordBankEasy.Droid.Renderers;
using WordBankEasy.Views.AdMob;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ExportRenderer(typeof(AdMobView), typeof(AdMobRenderer))]

namespace WordBankEasy.Droid.Renderers {
    public class AdMobRenderer : ViewRenderer<AdMobView, Android.Gms.Ads.AdView> {
        protected override void OnElementChanged(ElementChangedEventArgs<AdMobView> e) {
            base.OnElementChanged(e);

            if (Control == null) {
                var ad = new Android.Gms.Ads.AdView(Forms.Context);
                ad.AdSize = Android.Gms.Ads.AdSize.Banner;
                ad.AdUnitId = "ca-app-pub-4381168884554284/2250461656";

                var requestbuilder = new Android.Gms.Ads.AdRequest.Builder();
                ad.LoadAd(requestbuilder.Build());

                SetNativeControl(ad);
            }
        }
    }
}

Next, you need to modify your AndroidManifest.xml file to add the AdActivity & required permissions for displaying ads: ACCESS_NETWORK_STATE, INTERNET; just like in the example below (see also http://puresourcecode.com/dotnet/post/Android-required-permissions).

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-sdk android:minSdkVersion="15" />
    <application>
    <activity android:name="com.google.android.gms.ads.AdActivity" 
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />
    </application>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

That’s it. Your Android build should now display ads inside the AdMobView content view.

iOS

This, I haven’t got the chance to test yet as I don’t have a Mac around but people say it works, so I’ve added it for reference. Same as before, just add a new class called AdMobRenderer and copy-paste the code below but before you have to add a component.

In your iOS project click on “Components” (as in the picture)

Components

and click on “Get More Components…”. Then search admob and install it.

Google-Admob-Xamarin

using Xamarin.Forms;
using CoreGraphics;
using Xamarin.Forms.Platform.iOS;
using UIKit;
using WordBankEasy.Views.AdMob;
using WordBankEasy.iOS.Renderers;
using Google.MobileAds;

[assembly: ExportRenderer(typeof(AdMobView), typeof(AdMobRenderer))]
namespace WordBankEasy.iOS.Renderers {
    public class AdMobRenderer : ViewRenderer {
        const string AdmobID = "ca-app-pub-4381168884554284/5843056458";

        BannerView adView;
        bool viewOnScreen;

        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.View> e) {
            base.OnElementChanged(e);

            if (e.NewElement == null)
                return;

            if (e.OldElement == null) {
                adView = new BannerView(size: AdSizeCons.Banner, origin: new CGPoint(-10, 0)) {
                    AdUnitID = AdmobID,
                    RootViewController = UIApplication.SharedApplication.Windows[0].RootViewController
                };

                adView.AdReceived += (sender, args) => {
                    if (!viewOnScreen) this.AddSubview(adView);
                    viewOnScreen = true;
                };

                adView.LoadRequest(Request.GetDefaultRequest());
                base.SetNativeControl(adView);
            }
        }
    }
}

Here you can receive an strange error like:

Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[AppDelegate window]: unrecognized selector sent to instance 0x7ffee9cdd4d0

Native stack trace:

0 CoreFoundation 0x000000010a12ed85 __exceptionPreprocess + 165

1 libobjc.A.dylib 0x000000010a5e3deb objc_exception_throw + 48

2 CoreFoundation 0x000000010a137d3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205

3 CoreFoundation 0x000000010a07db17 forwarding + 487

4 CoreFoundation 0x000000010a07d8a8 _CF_forwarding_prep_0 + 120

5 WordBankEasyiOS 0x0000000100bc65e4 GADiTunesMetadataForFileAtPath + 4181

6 WordBankEasyiOS 0x0000000100c2d484 hasRequiredParams + 10260

7 WordBankEasyiOS 0x0000000100bc5f06 GADiTunesMetadataForFileAtPath + 2423

8 WordBankEasyiOS 0x0000000100bc1c35 GADCategories_NSURL_GADNSURLUtilities + 4438

9 WordBankEasyiOS 0x0000000100c00fde GADDispatchAsyncSafeMainQueue + 45

10 libobjc.A.dylib 0x000000010a5e4bff _class_initialize + 679

11 libobjc.A.dylib 0x000000010a5eacc5 lookUpImpOrForward + 176

12 libobjc.A.dylib 0x000000010a5f98bb objc_msgSend + 187

13 WordBankEasyiOS 0x0000000100bbe0ff GADCategories_DFPBannerView_CustomRenderedAd + 18074

14 WordBankEasyiOS 0x0000000100bbe382 GADCategories_DFPBannerView_CustomRenderedAd + 18717

15 WordBankEasyiOS 0x0000000100bbe527 GADCategories_DFPBannerView_CustomRenderedAd + 19138

16 ??? 0x000000011d368a0e 0x0 + 4785080846

17 ??? 0x000000011d36843b 0x0 + 4785079355

18 ??? 0x000000011d364d88 0x0 + 4785065352

19 ??? 0x000000011c51bbd6 0x0 + 4770085846

20 ??? 0x000000011c51b138 0x0 + 4770083128

21 ??? 0x000000011c51b138 0x0 + 4770083128

22 ??? 0x000000011c51b138 0x0 + 4770083128

Don't worry! I received the same error and I spend a lot of time to understand and fix it. There is a workaround that seems working fine.

In your iOS project, open AppDelegate.cs and add this code:

/// <summary>
/// Gets the window.
/// </summary>
/// <returns>UIWindow.</returns>
[Export("window")]
public UIWindow GetWindow() {
   return UIApplication.SharedApplication.Windows[0];
}

A complete example of this class is:

using System;
using System.Collections.Generic;
using System.Linq;

using Foundation;
using ImageCircle.Forms.Plugin.iOS;
using UIKit;

namespace WordBankEasy.iOS {
    // The UIApplicationDelegate for the application. This class is responsible for launching the 
    // User Interface of the application, as well as listening (and optionally responding) to 
    // application events from iOS.
    [Register("AppDelegate")]
    public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate {
        //
        // This method is invoked when the application has loaded and is ready to run. In this 
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options) {
            global::Xamarin.Forms.Forms.Init();

            ImageCircleRenderer.Init();

            LoadApplication(new App());

            return base.FinishedLaunching(app, options);
        }

        /// <summary>
        /// Gets the window.
        /// </summary>
        /// <returns>UIWindow.</returns>
        [Export("window")]
        public UIWindow GetWindow() {
            return UIApplication.SharedApplication.Windows[0];
        }
    }
}

After that you can start you app and see you advertising without problem. For now :)

Happy coding!

Microsoft's new service makes app developers out of everyday employees

microsoft_powerapps_3

Work is growing increasingly mobile thanks to smartphones, but companies can have a hard time coping with demand for apps that let their workers take corporate data on the go. Mobile developers are expensive, and getting new applications tested and then pushed out to users can be a time-consuming process.

Microsoft just unveiled a new beta service on Monday that's supposed to help ease that tension by allowing anyone to build an app - no software development experience required. PowerApps combines a cloud application backend with easy-to-use tools that make creating a mobile app a drag-and-drop affair.

microsoft_powerapps_1

PowerApps applications can pull in information from a variety of data sources including Office 365, Dynamics, Google Drive, Workday and other services. Developers can also build connections for PowerApps in their own services if there isn’t a connector already available.

Once the data connection is set up, users can then start building an application interface from one of Microsoft’s pre-built templates, or plug key data into PowerApps and let the service suggest the right designs for their purposes. Those people who have a strong idea for what they want their app to look like can create it from scratch.

microsoft_powerapps_2

Once users have built the apps they want, they can then use Microsoft's service to share their newly created tools with coworkers who have the PowerApps application installed on their smartphones.

The system is currently limited to building software that runs inside the PowerApps app on mobile devices, however, so employees won’t be able to push their creations to the iOS App Store or Google Play Store. Microsoft Corporate Vice President Bill Staples said during a press briefing that Microsoft will consider feedback from its customers when determining if the company should make it possible to create standalone applications using PowerApps.

Write C#. Run JavaScript.

BridgeNet

Open Source C# to JavaScript Compiler and Frameworks. Run Your App On Any Device Using JavaScript.

Use Bridge.NET to build platform independent applications for mobile, web and desktop. Run on iOS, Windows, Mac, Linux and billions of other devices with JavaScript support. Compile your C# code into native JavaScript and deploy on Billions of devices.

Try it on bridge.net or fork it on GitHub

Apple announces iOS 9, release later this year

apple-wwdc-20150044Apple has just announced the next version of iOS, unsurprisingly called iOS 9. With the latest version of its mobile platform, Apple is focusing on making it smarter and more powerful, starting with a major upgrade to the Siri virtual assistant. Siri now has a feature called Proactive that can offer app suggestions and more based on context such as time of day or location. It's a lot like Google Now, Google's version of the virtual assistant, telling you how far away your next appointment is based on traffic or starting music when you plug headphones into your phone. Proactive lets Siri see what apps you have on your phone and suggest useful ones based on what you're trying to do. Apple says that Siri can also look into your inbox to ID incoming calls that aren't in your address book. All of this is wrapped into a new user interface for Spotlight that appears when you swipe down on a home screen in iOS.

ios9-1iOS 9 also introduces deep linking within Spotlight searches, letting you access content within apps whenever you do a system-wide search, instead of just opening the app's main page. Spotlight also can do unit conversions without opening a web search, something that Siri has done for a while, but now queries can be typed in addition to spoken. Apple says that all of this new intelligent processing happens on the phone itself, meaning your data isn't being sent to a server in the cloud. It's a different stance than Google or Microsoft take, which leverage cloud processing to power their virtual assistants on Android and Windows Phone.

ios9-2

Apple's mobile payments service, Apple Pay, is also getting significant updates in iOS 9. First, it's launching in the UK, and will be compatible with more banks and credit card providers. It is also gaining support for store credit cards and loyalty cards. And finally, Apple is killing the Passbook name in favor of a new app called Wallet, which integrates credit cards, debit cards, store cards, and loyalty cards in one place.

The basic Notes app that's been included in iOS since the beginning is getting some new features, such as image insertion, checklists, and sketches. It's a lot closer to an Evernote competitor than ever before.

Apple's oft-criticised Maps app is getting some much-requested upgrades, including support for transit directions. The transit directions feature supports trains, buses, subways, and is launching in more than 20 cities, including New York, San Francisco, Beijing, London, Berlin, and more.

ios9-3

New for iOS 9 is an app called News, which, as you might expect from its name, is a place to get news content from a variety of sources. Articles are presented in a mobile-formatted layout that loads quickly and has informative animations and full-bleed images. Apple has partnered with a number of news organizations to provide content for the new app, such as CNN, Time, Wired, ESPN, Buzzfeed, and yes, The Verge. The app also can display articles from any web link, but Apple says the best experience is with those that have been specifically built for the app, much like Facebook's new Instant Articles. News is very similar to Flipboard and a number of other mobile reading apps that have been in the App Store for years. Apple claims the app will get smarter the more its used and will suggest content and articles based on what you prefer to read. News will be first available in the US, UK, and Australia.

ios9-4

iOS 9 also introduces new power-user features designed specifically for the iPad. The on-screen keyboard includes shortcuts for cut, copy, paste, and more, as well as a new mode that turns the keyboard into a trackpad. Perhaps the biggest change to the way iOS works is in the new multitasking mode for the iPad. iOS 9 now lets you run two apps side-by-side at the same time, a feature that's been a hallmark in Microsoft's Surface tablets and Samsung's Galaxy tablets for a long time. A redesigned task switcher lets you swipe apps in to the same screen, much like Windows 8, and both apps remain fully active on the screen at the same time. Apps can be split 50-50 or 70-30 on the screen, and the iPad's existing multi-finger touch gestures work in either side. Videos can be watched in a picture-in-picture viewer that can be moved around the screen. Apple says that the split-screen mode will only be available on the iPad Air 2 (and presumably new iPads announced later this year), while picture in picture and the ability to swipe in apps from the side will come to older iPads.

At a system level, Apple says iOS 9 is more efficient and smaller than ever. The new software only requires 1.8GB of free space to install, much less than the 4.6GB iOS 8 needed. Apple also says iOS 9 has a new "low power mode" that can squeeze another three hours of battery life out of a single charge. Details about how the new low power mode works are scant, but it's likely that Apple will limit background processes even further than it normally does when it's engaged. iOS 9 will also include a new system font, likely based off of the San Francisco font on the Apple Watch.

iOS 9 also brings upgrades to Apple's HomeKit and CarPlay services, with more devices and cars gaining support. CarPlay will support apps from automakers, ostensibly letting users control car-level things like climate control and seating positions, and it will also work wirelessly in future vehicles. Apple first introduced wireless CarPlay support with iOS 8.3, but there aren't any vehicles or head units that yet support it.

Apple will first release iOS 9 to registered developers today, followed by a public beta in July. It will be available as a final release this fall and is compatible with devices as old as the iPhone 4S and iPad 2 from 2011.

Windows 10 can run reworked Android and iOS apps

Microsoft is revealing its plans to get mobile apps on Windows 10 today. While the company has been investigating emulating Android apps, it has settled on a different solution, or set of solutions, that will allow developers to bring their existing code to Windows 10.

iOS and Android developers will be able to port their apps and games directly to Windows universal apps, and Microsoft is enabling this with two new software development kits. On the Android side, Microsoft is enabling developers to use Java and C++ code on Windows 10, and for iOS developers they’ll be able to take advantage of their existing Objective C code. "We want to enable developers to leverage their current code and current skills to start building those Windows applications in the Store, and to be able to extend those applications," explained Microsoft’s Terry Myerson during an interview with The Verge this morning.

 

The idea is simple, get apps on Windows 10 without the need for developers to rebuild them fully for Windows. While it sounds simple, the actual process will be a little more complicated than just pushing a few buttons to recompile apps. "Initially it will be analogous to what Amazon offers," notes Myerson, referring to the Android work Microsoft is doing. "If they’re using some Google API… we have created Microsoft replacements for those APIs." Microsoft’s pitch to developers is to bring their code across without many changes, and then eventually leverage the capabilities of Windows like Cortana, Xbox Live, Holograms, Live Tiles, and more. Microsoft has been testing its new tools with some key developers like King, the maker of Candy Crush Saga, to get games ported across to Windows. Candy Crush Saga as it exists today on Windows Phone has been converted from iOS code using Microsoft’s tools without many modifications.

During Microsoft’s planning for bringing iOS and Android apps to Windows, Myerson admits it wasn’t always an obvious choice to have both. "At times we’ve thought, let's just do iOS," Myerson explains. "But when we think of Windows we really think of everyone on the planet. There’s countries where iOS devices aren’t available." Supporting both Android and iOS developers allows Microsoft to capture everyone who is developing for mobile platforms right now, even if most companies still continue to target iOS first and port their apps to Android at the same time or shortly afterward. By supporting iOS developers, Microsoft wants to be third in line for these ported apps, and that’s a better situation than it faces today.

Alongside the iOS and Android SDKs, Microsoft is also revealing ways for websites and Windows desktop apps to make their way over to Windows universal apps. Microsoft has created a way for websites to run inside a Windows universal app, and use system services like notifications and in-app purchases. This should allow website owners to easily create web apps without much effort, and list those apps in the Windows Store. It’s not the best alternative to a native app for a lot of scenarios, but for simple websites it offers up a new way to create an app without its developers having to learn new code languages. Microsoft is also looking toward existing Windows desktop app developers with Windows 10. Developers will be able to leverage their .NET and Win32 work and bring this to Windows universal apps. "Sixteen million .NET and Win32 apps are still being used every month on Windows 7 and Windows 8," explains Myerson, so it’s clear Microsoft needs to get these into Windows 10.

Microsoft is using some of its HyperV work to virtualize these existing desktop apps on Windows 10. Adobe is one particular test case where Microsoft has been working closely with the firm to package its apps ready for Windows 10. Adobe Photoshop Elements is coming to the Windows Store as a universal app, using this virtualization technology. Performance is key for many desktop apps, so it will be interesting to see if Microsoft has managed to maintain a fluid app experience with this virtualization.

Collectively, Microsoft is referring to these four new SDKs as bridges or ramps to get developers interested in Windows 10. It’s a key moment for the company to really win back developers and prove that Windows is still relevant in a world that continues to be dominated by Android and iOS. The aim, as Myerson puts it, is to get Windows 10 on 1 billion devices within the next two to three years. That’s a big goal, and the company will need the support of developers and apps to help it get there.

These SDKs will generate questions among Microsoft’s core development community, especially those who invested heavily in the company’s Metro-style design and the unique features of Windows apps in the past. The end result for consumers is, hopefully, more apps, but for developers it’s a question of whether to simply port their existing iOS and Android work across and leave it at that, or extend those apps to use Windows features or even some design elements. "We want to structure the platform so it’s not an all or nothing," says Myerson. "If you use everything together it’s beautiful, but that’s not required to get started."

Microsoft still has the tricky mix of ported apps to contend with, and that could result in an app store similar to Amazon's, or even one where developers still aren't interested in porting. This is just the beginning, and Windows universal apps, while promising, still face a rocky and uncertain future.

Advertsing

125X125_06

Planet Xamarin

Planet Xamarin

Calendar

<<  September 2017  >>
MonTueWedThuFriSatSun
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

View posts in large calendar

Month List