原文:与众不同 windows phone (20) - Device(设备)之位置服务(GPS 定位), FM 收音机, 麦克风, 震动器

[索引页]
[源码下载]

与众不同 windows phone (20) - Device(设备)之位置服务(GPS 定位), FM 收音机, 麦克风, 震动器

作者:webabcd

介绍
与众不同 windows phone 7.5 (sdk 7.1) 之设备

  • 位置服务(GPS 定位)
  • FM 收音机
  • 麦克风
  • 震动器

示例
1、演示如何使用位置服务(GPS 定位)
GpsDemo.xaml

  1. <phone:PhoneApplicationPage
  2. x:Class="Demo.Device.GpsDemo"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  6. xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. FontFamily="{StaticResource PhoneFontFamilyNormal}"
  10. FontSize="{StaticResource PhoneFontSizeNormal}"
  11. Foreground="{StaticResource PhoneForegroundBrush}"
  12. SupportedOrientations="Portrait" Orientation="Portrait"
  13. mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
  14. shell:SystemTray.IsVisible="True">
  15.  
  16. <Grid x:Name="LayoutRoot" Background="Transparent">
  17. <StackPanel Orientation="Vertical">
  18.  
  19. <!--跳转到隐私声明页(如果使用了 GPS 则必须要有“隐私声明”,否则不会通过微软的审核)-->
  20. <HyperlinkButton Content="隐私声明" NavigateUri="/Device/PrivacyPolicy.xaml" FontSize="{StaticResource PhoneFontSizeNormal}" Margin="10,6" HorizontalAlignment="Left" />
  21.  
  22. <TextBlock Name="lblStatus" />
  23.  
  24. <Button Name="btnLow" Content="低精度定位" Click="btnLow_Click" />
  25. <Button Name="btnHigh" Content="高精度定位" Click="btnHigh_Click" />
  26. <Button Name="btnClose" Content="关闭定位" Click="btnClose_Click" />
  27.  
  28. <TextBlock Name="lblMsg" />
  29.  
  30. </StackPanel>
  31. </Grid>
  32.  
  33. </phone:PhoneApplicationPage>

