Git Product home page Git Product logo

bikesharing360_mobileapps's Introduction

BikeSharing360

During our Connect(); event this year we presented 15 demos in Scott Guthrie’s and Scott Hanselman’s keynotes. If you missed the keynotes, you can watch the recording in Channel 9.

This year, we built the technology stack for a fictional company named BikeSharing360, which allows users to rent bikes from one location to another.

BikeSharing360 is a fictitious example of a smart bike sharing system with 10,000 bikes distributed in 650 stations located throughout New York City and Seattle. Their vision is to provide a modern and personalized experience to riders and to run their business with intelligence.

In this demo scenario, we built several apps for both the enterprise and the consumer (bike riders). You can find all other BikeSharing360 repos in the following locations:

BikeRider Xamarin app and Maintenance Cordova app

This repository contains the BikeRider consumer-facing mobile apps for renting bikes and the BikeSharing360 maintenance app built with Cordova.

Note: This document is about the Xamarin apps. For the Cordova app click here.

BikeRider

Supported Platforms: iOS, Android, and Windows

The BikeRider app is available for three platforms:

  • iOS (including a watchOS app)
  • Android
  • Universal Windows Platform (UWP)

BikeRider features 93.7% code share across all platforms (7.34% iOS / 8.61% Android / 2.72% Windows).

Xamarin.Forms App (BikeRider)

Xamarin.Forms allows you to build native UIs for iOS, Android, and Windows from a single, shared codebase. You can dive into mobile development with Xamarin.Forms by following our free self-guided learning from Xamarin University. This project exercises the following patterns and features:

Three platforms

Screens

Sign Up

Home

My rides

Main menu

Profile

New ride

Report

Event

Licenses

This project uses some third-party assets with a license that requires attribution:

Requirements

  • Windows 10
  • Visual Studio 2015 Update 3 (14.0 or higher) to compile C# 6 language features (or Visual Studio MacOS)
  • Xamarin add-ons for Visual Studio 3.2.1.64 or higher (available via the Visual Studio installer)
  • Visual Studio Community Edition is fully supported!
  • Android SDK Tools 25.2.3 or higher
  • OpenWeatherMap Key - Getting a OpenWeatherMap Api Key
  • Bing Maps Key - Getting a Bing Maps Key
  • Microsoft Azure subscription

Setup

Download or clone the repository. This is a solution with seven projects.

BikeRider

Rebuild the solution to get all neccesary NuGet packages.

Access to GlobalSettings.cs file available in the Portable Class Library to introduce your Azure endpoints and APIs keys.

GlobalSettings.cs

Deploy to Azure

Use the Backend Services repository to deploy backend services for Xamarin App to your subscription.

Enjoy!

How to sign up for Microsoft Azure

You need an Azure account to work with this demo code. You can:

  • Open an Azure account for free Azure subscription. You get credits that can be used to try out paid Azure services. Even after the credits are used up, you can keep the account and use free Azure services and features, such as the Web Apps feature in Azure App Service.
  • Activate Visual Studio subscriber benefits. Your Visual Studio subscription gives you credits every month that you can use for paid Azure services.
  • Not a Visual Studio subscriber? Get a $25 monthly Azure credit by joining Visual Studio Dev Essentials.

Blogs posts and videos

Here's links to blog posts related to this project:

Clean and Rebuild

If you see build issues when pulling updates from the repo, try cleaning and rebuilding the solution.

Copyright and license

  • Code and documentation copyright 2016 Microsoft Corp. Code released under the MIT license.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

bikesharing360_mobileapps's People

Contributors

bradygaster avatar eiximenis avatar erikaehrli avatar jaridkg avatar jsauvexamarin avatar microsoft-github-policy-service[bot] 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bikesharing360_mobileapps's Issues

Fake data creation

In FakeRidesService static members are initialized in wrong order : rides is created before stations but refere to stations.

I'll put a PR to fix this.

Updated version available?

Hi,

will you be updating the BikeSharing360 solution to be compatible with updated components in VS & Xamarin?

Cheers,
Tac

MSFT-provided testing backend?

This looks exciting, but the setup investment for a developer to just peek into the client as a learning exercise is quite high with all the services, DBs and storage accounts to setup and configure - I'm pretty sure this hurts adoption. It would be great if there was a testing backend provisioned by Microsoft that we could just connect to.

Documentation

Why are MS samples always published without documentation? Kind of pointless to know what you did without the why.

Would take 10 minutes to put basic info about the architecture in the readme.

Does not run

Get 32 errors on build, most of them are :

