In my previous post I thought that I would not make the app because I did not had a nice geocoding service. I did find Azure Maps, but there is no nice C# client at that time and I did not feel like doing manual REST calls. I know I can, I just didn’t feel like making it (sorry).

So I’ve worked in the past with the Geocoding.Net Nuget packages and decided to go for the Bing version. Googles version requires an account with billing because the first 200 dollar is free. It does feel like a hurdle for me as I do not work that much with Google Services.

So I did create an Azure Function which reads the kmz and extracts it to kml and for each unknown placemark would do a geo-location and store it in a file, so that only new bears would require a call to the Geocoding service of Bing.

The app is up now in the play store. Not in Apples App store, because I did not buy a license for it.

https://play.google.com/store/apps/details?id=com.companyname.bosscheberenbingo

I forgot to rename the package.

Here is a small snippet for the Geocoding:

var geocoder = new Geocoding.Microsoft.BingMapsGeocoder(“key”);

var geoCodeResponse = await geocoder.GeocodeAsync(“address here”);

var location = geoCodeResponse.First().Coordinates;


Good luck and happy bear hunting!

Pin on pinterest Plus on Googleplus Post on LinkedIn

To keep kids entertained, people from all over the world put a teddy bear in their window so that kids can spot them during a walk.

I don’t know the origin. It’s in Canada, USA, New Zealand, UK etc. It’s also in my hometown so I decided to make an app for it.

People made a Facebook group with a google form to submit the teddy bear and an URL with all bears on google maps.

I thought that I had to get access to the Google spreadsheet containing the data, but it seems that it would not hold that much info if we take a look at the entry form and the maps data. In Google maps you can download a KMZ file which is a zipped KML (Keyhole Markup Language) It’s XML. Here is the full KML:

full-kml

So there is a web link in it to get the live data. I used the webclient to pull it in and read it and tried to make pins out of it.

My first step was to add the Xamarin.Forms.Map Nuget package and the SharpKml.Core

Here is the full code:


private void AddMap()
{
	var map = new Map(MapSpan.FromCenterAndRadius(new Position(51.697815, 5.303675), Distance.FromMeters(10000)));

	using (var client = new WebClient())
	{
		var kmz = KmzFile.Open(client.OpenRead("https://www.google.com/maps/d/u/0/kml?mid=1kedGv2twtsWmzgxRpZcu5hr-qpE77plL"));
		Kml kml = kmz.GetDefaultKmlFile().Root as Kml;

		if (kml != null)
		{
			foreach (Placemark placemark in kml.Flatten().OfType())
			{
				Console.WriteLine(placemark.Name);

				var pin = new Pin()
				{
					Address = placemark.Address,
					Label = placemark.Name,
					Type = PinType.Place
				};
				map.Pins.Add(pin);
			}
		}
	}

	this.Content = map;
}

But the pins won’t show up (of course). Because I did not set the position. The real Kml contains data like this:

kml-detail

So as you can see there is no Latitude Longitude for the placemarks… So how does google maps work then? It seems that both Google Maps and Google Earth Geocode the address to get the lat lng. But that service unfortunately is not free. I tried to load the kml in Google Earth and export it, but that also does not add the latitude and longitude. I also thought that kml support for the map control could be used. So that I could just provide the kml to the map and have it sort it out, but that was build with monoandroid 9 instead of netstandard2.0 and would probably not fix the geocode issue.

I planned to make an app with no central backend. But because of geocoding, I would have to use a webapi or Azure Function to keep track of the “database” with all teddy bears and their corresponding lat lng. That would also lower the requests for geocoding if it would be moved from the phone (client) to the server.

But I’ve not found a good free geocoder

nominatim.openstreetmap.org does not work if I would provide the kml data. I think that I will come back to this one….


Good luck making your own KML/KMZ reading app!

Pin on pinterest Plus on Googleplus Post on LinkedIn

The 15.4 update of Visual Studio has a lot of new things. Also the Fall creator update enables you to use .net Standard 2.0 in UWP apps. Adding UWP apps in the store is easy and native. But you can also pack other types and submit them as store apps.

WAP

Windows Application Packaging Project. it’s a new project template in vs15.4 You can load up the solution containing your application and add a new project of this type.

Select the target and minimum version of the Windows SDK (this is recognizable from uwp apps)

Right click applications in the solution explorer and add a reference to your main application project

Add Project Reference

Then you can use the create app packages like you would do for an UWP app

You can read more about it on the microsoft docs site

https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-packaging-dot-net

Pro tip: visit the Microsoft Docs website more often. They are really improving lately. Like a lot!

There is just one thing I would like to point out: your developer account needs extra permissions to submit such type of application.

You will need to submit your info on this page:

https://developer.microsoft.com/en-us/windows/projects/campaigns/desktop-bridge

and they will get back to you in 6 business days.

I have submitted two apps, one for the general store and one as a business app which is only available for my colleagues in a private store. Both are still waiting for approval. Hope to hear soon from the team.

So the pro-tip of today is: make sure your dev ms account has privileges to submit a desktop bridge app to the store!


Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

I have developed several small apps for Windows Phone. Most of the time it is just to test how publishing an app works. I have developed an app for wp7, wp8.0, wp8.1 and universal apps and they are all free in the windows (phone) store. I try to earn back my developer fee of 19 euro by adding some small ads to it. I have used the adrotator version 1 and version 2 plugin and Microsoft's  own admediator.

You can download that visual studio extension of the visualstudio gallery website.

and you can read how to use admediator on msdn.

my three ad networks are:

  • mobfox
  • smaato
  • pubcenter

My conclusion: pubcenter has the best revenue and smaato serves the most ads. Please let me know if you disagree or have some advice. You can download my excel report here.

 

p.s. here is a 27 minute video of the admediator control on channel 9.

p.p.s. more info on the windows blog http://blogs.windows.com/buildingapps/2014/11/07/how-to-maximize-the-impact-of-windows-ad-mediation-for-windows-phone/

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

The Lenovo Miix 2 tablet is great if you look at the value you get for your money. I purchased one for work for just 196 euro at paradigit.nl

http://www.techspot.com/images/products/tablets/org/1766429079_943123002_o.jpg

It took me a day to install all updates on the windows 8.1 machine. When I returned at work the next day the tablet did not boot. It was still on the usb charger so it was not a battery drain or empty battery or whatsoever. I tried to contact Lenovo through twitter, but no response (yet).

So I had to figure it out myself and found this blog with tips. One of them is to plugin the USB cable, wait for the white light and power on. That did not work. Power on before removing USB cable also did not work. Maybe this works for you, please let me know in the comments.

The real solution (for me) was this trick of @marauderz:

Hold the power button for 20 seconds and then release and press again. That does show the lenovo logo and makes the tablet boot again. It does not matter if you have the 8 inch or 10 inch device. According to @marauderz it has to do with "ConnStandby" mode which is the "connected standby" feature of windows. More about it is available on MSDN. This superuser answer explains how you can disable this feature. Since I am developing a universal app on this tablet and have it on an USB powercable 24/7 I do not need this connected standby feature. So launch regedit, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\

and change ‘CsEnabled’ from 1 to 0. Confirm, close regedit and reboot.

Pin on pinterest Plus on Googleplus Post on LinkedIn