GpsDemo.xaml.cs

  1. /*
  2. * 演示如何使用位置服务(GPS 定位)
  3. *
  4. * GeoCoordinateWatcher - 用于提供地理位置数据
  5. * Start() - 启动位置服务
  6. * TryStart(bool suppressPermissionPrompt, TimeSpan timeout) - 尝试启动位置服务,返回值为位置服务是否启动成功
  7. * suppressPermissionPrompt - 是否禁用权限提示对话框。true为禁用,false为启用
  8. * timeout - 启动位置服务的超时时间
  9. * Stop() - 停止位置服务
  10. *
  11. * DesiredAccuracy - 指定提供位置服务的精度级别(System.Device.Location.GeoPositionAccuracy 枚举)
  12. * Default - 低精度定位
  13. * High - 高精度定位
  14. * Permission - 位置提供程序的权限,只读(System.Device.Location.GeoPositionPermission 枚举)
  15. * Unknown - 权限未知
  16. * Granted - 授予定位权限
  17. * Denied - 拒绝定位权限
  18. * Status - 位置服务的状态(System.Device.Location.GeoPositionStatus 枚举)
  19. * Ready - 已经准备好相关数据
  20. * Initializing - 位置提供程序初始化中
  21. * NoData - 无有效数据
  22. * Disabled - 位置服务不可用
  23. * Position - 定位的位置数据,只读(Position.Location 是一个 System.Device.Location.GeoCoordinate 类型的对象)
  24. * MovementThreshold - 自上次触发 PositionChanged 事件后,位置移动了此属性指定的距离后再次触发 PositionChanged 事件(单位:米)
  25. * 此属性默认值为 0,即位置的任何改变都会触发 PositionChanged 事件
  26. *
  27. * PositionChanged - 经纬度数据发生改变时所触发的事件(系统会根据 MovementThreshold 属性的值来决定何时触发 PositionChanged 事件,当位置服务被打开后第一次得到位置数据时也会触发此事件)
  28. * StatusChanged - 位置服务的状态发生改变时所触发的事件
  29. *
  30. *
  31. *
  32. * GeoCoordinate - 地理坐标
  33. * Altitude - 海拔高度(单位:米)
  34. * VerticalAccuracy - 海拔高度的精度(单位:米)
  35. * Longitude - 经度
  36. * Latitude - 纬度
  37. * IsUnknown - 是否无经纬度数据。true代表无数据,false代表有数据
  38. * HorizontalAccuracy - 经纬度的精度(单位:米)
  39. * Course - 行进方向(单位:度,正北为 0 度)
  40. * Speed - 行进速度(单位:米/秒)
  41. */
  42.  
  43. using System;
  44. using System.Collections.Generic;
  45. using System.Linq;
  46. using System.Net;
  47. using System.Windows;
  48. using System.Windows.Controls;
  49. using System.Windows.Documents;
  50. using System.Windows.Input;
  51. using System.Windows.Media;
  52. using System.Windows.Media.Animation;
  53. using System.Windows.Shapes;
  54. using Microsoft.Phone.Controls;
  55.  
  56. using System.Device.Location;
  57. using System.Threading;
  58.  
  59. namespace Demo.Device
  60. {
  61. public partial class GpsDemo : PhoneApplicationPage
  62. {
  63. private GeoCoordinateWatcher _watcher;
  64.  
  65. public GpsDemo()
  66. {
  67. InitializeComponent();
  68.  
  69. _watcher = new GeoCoordinateWatcher();
  70. }
  71.  
  72. private void btnLow_Click(object sender, RoutedEventArgs e)
  73. {
  74. // 开启低精度位置服务
  75. StartLocationService(GeoPositionAccuracy.Default);
  76. }
  77.  
  78. private void btnHigh_Click(object sender, RoutedEventArgs e)
  79. {
  80. // 开启高精度位置服务
  81. StartLocationService(GeoPositionAccuracy.High);
  82. }
  83.  
  84. private void btnClose_Click(object sender, RoutedEventArgs e)
  85. {
  86. StopLocationService();
  87. }
  88.  
  89. private void StartLocationService(GeoPositionAccuracy accuracy)
  90. {
  91. _watcher = new GeoCoordinateWatcher(accuracy);
  92. // 位置每移动 20 米触发一次 PositionChanged 事件
  93. _watcher.MovementThreshold = ;
  94.  
  95. _watcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(_watcher_StatusChanged);
  96. _watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(_watcher_PositionChanged);
  97.  
  98. lblStatus.Text = "GPS 服务启动中...";
  99.  
  100. new Thread((x) =>
  101. {
  102. // 启动 GPS 服务,会阻塞 UI 线程,所以要在后台线程处理
  103. if (!_watcher.TryStart(true, TimeSpan.FromSeconds()))
  104. {
  105. Dispatcher.BeginInvoke(delegate
  106. {
  107. lblStatus.Text = "GPS 服务无法启动";
  108. });
  109. }
  110. }).Start();
  111.  
  112. }
  113.  
  114. private void StopLocationService()
  115. {
  116. if (_watcher != null)
  117. _watcher.Stop();
  118.  
  119. lblStatus.Text = "GPS 服务已关闭";
  120. }
  121.  
  122. void _watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
  123. {
  124. // 在 UI 上显示经纬度信息
  125. Dispatcher.BeginInvoke(delegate
  126. {
  127. lblMsg.Text = "经度: " + e.Position.Location.Longitude.ToString("0.000");
  128. lblMsg.Text += Environment.NewLine;
  129. lblMsg.Text += "纬度: " + e.Position.Location.Latitude.ToString("0.000");
  130. });
  131. }
  132.  
  133. void _watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
  134. {
  135. // 在 UI 上显示 GPS 服务状态
  136. Dispatcher.BeginInvoke(delegate
  137. {
  138. switch (e.Status)
  139. {
  140. case GeoPositionStatus.Disabled:
  141. if (_watcher.Permission == GeoPositionPermission.Denied)
  142. lblStatus.Text = "GPS 服务拒绝访问";
  143. else
  144. lblStatus.Text = "GPS 服务不可用";
  145. break;
  146. case GeoPositionStatus.Initializing:
  147. lblStatus.Text = "GPS 服务初始化";
  148. break;
  149. case GeoPositionStatus.NoData:
  150. lblStatus.Text = "GPS 无有效数据";
  151. break;
  152. case GeoPositionStatus.Ready:
  153. lblStatus.Text = "GPS 接收数据中";
  154. break;
  155. }
  156. });
  157. }
  158. }
  159. }