Build action 'EmbeddedResource' is not supported by one or more of the project's targets. BikeSharing.Clients.Core BikeSharing360_MobileApps-master\src\BikeSharing.Clients.Core\App.xaml

The Xaml properties look fine, please advise.

Error when I tap Sign up

I get the following error when I tap on sign up:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

when I debug the app, the debugger stops at the following line, throwing the error:
NavigationService>CreateAndBindPage>line 162 which is :

page.BindingContext = viewModel;

CreateAndBind does its job on other viewModels, just not the signUpViewModel; and I honestly donno what's goin on!

PS: I did what was discussed in the #2 . it still is broken.

Will these libraries increase the app size?

I am now re-writing one of my existing apps to use the animation, dialogs and other cool features of this BikeSharing app. However seeing the amount of libraries I had to install I am a little bit concerned/worried as to how much will be size of the app when I ship it on to the store (all the three platforms, mainly android). Will all these libraries (acr, unity, plugin, user dialogs, ffimage, fonts, etc) will be too much in size even after performing linking & ProGuard etc..? Did we already try release build for Bikesharing app? May I know what is the size of installation package on each platform?

Option to Sign in as a Guest User

I have a MSDN Enterprise subscription (via our enterprise) and I do have an Azure account too. However I don't own a credit card. I have been trying to sign up multiple times but fails with "Invalid Data".

I would love to see a dummy user signin in the app. Just a button on the sign in screen like "Sign In as Guest".

UWP app working fine, Android crashes on start

Hi,
I built mobile app and backend and have them working on Windows Phone version of the mobile app. I can create user account, logon, see events and all good stuff,

I build the Android version as well, but there I cannot even debug it as when it start and shows the blue background spash page, it ends right away afterward telling nothing to VS.NET. No exception trapped by the debugger.

Any idea?

I saw the project file targets to Android SDK 7.1 (Nougat), while I'm using a 6.0 emulator (Marshmallow). May be that the issue? I'm not deep into ANdroid, sorry for basic question.

Missing tests for being a "demo" or "reference" implementation

Sample code by platforms trying to showcase a well-implemented solution should ALWAYS include tests. This really perpetuates so many in the industry (sadly, likely more often on Microsoft stacks) not taking automated testing seriously.

Tests such as Xamarin UITest or similar should be added for at least some very basic behavior.

Working demo

First of all, it won't build if you update the packages.

Is there a working APIs or a mock demo available?

Looking for a quick demo of mobile app without going through API setup.

Is there a demo login that I could use?

Thanks,
Manish

Unable to Get Rides for User

Hello,

I hope someone can give me a clue about why the Rides service is not returning any data.

Here is what I have already done successfully:

  • Deployed the BikeSharing.Services.Deploy project
  • Ran the SQL scripts and loaded the data in all the databases

Here is what I am seeing.

  • I log in as Username: "scottgu" and Password: "password".
  • I click on Rides.
  • I get an "Error: Communication Error" dialog box.
  • I log into Azure. I check my App Service is running.
  • I put a breakpoint in the RidesService -> GetUserRides() function.
  • I verified "scottgu" is UserId 1 in the Users table.

Id LastLogin UserName Password TenantId
1 0001-01-01 00:00:00.0000000 scottgu NULL 1

  • I verified the Rides table has data for UserId 1.

SELECT TOP (1000) [Id] ,[Duration] ,[Start] ,[Stop] ,[StartStationId] ,[EndStationId] ,[BikeId] ,[UserId] ,[EventType] ,[EventId] ,[GeoDistance] ,[EventName] FROM [dbo].[rides] where UserId = 1

  • My URI string is the following:
    http://bikesharing-services-XXXX.azurewebsites.net:80/api/rides/user/1
    (Ignore the XXXX because I am not showing the entire URL on here.)

  • I either connect to the above URL either with Swagger, PostMan, or in the code. I found Swagger is not available for this project since it was written in Node. But PostMan and my code give the same response.

  • I get the following error:
    "The page cannot be displayed because an internal server error has occurred."

  • I verified I get the same error from 2 different machines.

What am I missing? I followed all the steps in the ReadMe.MD file for the BikeSharing360_BackendServices project.

Do I need to configure or enable something in Azure?

Thank you

HockeyApp is required; hangs on signup process.

I've built and deployed the BikeSharing.Services.Deploy (nuking and redoing multiple times, as the instructions for the backend were incomplete), then built and deployed BikeSharing.Xamarin-Droid on my phone. When running the Android app, the app crashes immediately with "Java.Lang.IllegalArgumentException: App ID length must be 32 characters." and a look at the call stack indicates the crash on the call "HockeyApp.Android.CrashManager.Register(this, GlobalSettings.HockeyAppAPIKeyForAndroid);"

