Giter Club home page Giter Club logo

windows-appsample-trafficapp's Introduction

page_type languages products statusNotificationTargets description
sample
csharp
windows
windows-uwp
A mini-app for commuters to track drive times to various locations.

Traffic App sample

A mini-app for commuters to track drive times to various locations. The user adds frequently-visited destinations using app-bar buttons or by tapping and holding on the map. Traffic App then provides a quick view into how long it will take to drive to each place from the user's current location, following the fastest route. The user can also flag a particular destination and a background task will periodically monitor traffic to that location, alerting the user when traffic is adding ten minutes or more to the travel time.

Note - This sample is targeted and tested for Windows 10, version 2004 (10.0; Build 19041), and Visual Studio 2019. If you prefer, you can use project properties to retarget the project(s) to Windows 10, version 1903 (10.0; Build 18362).

This sample runs on the Universal Windows Platform (UWP).

For a description of the goals and challenges of this project, see the project overview.

Note: This branch of the repo contains the original version of the sample, which uses a traditional "code-behind" architecture. For the Model-View-ViewModel (MVVM) version, see the MVVM branch.

Traffic app screenshot

Features

Traffic App highlights the following APIs:

Universal Windows Platform development

Prerequisites

  • Windows 10. Minimum: Windows 10, version 1809 (10.0; Build 17763), also known as the Windows 10 October 2018 Update.
  • Windows 10 SDK. Minimum: Windows SDK version 10.0.17763.0 (Windows 10, version 1809).
  • Visual Studio 2019 (or Visual Studio 2017). You can use the free Visual Studio Community Edition to build and run Windows Universal Platform (UWP) apps.

To get the latest updates to Windows and the development tools, and to help shape their development, join the Windows Insider Program.

Running the sample

Traffic App needs a Bing Maps key to run with full functionality. For security reasons, we can't provide a key as part of the sample - you'll need to get your own at https://www.bingmapsportal.com. Once you have a key, insert it into code in the LocationHelper class constructor and in the MapControl element in MainPage.xaml (you can find these easily by searching the solution for "ServiceToken").

Note: The platform target currently defaults to ARM, so be sure to change that to x64 or x86 if you want to test on a non-ARM device.

The default project is TrafficApp and you can Start Debugging (F5) or Start Without Debugging (Ctrl+F5) to try it out. The app will run in the emulator or on physical devices. If you run in the emulator, be sure to set your location in the location area of the emulator - otherwise, the app won't work correctly.

By default, the app generates four sample locations at random positions around your current location. You can switch to "live mode" instead by changing the commented lines in MainPage.OnNavigatedTo so that locations are loaded from roaming storage.

Code at a glance

If you're just interested in code snippets for certain API and don't want to browse or run the full sample, check out the following files for examples of some highlighted features:

windows-appsample-trafficapp's People

Contributors

capfei avatar karlerickson avatar matchamatch avatar microsoft-github-policy-service[bot] avatar stevewhims avatar supernova-eng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows-appsample-trafficapp's Issues

build error with the sample

Thought I would try to run your sample project. I right clicked TrafficApp and said Set as Startup Project. The hit rebuild. Fails here on the line with the Entry Point:

  <Extensions>
    <Extension Category="windows.backgroundTasks" EntryPoint="TrafficMonitor.TrafficMonitor">
      <BackgroundTasks>
        <Task Type="systemEvent" />
      </BackgroundTasks>
    </Extension>
  </Extensions>

Windows-appsample-trafficapp-master\Windows-appsample-trafficapp-master\TrafficApp\bin\x64\Debug\AppxManifest.xml : error APPX0501: Validation error. error 80080204: App manifest validation error: Line 31, Column 12, Reason: If it is not an audio background task, it is not allowed to have EntryPoint="TrafficMonitor.TrafficMonitor" without ActivatableClassId in windows.activatableClass.inProcessServer.

The app doesn't recognize Bing Maps Key

I don't know if Bing Maps Key isn't programmed well, as I don't know the URL that the Bing Maps Key Programming asks me to write, so I put a random URL and the key isn't recognized by TrafficApp when running. It tells me that I need a key while it is written into the source code.

Validation error

getting this error while building:

Severity Code Description Project File Line Suppression State
Error Validation error. error 80080204: App manifest validation error: Line 31, Column 12, Reason: If it is not an audio background task, it is not allowed to have EntryPoint="TrafficMonitor.TrafficMonitor" without ActivatableClassId in windows.activatableClass.inProcessServer. TrafficApp C:\Users\jainabhi\source\repos\Windows-appsample-trafficapp-MVVM\TrafficApp\bin\x86\Debug\AppxManifest.xml

also this warning
Severity Code Description Project File Line Suppression State
Warning The element 'Package' in namespace 'http://schemas.microsoft.com/appx/manifest/foundation/windows10' has invalid child element 'Metadata' in namespace 'http://schemas.microsoft.com/developer/appx/2015/build'. List of possible elements expected: 'Extensions, ComExtensions' in namespace 'http://schemas.microsoft.com/appx/manifest/foundation/windows10'. Miscellaneous Files C:\Users\jainabhi\source\repos\Windows-appsample-trafficapp-MVVM\TrafficApp\bin\x86\Debug\AppxManifest.xml 42

Idea for app to show user best time to leave for destination

This is very close to an app I have always wanted and thought about trying to make. The one thing that is missing is the ability to gather data over time. The idea is I would like to take two points and through the times 4PM and 7PM for example leave the app running and have it gather the estimated time to travel each minute. At 7PM I would like the ability to see this information in a graph.

The main point is it would tell me between two periods of time what time is the best time to leave work.

It seems the app almost does this. It just needs a place to store the data and way to show the results.

Error in build App

Hello,
I'm trying to build the App, but I'm getting the following errors in VS 2015 (MainPage.xaml.cs):

Error CS1061 'MainPage' does not contain a definition for 'ChangingLocationMessage' and no extension method 'ChangingLocationMessage' accepting a first argument of type 'MainPage' could be found (are you missing a using directive or an assembly reference?)

Error CS1061 'MainPage' does not contain a definition for 'HideLocationsButton' and no extension method 'HideLocationsButton' accepting a first argument of type 'MainPage' could be found (are you missing a using directive or an assembly reference?)

Error CS1061 'MainPage' does not contain a definition for 'ChangingLocationMessage' and no extension method 'ChangingLocationMessage' accepting a first argument of type 'MainPage' could be found (are you missing a using directive or an assembly reference?)

Error CS1061 'MainPage' does not contain a definition for 'HideLocationsButton' and no extension method 'HideLocationsButton' accepting a first argument of type 'MainPage' could be found (are you missing a using directive or an assembly reference?)

error

System.Runtime.InteropServices.SEHException

image
I'm getting following error:
System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'
at line no: 93 of App.xaml

I'm running this sample code on IOT Core.

I get 453 errors when debugging.

There are a lot of errors when building TrafficApp. It says BindableBase.cs, AssemblyInfo.cs, [.NETCore, Versión= 3 v5.0.AssemblyAttributes.cs], LocationHelper.cs and TrafficApp.csproj have errors. I followed the instructions when building the app (x64 in my Local Machine) and the project didn't run. I also put my own Bing Maps Key into LocationHelper.cs and into MainPage.xaml. The error codes that appear at building error list are: CS0518, CS4036, CS0012, CS0103, CS0161, CS0246, CS1983, CS0122 and CS0400.

2017-11-11 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.