MyAdviceWriter ...
Starting Friday March 24 I’m working with Microsoft and the community of MVP’s to resurrect a type of event format we used to run for MSDN, the half day – Explore the Possible – see it in action – event. I’d love to invite you to join me on the tour, stop by and say hi. We will explore the move towards productivity and effectiveness of development and deployment tools and technologies.
Since Visual Studio launched 20 years ago it has evolved to become a favorite IDE of the casual to professional developer. With the launch of Visual Studio 2017 Microsoft has stepped up their game with improvements to make it easier to work with Cloud, Mobile and Web, as well as a number of productivity improvements. Join us as we explore the possible with the latest tools and technologies with Visual Studio, Xamarin and the Mobile Center, and DevOps with Team Services. The day starts at 8:30 and ends with a hackfest/install pizza party.
- 8:30 – Hello Visual Studio
- 9:45 – Exploring Mobile Stack
- 11:00 – DevOps, .NET Core, Docker and more
- 12:00 – Pizza & Hackfest
The list of cities and dates include:
- 3/24/2017 - Minneapolis – http://bit.ly/bolVS17msp
- 4/11/2017 – Des Moines – http://bit.ly/bolVS17dsm
- 4/12/2017 – Omaha – http://bit.ly/bolVS17omaha
- 4/17/2017 – Chicago – http://bit.ly/bolVS17dg
- 4/18/2017 – St. Louis – http://bit.ly/bolVS17stl
- 4/19/2017 – Kansas City – http://bit.ly/bolVS17kc
Hope to see you there!
-mike
Watching the live stream of the Visual Studio 2017 launch and 20 year anniversary party…thought I’d capture some of the notes of what’s going on and share the fun.
Visual Studio 2017 release
- Video http://launch.visualstudio.com
- Download: http://visualstudio.com
- New installer, pick scenario and go
Developer Productivity - Kasey Uhlenhuth
- Live Unit Tests
- Exception helper
- Find all references
- New intellitrace tray of options
- Ctrl+T for goto All
- Code suggestions
- Code Config file - map code styles and suggestions for environment
- Support for tuples on methods
- Improved refactoring
- Indent guide visibility to method code is in even if not visible
.NET Core - Beth Massi
- .net Tools for Core 1.0 in production
- Migrate/Upgrade to new tools easy
- Simplified csproj format which is human readable
- References grouped by type…i.e. nuget refs, project refs, etc.
- Application Insights
- New add-in experience
- Search and graph analytics in VS
Containers Docker - Scott Hanselman
- Add docker support in VS right click on project
- Run in docker if selected startup project
- Debug, edit and volume mapping realtime from vs to docker
- Publish to Linux docker or windows
- Automatically references other docker containers dependent on
- Debug across containers
- Check out Ref application http://aka.ms/MicroservicesArchitecture
Xamarin : James & Miguel
- Tizen new OS from Samsung for IoT devices…built on Xamarin Forms
- Visual Studio for Mac Preview 4
- New App templates
- Mobile App added with best practices if checkbox Azure
- Code for clients
- Forms Previewer
- Works if you have JDK 1.8+ on x64 installed (settings?)
- Improved intellisense
- Native animations in XAML
- Forms inspector, when connected tp android emulator
- Layers
- Live edit of XAML
VS Mobile Center - Keith
- http://mobile.azure.com
- Xamarin Test Cloud
- Add app…pick type
- Add nuget & register app
- Distribute sets up a team of testers/user community for builds
- Build service
- Pick sln
- Provisioning profile
- Certificate for signed builds
- Trigger
- Test service …
- run automated UI tests
- See devices tested on
- Crash reporting
- Usage & crash info
- Stack dumps grouped by count
- Analytics
- Custom events
DevOps - Brian Harry & Donovan Brown
- Continuous delivery
- "Shift Right" = delivery improvements, production is part of the plan
- TFS 2017.1 for on Premise installs
- http://aka.ms/tfsimportdata
- Donovan demo - any project, any platform
- Create project
- Import Git repo
- View code
- Setup build from templates or by scratch
- Sources - where is repo? In TS or external?
- Test settings
- Code Coverage
- Build agents - windows or linux
- Search for build task
- Marketplace for build tasks
- Create your own extension
- Variables
- Create work items on failure
- Track history/changes to build definitions
- Release definitions
- Infrastructure as code
- Approvers
- Dashboards
- Data Migration - Partner with Red Gate
- In VS RedGate ReadyRoll has tools by default
- SQL Obj explorer, make changes and save
- Tell ReadyRoll to refresh with changes, generate migration scripts
- Add update statements for populating default values on existing data after modification
- Add database scripts and changes that will happen on the database
- Add the ReadyRoll task to deploy the database task
- RedGate included in VS 2017 Enterprise
- Pluralsight 1yr
- DevOps Enterprise Accelerator offer
I’ve been working on a project that integrates Xamarin with Azure Mobile Apps and uses HockeyApp to distribute the code to test devices. I wanted to add the feature in HockeyApp to allow users to be able to send feedback (including a screenshot) from within the app. On searching for an answer I found a number of good leads but nothing that connected them all so this post is intended to go thru what you need to do to add this feature to your app.
We start with an app that is created from the standard Xamarin Forms template in Visual Studio for cross-platform apps (this assumes you have Visual Studio 2015.3 with the Xamarin tools installed otherwise it will prompt you to add them).
The solution will look like this. Note I had to do a little work to use the Shared version of Xamarin forms with XAML in that I replaced the default App.cs file it includes with XAML versions of that and the MainPage.xaml. You can see the completed demo sample on GitHub here
To add HockeyApp’s feedback feature to our solution go to https://www.hockeyapp.net/ and sign up to create a new app. After an app has been created you can get the HockeyApp ID and use it in the MainActivity.cs code for the OnCreate() method when the application registers with HockeyApp. The process is fairly straight forward:
- Create a new app on HockeyApp (https://support.hockeyapp.net/kb/app-management-2/how-to-create-a-new-app)
- Add the HockeyApp component from Xamarin (https://components.xamarin.com/view/hockeyappandroid)
- In the MainActivity.cs file of the Android project add a function to register HockeyApp with the AppID you created. We will call it from the OnCreate().
-
private void InitializeHockeyApp()
{
CrashManager.Register(this, HOCKEYAPP_APPID, new MyCrashManagerListener());
UpdateManager.Register(this, HOCKEYAPP_APPID);
FeedbackManager.Register(this, HOCKEYAPP_APPID);
Tracking.StartUsage(this);
} - Add a method to handle the feedback calls in the MainActivity class. In this implementation I’m also capturing a screenshot that can be added to the feedback process if the user chooses.
-
public void HandleFeedback()
{
FeedbackManager.SetActivityForScreenshot(MainActivity.current);
FeedbackManager.TakeScreenshot(MainActivity.current);FeedbackManager.ShowFeedbackActivity(MainActivity.current);
} - Implement an ISensorEventListener class to handle shake activity. Note that you need to implement both the Java.Lang.Object interface as well as the ISensorEventListener. I added an overloaded constructor to allow me to pass a reference to the MainActivity instance (parent) that uses this to handle sensor activity. We will also handle the
-
// --- Implement ISensorEventListener
public class MyShakeHandler : Java.Lang.Object, ISensorEventListener
{
// --- Reference to parent activity
private MainActivity parent;// Handle Shake from - http://stackoverflow.com/questions/23120186/can-xamarin-handle-shake-accelerometer-on-android
bool hasUpdated = false;DateTime lastUpdate;
float last_x = 0.0f;
float last_y = 0.0f;
float last_z = 0.0f;const int ShakeDetectionTimeLapse = 250;
const double ShakeThreshold = 800;// --- In constructor set parent
public MyShakeHandler(Activity context) : base()
{
parent = (MainActivity)context;
}public void OnAccuracyChanged(Android.Hardware.Sensor sensor, Android.Hardware.SensorStatus accuracy)
{
}public void OnSensorChanged(Android.Hardware.SensorEvent e)
{
if (e.Sensor.Type == Android.Hardware.SensorType.Accelerometer)
{
float x = e.Values[0];
float y = e.Values[1];
float z = e.Values[2];DateTime curTime = System.DateTime.Now;
if (hasUpdated == false)
{
hasUpdated = true;
lastUpdate = curTime;
last_x = x;
last_y = y;
last_z = z;
}
else
{
if ((curTime - lastUpdate).TotalMilliseconds > ShakeDetectionTimeLapse)
{
float diffTime = (float)(curTime - lastUpdate).TotalMilliseconds;
lastUpdate = curTime;
float total = x + y + z - last_x - last_y - last_z;
float speed = Math.Abs(total) / diffTime * 10000;if (speed > ShakeThreshold)
{
// --- Call parent's Feedback handler
parent.HandleFeedback();
}last_x = x;
last_y = y;
last_z = z;
}
}
}
}
} - In the MainActivity.cs OnCreate() function add code to add an accelerometer sensor recognition. Note that you also have to add usings for Android.Hardware and for HockeyApp.Android. The code for OnCreate() will look like this:
-
// --- Add Globals
public static string HOCKEYAPP_APPID = "<HOCKEYAPP ID>";
public static Android.App.Activity current;protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);// --- Register this as a listener with the underlying service.
var sensorManager = GetSystemService(SensorService) as Android.Hardware.SensorManager;
var sensor = sensorManager.GetDefaultSensor(Android.Hardware.SensorType.Accelerometer);current = this;
sensorManager.RegisterListener(new MyShakeHandler(current), sensor, Android.Hardware.SensorDelay.Normal);
InitializeHockeyApp();global::Xamarin.Forms.Forms.Init (this, bundle);
LoadApplication(new App());
} - In the AndroidManifest.xml add permissions to the sensors
-
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true" />
<application android:label="xForms-FeedbackDemo"></application>
</manifest> - In my scenario I also wanted a button on an about page that can be used to trigger the feedback logic from XAML. To make it work with a Shared code project in Xamarin Forms, I defined a DROID compilation definition so I can conditionally work with Android specific code
- In the XAML page you want to add a feedback button connect to the MainActivity’s logic.
-
using System;
using Xamarin.Forms;#if DROID
using HockeyApp.Android;
using XamFormsFeedbackDemo.Droid;
#endifnamespace XamFormsFeedbackDemo
{
public partial class MainPage : ContentPage
{
public MainPage ()
{
InitializeComponent ();
}
public void btnFeedback(object sender, EventArgs e)
{
#if DROID
FeedbackManager.SetActivityForScreenshot(MainActivity.current);
FeedbackManager.TakeScreenshot(MainActivity.current);FeedbackManager.ShowFeedbackActivity(MainActivity.current);
#endif
}
}
}
You can download the code from GitHub here.
Happy Coding!
Building code is always fun, especially when you get to work with new technologies and cool tools that make our lives as developers easier. One of those concepts that is driving a lot of organizations is that of DevOps, which we will define here as an approach for automating and connecting work done with released software. In this article I’d like to show how to connect some of the tools available from Microsoft to work with mobile applications. This will include Xamarin, Team Services, HockeyApp and Azure Mobile Apps.
The process flow
- Create a Team Project – myXamarinDemo
- In Visual Studio create a Xamarin Forms with XAML and PCL project
- Add the solution to source control (use GIt and navigate to select the team project you created)
- Commit & Sync
- In Team Services add a build definition (Xamarin.Android template)
- Remove the steps that activate and deactivate the license, then queue a build
- In VS droid project add HockeyApp.droid component and code to register app
DevOps is
Wow, what a great turnout this last week at Open Source North in Minneapolis. Kudos to Jeff Urban and team for putting on another great show! Here are some links to more information from the talk...
- VSTS – http://visualstudio.com
- HockeyApp – http://hockeyapp.net
- Improving – http://improving.com
- Mobile Lab - http://aka.ms/MobileDev1
As promised here’s the slide deck from last week. I’m working with Speaker Deck to make them available and still figuring out how to get make it work. Enjoy!
Just finished with the Global Azure Boot Camp last week, wanted to post links to the deck and to the downloads.
Since Windows 8 came out its been hard to find some tools that used to work so well with previous versions of Windows. One such tool is Live Writer, which was part of Windows Essentials. I came across this a couple weeks ago and wanted to share, I’ve been using it to work with my blogs and you can get it from http://openlivewriter.org/. I’m starting a new blog and will be updating BenkoTIPS to have an aggregated feed of items from historical blogs I’ve worked on. Should be a fun project.
Enjoy!
This morning, club President Vince Bullinger, Vice President of Membership Mike Benkovich (and his daughter) and Treasurer Brette Esterbrooks visited the Crest Toastmasters club in Eden Prairie. It is an advanced club filled with past district leaders that focus on improving Toastmasters clubs in the area.
This was a great opportunity to not only get the Elusive Gilded Gavel (EGG), but also to connect with advanced Toastmasters and see how they run a meeting. We promoted our upcoming TechMasters After Dark event as well, and passed out a handful of copies of our flyer for the event.
Now, other clubs will be visiting our club to not only see what we do well, but see if they can offer suggestions on how to improve. Also, we may snag members or dual members of other clubs if they like the way we run things or if they are technology-focused in their careers (as we are). Plus, we may end up in the district newsletter and on the EGG website.
Visiting other clubs is always a great idea, but advanced clubs like this one are a special treat.
-
Reviewing Julie Ng's CI/CD Checklist
@MikeBenkovich - 8/7/2023
-
The Right Things
@MikeBenkovich - 1/5/2023
-
Agile DevOps West 2022
@MikeBenkovich - 6/16/2022
-
DevUp 2022
@MikeBenkovich - 6/8/2022
-
Azure Office Hour Fridays
@MikeBenkovich - 5/4/2021
-
Using Cosmos DB for my Blog
@MikeBenkovich - 4/30/2021
-
Pi Day thoughts
@MikeBenkovich - 3/15/2021
-
Sharing References
@MikeBenkovich - 3/11/2021
-
Features I'd like to see
@imatest - 3/10/2021
-
Speechcraft!
@MikeBenkovich - 3/9/2021
-
Hello World!
@TM - 3/9/2021
-
Thinking about Messages
@MikeBenkovich - 3/9/2021
-
Hello World!
@msdn - 3/8/2021
-
Adding Avatars
@MikeBenkovich - 2/28/2021
-
Minnetonka has Momentum!
@MikeBenkovich - 2/21/2021
-
Love the Site
@mavis - 2/20/2021
-
TMAD and the Technical Interview
@MikeBenkovich - 2/15/2021
-
Permit to cloud
@imatest - 2/15/2021
-
Sticky Minds post
@imatest - 2/15/2021
-
5 Minutes to Code
@MikeBenkovich - 2/15/2020
-
Thank you Microsoft - MVP 2019-20
@MikeBenkovich - 8/1/2019
-
Visual Studio 2019 Launch Event - MSP
@MikeBenkovich - 4/1/2019
-
TechMasters After Dark and the Technical Interview
@MikeBenkovich - 2/10/2019
-
This year at Build 2018 - Azure for Enterprise Developers
@MikeBenkovich - 5/5/2018
-
Deploying a Shared Dashboard in Azure
@MikeBenkovich - 4/26/2018
-
Azure for the Enterprise Developer
@MikeBenkovich - 4/25/2018
-
How to record a UI Test on Android with Xamarin tools
@MikeBenkovich - 7/10/2017
-
rebuild17 Resources
@MikeBenkovich - 5/29/2017
-
Re-BUILD 2017, bringing the best of BUILD conference to cities near you
@MikeBenkovich - 5/14/2017
-
Temporary Post Used For Theme Detection (5a4bc502-4949-4ece-928e-0c48759d9d6e - 3bfe001a-32de-4114-a6b4-4005b770f6d7)
@MikeBenkovich - 3/24/2017
-
Announcing Visual Studio 2017 Best of Launch Events
@MikeBenkovich - 3/23/2017
-
VS 2017 Launch Live Notes
@MikeBenkovich - 3/7/2017
-
Adding HockeyApp feedback for Android to a Xamarin Forms app
@MikeBenkovich - 8/20/2016
-
Playing with MSFT Mobile DevOps story end to end
@MikeBenkovich - 7/21/2016
-
Hello KCDC!
@MikeBenkovich - 6/24/2016
-
KCDC 2016–Session info
@MikeBenkovich - 6/24/2016
-
Open Source North 2016
@MikeBenkovich - 6/9/2016
-
Global Azure Bootcamp 2016
@MikeBenkovich - 4/20/2016
-
Check out Open Live Writer
@MikeBenkovich - 4/19/2016
-
TechMasters Captures the Elusive Guilded Gavel
@MikeBenkovich - 2/18/2016
-
Test Again
@MikeBenkovich - 2/11/2016
-
Welcome to BlogEngine.NET using Microsoft SQL Server
@MikeBenkovich - 2/11/2016
-
New Post 3
@MikeBenkovich - 2/11/2016
-
Using BlogEngine.NET
@MikeBenkovich - 2/11/2016
-
TechMasters Captured the Elusive Gilded Gavel!
@MikeBenkovich - 2/6/2016
-
Announcing TechMasters After Dark: Parliamentary Procedure in Action
@MikeBenkovich - 2/2/2016
-
Get Azure Tools 2.7 for some great new features including the new Cloud Explorer
@MikeBenkovich - 8/20/2015
-
New Leadership Team!
@MikeBenkovich - 7/14/2015
-
Issue with Xamarin Forms - InitializeComponent does not exist - Xamarin XAML is not Windows XAML
@MikeBenkovich - 2/2/2015
-
Setting a schema for the database in Azure Mobile Services
@MikeBenkovich - 1/12/2015
-
Some Common Xamarin.Forms XAML Control Properties
@MikeBenkovich - 12/28/2014
-
Working with Xamarin Forms and Navigation
@MikeBenkovich - 12/16/2014
-
CloudTip 15-Avoid a gotcha in naming projects with Mobile Services
@MikeBenkovich - 12/15/2014
-
How to detect an iOS device when working with Xamarin and Visual Studio
@MikeBenkovich - 12/2/2014
-
Email Exploit No.9 You got Voicemail
@MikeBenkovich - 9/8/2014
-
Avoiding Hacker Trix
@MikeBenkovich - 8/19/2014
-
Upgrading to Developer Preview of Windows Phone 8.1
@MikeBenkovich - 4/13/2014
-
Did you know…
@MikeBenkovich - 4/12/2014
-
CloudTip #17-Build Connected Windows 8 Apps with Windows Azure
@MikeBenkovich - 7/10/2012
-
Did you see Windows Phone 8 Preview?
@MikeBenkovich - 6/20/2012
-
CloudTip #16-Meet the new HTML based Windows Azure Management Portal
@MikeBenkovich - 6/7/2012
-
How to install Win 8 Release Preview from an ISO image
@MikeBenkovich - 5/30/2012
-
CloudTip #15-MEET Windows Azure
@MikeBenkovich - 5/20/2012
-
CloudTip #14-How do I get SQL Profiler info from SQL Azure?
@MikeBenkovich - 5/18/2012
-
CloudTip #13-What do you need to know to get started?
@MikeBenkovich - 5/17/2012
-
Easy Money
@MikeBenkovich - 5/10/2012
-
Get your App into the Windows 8 Store!
@MikeBenkovich - 5/8/2012
-
Cloud Tip #12-Get Started with SQL Azure
@MikeBenkovich - 4/27/2012
-
Cloud Tip #11-Activate your MSDN Benefits
@MikeBenkovich - 4/18/2012
-
Cloud Tip#10-Use the Windows Azure Toolkit for Windows 8 to add interaction to your Metro Applications
@MikeBenkovich - 4/17/2012
-
Cloud Tip #9-Add Microsoft.IdentityModel to the GAC with a Startup Task
@MikeBenkovich - 4/7/2012
-
Cloud Tip #8-Using ACS without SSL
@MikeBenkovich - 4/6/2012
-
Cloud Tip #7-Configuring your firewall at work for cloud development
@MikeBenkovich - 4/5/2012
-
Cloud Tip #6-Encrypting the web.config with Visual Basic
@MikeBenkovich - 4/3/2012
-
Cloud Tip #5-Secure your settings in Web.config with Encryption
@MikeBenkovich - 4/2/2012
-
Cloud Tip #4-How to migrate an existing ASP.NET App to the Cloud
@MikeBenkovich - 4/1/2012
-
Cloud Tip #3–Find good examples
@MikeBenkovich - 3/31/2012
-
Cloud Tip #2–Finding Cloud Content that works for You
@MikeBenkovich - 3/29/2012
-
Cloud Tip #1–How to set a connection string in Web.config programmatically at runtime in Windows Azure
@MikeBenkovich - 3/27/2012
-
Questions on Tuning SQL Queries
@MikeBenkovich - 3/14/2012
-
Announcing Windows Azure Kick Start Events
@MikeBenkovich - 3/12/2012
-
Get Started with Cloud Computing and Windows Azure
@MikeBenkovich - 3/4/2012
-
New Webcast Series–Cloud Computing Soup to Nuts
@MikeBenkovich - 1/31/2012
-
Which way?
@MikeBenkovich - 7/2/2004
-
Starting out
@MikeBenkovich - 6/16/2004