So, the Requirements should include signing up for a HockeyApp app ID like Bing Maps, like OpenWeatherMap.

After getting through that, debugging the app I have to go through the login/signup screen. After inputting all the fields (except Skype, as I don't know my Skype account ID, and of course, can't find it on any Skype's page, leave it blank), it hangs in the signup, after the page prompting to enter Skype ID. Debugging break in VS 2015 stops in various places, animation, a JNI call, etc.

The output of the app is:
referenceTable GDEF length=814 1
referenceTable GSUB length=11364 1
referenceTable GPOS length=47302 1
referenceTable GDEF length=32 1
referenceTable GSUB length=32 1
referenceTable GPOS length=5062 1
referenceTable head length=54 1
referenceTable GDEF length=32 1
referenceTable GSUB length=32 1
referenceTable GPOS length=5062 1
referenceTable head length=54 1
referenceTable head length=54 1

For the backend log, I get this (dots instead of actual email addresses):
Update SQL database Succeeded 42 min ago Fri Dec 16 2016 09:38:31 GMT-0500 (Eastern Standard Time) Visual Studio Professional with MSDN ..................
CreateDatabase Succeeded 53 min ago Fri Dec 16 2016 09:28:00 GMT-0500 (Eastern Standard Time) Visual Studio Professional with MSDN ........................
CreateDatabase Succeeded 53 min ago Fri Dec 16 2016 09:28:00 GMT-0500 (Eastern Standard Time) Visual Studio Professional with MSDN ........................
CreateDatabase Succeeded 53 min ago Fri Dec 16 2016 09:27:59 GMT-0500 (Eastern Standard Time) Visual Studio Professional with MSDN ........................
CreateDatabase Succeeded 53 min ago Fri Dec 16 2016 09:27:58 GMT-0500 (Eastern Standard Time) Visual Studio Professional with MSDN ........................
UpsertServerFirewallRule Succeeded 54 min ago Fri Dec 16 2016 09:27:25 GMT-0500 (Eastern Standard Time) Visual Studio Professional with MSDN ........................
Validate Succeeded 54 min ago Fri Dec 16 2016 09:26:36 GMT-0500 (Eastern Standard Time) Visual Studio Professional with MSDN ........................
Update resource group Succeeded 54 min ago Fri Dec 16 2016 09:26:34 GMT-0500 (Eastern Standard Time) Visual Studio Professional with MSDN ........................
Update resource group Succeeded 55 min ago Fri Dec 16 2016 09:26:19 GMT-0500 (Eastern Standard Time) Visual Studio Professional with MSDN ........................

Could someone tell me if this config file (at .../BikeSharing360_MobileApps/src/BikeSharing.Clients.Core/GlobalSettings.cs) is correct? I entered dots '.' in place of actual data obtained from https://portal.azure.com just for this post.

    public const string AuthenticationEndpoint = "http://bikesharing-services-profilesafse5d6.........azurewebsites.net/";
    public const string EventsEndpoint = "http://bikesharing-services-eventsafse5d6...........azurewebsites.net/";
    public const string IssuesEndpoint = "http://bikesharing-services-feedbackafse5d6............azurewebsites.net/";
    public const string RidesEndpoint = "http://bikesharing-services-ridesafse5d6.............azurewebsites.net/";
    public const string OpenWeatherMapAPIKey = "c0..................................1";
    public const string HockeyAppAPIKeyForAndroid = "4e..........................................5";
    public const string HockeyAppAPIKeyForiOS = "YOUR_HOCKEY_APP_ID";
    public const string SkypeBotAccount = "skype:YOUR_BOT_ID?chat";
    public const string BingMapsAPIKey = "Ak..............................................A";
    public static string City => "New York City";
    public static int TenantId = 1;

Events pulling instead of push notifications

Since Xamarin Forms seems to be way behind with the implementation of push messages and the integration with Firebase, I turned to this app to find guidance, only to discover that - unlike the Evolve app - you completely dropped push notifications in favor of a manual pull implementation. Which is ... surprising ;)

Does that mean that the whole push messaging story is currently so broken that we shouldn't even try to get it running with Xamarin Forms at this point? I'd rather find out now then after days of trying to get things working :)

Thanks,
Philipp

Writeups for Animation Library

Are there any docs / blog posts for the Animation library the app uses?

It brings back all the warm fuzzies of WPF Storyboards.

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.