2、演示如何使用 FM 收音机
FMRadioDemo.xaml

  1. <phone:PhoneApplicationPage
  2. x:Class="Demo.Device.FMRadioDemo"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  6. xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. FontFamily="{StaticResource PhoneFontFamilyNormal}"
  10. FontSize="{StaticResource PhoneFontSizeNormal}"
  11. Foreground="{StaticResource PhoneForegroundBrush}"
  12. SupportedOrientations="Portrait" Orientation="Portrait"
  13. mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
  14. shell:SystemTray.IsVisible="True">
  15.  
  16. <Grid x:Name="LayoutRoot" Background="Transparent">
  17. <StackPanel Orientation="Vertical">
  18.  
  19. <TextBlock Name="lblStatus" />
  20.  
  21. <Button Name="btnStart" Content="打开收音机" Click="btnStart_Click" />
  22. <Button Name="btnClose" Content="关闭收音机" Click="btnClose_Click" />
  23.  
  24. <TextBlock Name="lblMsg" />
  25.  
  26. </StackPanel>
  27. </Grid>
  28.  
  29. </phone:PhoneApplicationPage>

FMRadioDemo.xaml.cs

  1. /*
  2. * 演示如何使用 FM 收音机
  3. *
  4. * FMRadio - 用于操作 FM 收音机的类
  5. * Instance - 返回 FMRadio 实例
  6. * CurrentRegion - 收音机的区域信息(Microsoft.Devices.Radio.RadioRegion 枚举)
  7. * UnitedStates - 美国
  8. * Japan - 日本
  9. * Europe - 其他地区
  10. * Frequency - 指定 FM 调频的频率
  11. * PowerMode - 打开或关闭收音机(Microsoft.Devices.Radio.RadioPowerMode 枚举)
  12. * On - 打开收音机
  13. * Off - 关闭收音机
  14. * SignalStrength - 当前频率的信号强度(RSSI - Received Signal Strength Indication)
  15. */
  16.  
  17. using System;
  18. using System.Collections.Generic;
  19. using System.Linq;
  20. using System.Net;
  21. using System.Windows;
  22. using System.Windows.Controls;
  23. using System.Windows.Documents;
  24. using System.Windows.Input;
  25. using System.Windows.Media;
  26. using System.Windows.Media.Animation;
  27. using System.Windows.Shapes;
  28. using Microsoft.Phone.Controls;
  29.  
  30. using Microsoft.Devices.Radio;
  31. using System.Windows.Threading;
  32. using System.Threading;
  33.  
  34. namespace Demo.Device
  35. {
  36. public partial class FMRadioDemo : PhoneApplicationPage
  37. {
  38. private FMRadio _radio;
  39. private DispatcherTimer _timer;
  40.  
  41. public FMRadioDemo()
  42. {
  43. InitializeComponent();
  44.  
  45. // 实例化 FMRadio,收听 90.5 频率
  46. _radio = FMRadio.Instance;
  47. _radio.CurrentRegion = RadioRegion.Europe;
  48. _radio.Frequency = 90.5;
  49.  
  50. _timer = new DispatcherTimer();
  51. _timer.Interval = TimeSpan.FromMilliseconds();
  52. _timer.Tick += new EventHandler(_timer_Tick);
  53. _timer.Start();
  54.  
  55. if (_radio.PowerMode == RadioPowerMode.On)
  56. lblStatus.Text = "收音机已打开";
  57. else
  58. lblStatus.Text = "收音机已关闭";
  59. }
  60.  
  61. void _timer_Tick(object sender, EventArgs e)
  62. {
  63. // 实时显示当前频率及信号强度
  64. lblMsg.Text = "调频:" + _radio.Frequency;
  65. lblMsg.Text += Environment.NewLine;
  66. lblMsg.Text += "RSSI:" + _radio.SignalStrength.ToString("0.00");
  67. }
  68.  
  69. // 打开收音机
  70. private void btnStart_Click(object sender, RoutedEventArgs e)
  71. {
  72. lblStatus.Text = "收音机打开中。。。";
  73.  
  74. // 首次启动收音机可能需要多达 3 秒的时间,以后再启动收音机则会在 100 毫秒以内,所以建议在后台线程打开收音机
  75. new Thread((x) =>
  76. {
  77. _radio.PowerMode = RadioPowerMode.On;
  78. Dispatcher.BeginInvoke(delegate
  79. {
  80. lblStatus.Text = "收音机已打开";
  81. });
  82. }).Start();
  83. }
  84.  
  85. // 关闭收音机
  86. private void btnClose_Click(object sender, RoutedEventArgs e)
  87. {
  88. _radio.PowerMode = RadioPowerMode.Off;
  89. lblStatus.Text = "收音机已关闭";
  90. }
  91. }
  92. }

