This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<NotificationOutcome> SendToAndroid(string hubName, string hubConnectionString, string message) | |
{ | |
//instantiate the notification hub | |
var hub = NotificationHubClient.CreateClientFromConnectionString(hubConnectionString, hubName); | |
//create the json payload | |
var json = new StringBuilder(); //string.Format("{ \"data\" : {\"msg\":\"{0}\"}}", message); | |
json.Append("{ \"data\" : {\"msg\":\""); | |
json.Append(message); | |
json.Append("\"}}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class NetworkConnectionManager | |
'ctor | |
Public Sub New() | |
'add a handler to pick up when network connectivity has changed | |
AddHandler Windows.Networking.Connectivity.NetworkInformation.NetworkStatusChanged, AddressOf OnNetworkStatusChanged | |
'get the current connection status | |
GetConnectionStatus() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
... | |
getActionBar().setDisplayHomeAsUpEnabled(true); | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//code ommitted for brevity | |
//... | |
if (!rootFrame.Navigate(typeof(MainPage), args.Arguments)) | |
{ | |
throw new Exception("Failed to create initial page"); | |
} | |
//... | |
//code ommitted for brevity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity | |
android:name="com.example.myfirstapp.MainActivity" | |
android:label="@string/app_name" > | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Load() | |
{ | |
object meteredConnectionPrompt = this.GetRoamingValue("meteredConnectionPrompt"); | |
if (meteredConnectionPrompt != null) | |
this.MeteredConnectionPrompt = (bool)meteredConnectionPrompt; | |
else | |
this.MeteredConnectionPrompt = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MediaControl.SoundLevelChanged += MediaControl_SoundLevelChanged; | |
private void MediaControl_SoundLevelChanged(object sender, object e) | |
{ | |
if ((MediaControl.SoundLevel == SoundLevel.Muted || MediaControl.SoundLevel == SoundLevel.Low) && MediaControl.IsPlaying) | |
{ | |
this.mediaElement.Pause(); | |
_isPlaying = false; | |
MediaControl.IsPlaying = false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MediaControl.PlayPauseTogglePressed += MediaControl_PlayPauseTogglePressed; | |
private void MediaControl_PlayPauseTogglePressed(object sender, object e) | |
{ | |
if (_isPlaying) | |
{ | |
this.mediaElement.Pause(); | |
_isPlaying = false; | |
MediaControl.IsPlaying = false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MediaControl.PausePressed += MediaControl_PausePressed; | |
private void MediaControl_PausePressed(object sender, object e) | |
{ | |
this.mediaElement.Pause(); | |
_isPlaying = false; | |
MediaControl.IsPlaying = false; | |
} |
NewerOlder