Presentation is loading. Please wait.

Presentation is loading. Please wait.

LAMAD Windows Phone 7 20.3.2013. Part 1 The Platform and SDK.

Similar presentations


Presentation on theme: "LAMAD Windows Phone 7 20.3.2013. Part 1 The Platform and SDK."— Presentation transcript:

1 LAMAD Windows Phone 7 20.3.2013

2 Part 1 The Platform and SDK

3 Windows Phone 7 Mobile OS Developed by Microsoft Appeared in the US in 2010 Mango in 2011 Tango in 2012 Live Tiles Nokia Lumia 800

4 Market Share Market Share 2012  There is Hope!

5 Technology Application development in C# or VB GUI design in XAML ( Extensible Application Markup Language ) Declarative XML-based language Created by Microsoft

6 Future of the OS Future is not yet clear Windows Phone 8 Version 8 just appeared 2012! Game development maybe?

7 Installing development Kit Newest Software Development Kit (SDK) version is 8.0. It is free to download from http://create.msdn.com/.http://create.msdn.com/ Note! You need Windows 8 to use the newest SDK. We use 7.1.

8 SDK contents Microsoft Visual Studio [Programming tool] Expression Blend [Designing tool] Project templates[Out of the box code] Windows Phone Emulator[Test app without a device] Additional tools [Register, deploy apps, etc.]

9 Testing on device 1. Register: Fee is 99 €/year Up to 100 apps Students = free! 2. Registration tool 3. Install Zune: http://www.windowsphone. com/en-us/how- to/wp7/zune-software http://www.windowsphone. com/en-us/how- to/wp7/zune-software.

10 Deploy on a device 1. Deployment tool Note! Unlock the device before any operation! 2. xap file is created on compile.

11 Access to Store http://create.msdn.com/ Publish, un-publish Upgrade apps Beta publishing Check statistics Modify pricing Monitor crashes MOPSI stats on marketplace

12 Hello World Task: “Adding a clickable check box to our main page.” When creating a new Solution, under the default project name we can spot the: Double click the MainPage.xaml file. MainPage.xaml MainPage.xaml.cs

13 Hello World XAML code is created in: MainPage.xaml Drag and drop CheckBox from Toolbox.

14 Compile and Run Debug > Start Debugging [F5] Select test environment ‘Play’ button shortcut

15 Publish App! Login at http://create.msdn.com/ and complete steps 1 and 2http://create.msdn.com/

16 Part 2 Location

17 Working with Location Native location handling object (watcher) Initialize watcher We want to get position updates often

18 Working with Location Complete to handle every state of the watcher. HOMEWORK attempt to start location services

19 Working with Location Uninitialize Objects Taking location from event args

20 Adding a Map Drag map from ToolBox. Remove extra XAML. Name is enough!

21 Adding a Marker Open the MainPage.xaml.cs file Change the location to reflect user location. Hint: Study the positionChanged function described earlier. HOMEWORK

22 Test on Emulator Powerful tool to virtually update the position

23 Map Credentials We see the following message on the map: Enter a Map Key obtained from the specified URL. Note! Implement a Map Handler if you use maps on more pages. Keep the key in one place because map keys change often.

24 Part 3 JSON, HTTP request

25 Mobile – Server

26 JSON {"name": "mopsi","age": 4,"address": {"streetAddress": "länsikatu 15","city": "joensuu"},"users": [{"name": "pasi","location": "länsikatu 15"},{"name": "matti","location": "länsikatu 15"}]} http://json.parser.online.fr/

27 JSON in Windows Phone Native JSON Support Remember UTF – 8

28 Subtype Polymorphism Animal tom = new Cat(); Animal mopsi = new Dog(); Animal donald = new Duck(); tom.talk(); // prints “meow” mopsi.talk(); // prints “woof” donald.talk(); // prints “quack” Animal CatDogDuck talk(){ // not implemented } talk(){ print (“meow”); } talk(){ print (“woof”); } talk(){ print (“quack”); } inheritance base class (superclass) subclasses http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming

29 Request types Animal CatDogDuck Request LoginReqShareLocationReqUsersDataReq

30 Examples Requesting friends active in the last week The process is fully encapsulated!

31 JSON request base class Serializing as JSON string Need to implement In each subclass

32 Publically available method talk() from Animal example asynchronous

33 Sending request information asynchronous JSON from ToString() method {"lat":"62.6","lon":"29.7","request_type":"user_location","userid":"2"}

34 Reading server response Handling good/bad response

35 Implementing a subclass location Server has a list of these. User ID is global


Download ppt "LAMAD Windows Phone 7 20.3.2013. Part 1 The Platform and SDK."

Similar presentations


Ads by Google