3、演示如何使用麦克风
MicrophoneDemo.xaml

  1. <phone:PhoneApplicationPage
  2. x:Class="Demo.Device.MicrophoneDemo"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  6. xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. FontFamily="{StaticResource PhoneFontFamilyNormal}"
  10. FontSize="{StaticResource PhoneFontSizeNormal}"
  11. Foreground="{StaticResource PhoneForegroundBrush}"
  12. SupportedOrientations="Portrait" Orientation="Portrait"
  13. mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
  14. shell:SystemTray.IsVisible="True">
  15.  
  16. <Grid x:Name="LayoutRoot" Background="Transparent">
  17. <StackPanel Orientation="Vertical">
  18.  
  19. <TextBlock Name="lblMsg" />
  20.  
  21. <Button Name="btnRecord" Content="录音" Click="btnRecord_Click" />
  22. <Button Name="btnPlay" Content="播放" Click="btnPlay_Click" />
  23. <Button Name="btnStop" Content="停止" Click="btnStop_Click" />
  24.  
  25. </StackPanel>
  26. </Grid>
  27.  
  28. </phone:PhoneApplicationPage>

MicrophoneDemo.xaml.cs

  1. /*
  2. * 演示如何使用麦克风进行录音
  3. *
  4. * Microphone - 用于捕获麦克风音频的类
  5. * Default - 返回默认的 Microphone 实例
  6. * All - 返回设备的全部 Microphone 实例集合
  7. * SampleRate - 获取音频的采样率
  8. * State - Microphone 的状态(Microsoft.Xna.Framework.Audio.MicrophoneState 枚举)
  9. * Started - 正在捕获音频
  10. * Stopped - 已经停止工作
  11. * BufferDuration - 麦克风捕获音频时的缓冲时长
  12. *
  13. * BufferReady - 当麦克风捕获的音频时长达到 BufferDuration 设置的值后所触发的事件
  14. *
  15. * GetData(byte[] buffer) - 将麦克风最近捕获到的音频数据写入到指定的缓冲区
  16. * GetSampleSizeInBytes(TimeSpan duration) - 麦克风捕获音频,根据音频时长返回音频字节数
  17. * GetSampleDuration(int sizeInBytes) - 麦克风捕获音频,根据音频字节数返回音频时长
  18. * Start() - 开始捕获
  19. * Stop() - 停止捕获
  20. */
  21.  
  22. using System;
  23. using System.Collections.Generic;
  24. using System.Linq;
  25. using System.Net;
  26. using System.Windows;
  27. using System.Windows.Controls;
  28. using System.Windows.Documents;
  29. using System.Windows.Input;
  30. using System.Windows.Media;
  31. using System.Windows.Media.Animation;
  32. using System.Windows.Shapes;
  33. using Microsoft.Phone.Controls;
  34.  
  35. using Microsoft.Xna.Framework.Audio;
  36. using System.IO;
  37. using System.Threading;
  38. using Microsoft.Xna.Framework;
  39.  
  40. namespace Demo.Device
  41. {
  42. public partial class MicrophoneDemo : PhoneApplicationPage
  43. {
  44. // silverlight 和 xna 混合编程时,所需要用到的计时器
  45. private GameTimer _timer;
  46.  
  47. private Microphone _microphone = Microphone.Default;
  48. private SoundEffectInstance _soundInstance; // 用于播放音频数据
  49. private byte[] _buffer; // 每一片录音数据的缓冲区
  50. private MemoryStream _stream = new MemoryStream(); // 整个录音数据的内存流
  51.  
  52. public MicrophoneDemo()
  53. {
  54. InitializeComponent();
  55.  
  56. _timer = new GameTimer();
  57. // 指定计时器每 1/30 秒执行一次,即帧率为 30 fps
  58. _timer.UpdateInterval = TimeSpan.FromTicks();
  59. // 每次帧更新时所触发的事件
  60. _timer.FrameAction += FrameworkDispatcherFrameAction;
  61. _timer.Start();
  62.  
  63. _microphone.BufferReady += new EventHandler<EventArgs>(_microphone_BufferReady);
  64. }
  65.  
  66. private void FrameworkDispatcherFrameAction(object sender, EventArgs e)
  67. {
  68. // 当使用 silverlight 和 xna 混合编程时,每次帧更新时都需要调用 FrameworkDispatcher.Update()
  69. FrameworkDispatcher.Update();
  70. }
  71.  
  72. void _microphone_BufferReady(object sender, EventArgs e)
  73. {
  74. // 当录音的缓冲被填满后,将数据写入缓冲区
  75. _microphone.GetData(_buffer);
  76. // 将缓冲区中的数据写入内存流
  77. _stream.Write(_buffer, , _buffer.Length);
  78. }
  79.  
  80. private void btnRecord_Click(object sender, RoutedEventArgs e)
  81. {
  82. if (lblMsg.Text != "录音中")
  83. {
  84. // 设置录音的缓冲时长为 0.5 秒
  85. _microphone.BufferDuration = TimeSpan.FromMilliseconds();
  86. // 设置录音用的缓冲区的大小
  87. _buffer = new byte[_microphone.GetSampleSizeInBytes(_microphone.BufferDuration)];
  88. // 初始化内存流
  89. _stream.SetLength();
  90.  
  91. _microphone.Start();
  92.  
  93. lblMsg.Text = "录音中";
  94. }
  95. }
  96.  
  97. private void btnPlay_Click(object sender, RoutedEventArgs e)
  98. {
  99. if (_stream.Length > )
  100. {
  101. // 播放录音
  102. Thread soundThread = new Thread(new ThreadStart(playSound));
  103. soundThread.Start();
  104.  
  105. lblMsg.Text = "播放录音";
  106. }
  107. }
  108.  
  109. private void btnStop_Click(object sender, RoutedEventArgs e)
  110. {
  111. if (_microphone.State == MicrophoneState.Started)
  112. {
  113. // 停止录音
  114. _microphone.Stop();
  115.  
  116. lblMsg.Text = "停止录音";
  117. }
  118. else if (_soundInstance.State == SoundState.Playing)
  119. {
  120. // 停止播放录音
  121. _soundInstance.Stop();
  122.  
  123. lblMsg.Text = "停止播放录音";
  124. }
  125. }
  126.  
  127. private void playSound()
  128. {
  129. // 播放内存流中的音频
  130. SoundEffect sound = new SoundEffect(_stream.ToArray(), _microphone.SampleRate, AudioChannels.Mono);
  131. _soundInstance = sound.CreateInstance();
  132. _soundInstance.Play();
  133. }
  134. }
  135. }

