My group is continuing to create and provide starter kits for people to use to create apps for Windows 8/8.1 and Windows Phone 8. Those starter kits can be found here – APIMASH Windows App Starter Kits. These kits focus on calling open web API’s for numerous services and wrap them into workable sample apps. There are a bunch of samples written in both WinJS and XAML/C# for you to take advantage of when building your own apps.
The Ordr.In API Starter kit for Windows Phone 8
Ordr.In is a startup/young business that has set itself up as the backend system and credit card processing for online food ordering. This is a great way to leverage their business to create your own apps without having to handle all of the backend yourself. Getting relationships with all of the restaurants can be a huge task. I know of a company making an app and they have been working on getting each one separately. This takes time and effort. I would rather spend the time on getting my app working well instead of working on the agreements with restaurants. I started working with the Ordr.In team to create an SDK that can be used on Windows 8/8.1 and on Windows Phone 8. The library that I developed can be recompiled for Windows 8/8.1 or for Windows Phone 8.
There are many different things that are part of the Ordr.In API, so it did take a while to get everything in it. This SDK can show you how to do the following things:
- Create user accounts (login, edit things, etc)
- Get list of restaurants based on an address
- Show the items from the restaurant
- Add items to a shopping cart
- Place the order
- Use Bing maps API to convert lat/long to a real address
- Windows 8
- Visual Studio 2012 or higher
- JSON.NET form Newtonsoft (https://json.codeplex.com/)
- Ordr.In Developer Account/App (http://hackfood.ordr.in/)
- BingMap Developer Account/App (http://www.microsoft.com/maps/create-a-bing-maps-key.aspx)
- Create an developer account with Ordr.In at http://hackfood.ordr.in/ to obtain the developer key needed in the app starter kit. Create a Bing Map developer account and get a developer key at http://www.microsoft.com/maps/create-a-bing-maps-key.aspx . These keys are both needed to compile the sample project.
- Download the Starter Kit from (http://apimash.github.io/StarterKits/)
- Open the APIMASH_Ordr.In_StarterKit_Phone Solution in Visual Studio 2012
- Add your Developer Keys for Ordr.In and Bing Maps in the APIMASH_OrdrInLib project in the APIMASH_OrdrIn.cs file
- Compile and Run
In the APIMASH_OrdrInLib project in the APIMASH_OrdrIn.cs file you will notice that there are variables setup to point you to the test or production servers: testingRestaurantAddress, testingOrderAddress, testingUserAddress. This is setup by default to point to the test servers. If you change to point to the production servers, this will actually charge your credit card and food will be delivered to your delivery location. Microsoft and I are not responsible for the food or your credit card charges that are accrued using this starter kit.
The APIMASH library was built by my team to help with taking URLs and getting data back from them in JSON format. Then converting them to a class to use for binding. I setup my custom OrdrIn library to be more of a View-Model following the MVVM pattern. This way it is much simpler to use and reuse in many different cases.
Ordr.In provides a pretty detailed API for restaurants and food ordering. All of the data returns in JSON format. This makes it perfect for the APIMASH library that the group created. It will call a URL and get back data in JSON and convert it to a class for the particular API being used. There were a few JSON returns that were formatted strangely but overall it was pretty good to work with.
I think that the API that Ordr.In has a great API to get started in this market. It is simple to add this to a Windows Universal App and gives you a way to get a large amount of data to share and use in your app. This also works well in Xamarin apps as well.