4、演示如何使用震动器
VibrationDemo.xaml

  1. <phone:PhoneApplicationPage
  2. x:Class="Demo.Device.VibrationDemo"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  6. xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. FontFamily="{StaticResource PhoneFontFamilyNormal}"
  10. FontSize="{StaticResource PhoneFontSizeNormal}"
  11. Foreground="{StaticResource PhoneForegroundBrush}"
  12. SupportedOrientations="Portrait" Orientation="Portrait"
  13. mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
  14. shell:SystemTray.IsVisible="True">
  15.  
  16. <Grid x:Name="LayoutRoot" Background="Transparent">
  17. <StackPanel Orientation="Vertical">
  18.  
  19. <Button Name="btnStart" Content="开始震动" Click="btnStart_Click" />
  20.  
  21. <Button Name="btnStop" Content="停止震动" Click="btnStop_Click" />
  22.  
  23. </StackPanel>
  24. </Grid>
  25.  
  26. </phone:PhoneApplicationPage>

VibrationDemo.xaml.cs

  1. /*
  2. * 演示如何使用震动器
  3. *
  4. * VibrateController - 用于控制震动器
  5. * Default - 获取 VibrateController 实例
  6. * Start(TimeSpan duration) - 指定震动时长,并使设备震动。有效时长在 0 - 5 秒之间,否则会抛出异常
  7. * Stop() - 停止设备的震动
  8. */
  9.  
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Net;
  14. using System.Windows;
  15. using System.Windows.Controls;
  16. using System.Windows.Documents;
  17. using System.Windows.Input;
  18. using System.Windows.Media;
  19. using System.Windows.Media.Animation;
  20. using System.Windows.Shapes;
  21. using Microsoft.Phone.Controls;
  22.  
  23. using Microsoft.Devices;
  24.  
  25. namespace Demo.Device
  26. {
  27. public partial class VibrationDemo : PhoneApplicationPage
  28. {
  29. public VibrationDemo()
  30. {
  31. InitializeComponent();
  32. }
  33.  
  34. private void btnStart_Click(object sender, RoutedEventArgs e)
  35. {
  36. // 震动 5 秒
  37. VibrateController.Default.Start(TimeSpan.FromMilliseconds( * ));
  38. }
  39.  
  40. private void btnStop_Click(object sender, RoutedEventArgs e)
  41. {
  42. // 停止震动
  43. VibrateController.Default.Stop();
  44. }
  45. }
  46. }

OK
[源码下载]

与众不同 windows phone (20) - Device(设备)之位置服务(GPS 定位), FM 收音机, 麦克风, 震动器的更多相关文章

  1. 与众不同 windows phone (18) - Device(设备)之加速度传感器, 数字罗盘传感器

    原文:与众不同 windows phone (18) - Device(设备)之加速度传感器, 数字罗盘传感器 [索引页][源码下载] 与众不同 windows phone (18) - Device ...

  2. 与众不同 windows phone (21) - Device(设备)之摄像头(拍摄照片, 录制视频)

    原文:与众不同 windows phone (21) - Device(设备)之摄像头(拍摄照片, 录制视频) [索引页][源码下载] 与众不同 windows phone (21) - Device ...

  3. 与众不同 windows phone (19) - Device(设备)之陀螺仪传感器, Motion API

    原文:与众不同 windows phone (19) - Device(设备)之陀螺仪传感器, Motion API [索引页][源码下载] 与众不同 windows phone (19) - Dev ...

  4. 与众不同 windows phone (23) - Device(设备)之硬件状态, 系统状态, 网络状态

    原文:与众不同 windows phone (23) - Device(设备)之硬件状态, 系统状态, 网络状态 [索引页][源码下载] 与众不同 windows phone (23) - Devic ...

  5. 与众不同 windows phone (22) - Device(设备)之摄像头(硬件快门, 自动对焦, 实时修改捕获视频)

    原文:与众不同 windows phone (22) - Device(设备)之摄像头(硬件快门, 自动对焦, 实时修改捕获视频) [索引页][源码下载] 与众不同 windows phone (22 ...

  6. 与众不同 windows phone (2) - Control(控件)

    原文:与众不同 windows phone (2) - Control(控件) [索引页][源码下载] 与众不同 windows phone (2) - Control(控件) 作者:webabcd介 ...

  7. 与众不同 windows phone (44) - 8.0 位置和地图

    [源码下载] 与众不同 windows phone (44) - 8.0 位置和地图 作者:webabcd 介绍与众不同 windows phone 8.0 之 位置和地图 位置(GPS) - Loc ...

  8. 与众不同 windows phone (35) - 8.0 新的启动器: ShareMediaTask, SaveAppointmentTask, MapsTask, MapsDirectionsTask, MapDownloaderTask

    [源码下载] 与众不同 windows phone (35) - 8.0 新的启动器: ShareMediaTask, SaveAppointmentTask, MapsTask, MapsDirec ...

  9. 与众不同 windows phone (13) - Background Task(后台任务)之后台文件传输(上传和下载)

    原文:与众不同 windows phone (13) - Background Task(后台任务)之后台文件传输(上传和下载) [索引页][源码下载] 与众不同 windows phone (13) ...

随机推荐

  1. 我的Python成长之路---第一天---Python基础(作业2:三级菜单)---2015年12月26日(雾霾)

    作业二:三级菜单 三级菜单 可一次进入各个子菜单 思路: 这个题看似不难,难点在于三层循环的嵌套,我的思路就是通过flag的真假来控制每一层的循环的,简单来说就是就是通过给每一层循环一个单独的布尔变量 ...

  2. 在不同编译环境中如何使用sleep()函数

    今天在学习有关时间函数时,想让程序暂时挂起,一段时间后在继续执行! 用到了系统函数sleep(): 在vc下sleep函数是以毫秒为单位,如果想让其停留3秒,需要这样做  sleep(3*1000); ...

  3. poj 3258 River Hopscotch 【二分】

    题目真是不好读,大意例如以下(知道题意就非常好解了) 大致题意: 一条河长度为 L,河的起点(Start)和终点(End)分别有2块石头,S到E的距离就是L. 河中有n块石头,每块石头到S都有唯一的距 ...

  4. 使用ItextSharp产PDF完整操作

    原文 使用ItextSharp产PDF完整操作 记得上回有写到用C#操作Excel(.net 4.0) 很多朋友说推荐用NPOI,的确,用微软自带的操作execl会有很大的问题.客户的主机不愿意安装e ...

  5. linux下抓取网页快照

    1.下载 https://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltoimage-0.11.0_rc1-static-i38 ...

  6. perl 为什么要用引用来做对象呢?

    perl 为什么要用引用来做对象呢? 因为一个重要的原因是 my 引用 脱离作用域,外部仍旧生效

  7. CodeForces 462B Appleman and Card Game(贪心)

    题目链接:http://codeforces.com/problemset/problem/462/B Appleman has n cards. Each card has an uppercase ...

  8. 开源JDBC工具类DbUtils

    本篇将会详细地介绍Apache公司的JDBC帮助工具类DbUtils以及如何使用.在上一篇中我们已经通过将以前对dao层使用JDBC操作数据库的冗余代码进行了简易封装形成自己的简单工具类JdbcUti ...

  9. 使用gradle打包jar包

    近期用android studio来做android开发的IDE,它是使用gradle来构建的,于是開始学习gradle. 如今有一个项目,里面有一个android-library的模块.我想在做re ...

  10. 解决android应用程序适用新老android系统版本方法

    老的android系统不能运行高版本系统的新方法,为了解决这个问题:  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ...