我在使用Android应用程序生产谷歌地图时遇到了重大麻烦.这就是我目前得到的(底部只是广告).

我遵循的关键步骤:
1)我已经确保我已经获得了正确的SHA1生产密钥,并且已经在Google Console API和应用程序中实现了它(谷歌提供的密钥).我已经注册了两个键 - 一个用于调试,一个用于生产
2)互联网,位置等正在运作
3)该应用程序在DEBUG模式下工作,但在通过USB签名并安装在设备上时不起作用.我已经三次检查了标志的SHA 1签名等.
4)MapsFragment来自Android Studio中提供的模板.
在生产模式下,log cat显示:
01-11 16:04:54.511 19346-19437/com.mike.mapstest E/Google Maps Android API? Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
01-11 16:04:54.516 19346-19437/com.mike.mapstest E/Google Maps Android API? In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: YOUR_KEY_HERE
Android Application (<cert_fingerprint>;<package_name>): <SHA1 Removed for this> ;com.mike.mapstest
Run Code Online (Sandbox Code Playgroud)
这个错误显然表明我的身份证明有问题吗?我究竟做错了什么?
我想要实现的是按字母顺序排序的嵌套列表.
我的输入:
fat, twat, gat //Line 1
cat, hat, bat // Line 2
twat, lack, rat // Line 3
Run Code Online (Sandbox Code Playgroud)
我希望输出为:
bat, cat, hat // Line 2
fat, gat, twat // Line 1
lack, rat, twat // Line 3
Run Code Online (Sandbox Code Playgroud)
如您所见,列表首先在内部排序,然后在外部排序.
我目前的实现是使用嵌套列表:
List<List<String>> testSort;
Run Code Online (Sandbox Code Playgroud)
我已设法使用此方法对内部列表进行排序:
public static List<List<String>> sortList(List<List<String>> input)
{
input.ForEach(delegate (List<string> o)
{
o.Sort();
});
return input;
}
Run Code Online (Sandbox Code Playgroud)
我不确定如何在外面对列表进行排序.帮助将不胜感激!
提前致谢!
我正在尝试将文件从我的Windows 8应用程序的已安装位置复制到其本地存储.我一直在研究并试图做到这一点无济于事.这是我到目前为止所提出的,但我不确定我哪里出错了.
private async void TransferToStorage()
{
try
{
// Get file from appx install folder
Windows.ApplicationModel.Package package = Windows.ApplicationModel.Package.Current;
Windows.Storage.StorageFolder installedLocation = package.InstalledLocation;
StorageFile temp1 = await installedLocation.GetFileAsync("track.xml");
// Read the file
var lines = await FileIO.ReadLinesAsync(temp1);
//Create the file in local storage
StorageFile myStorageFile = await localFolder.CreateFileAsync("track_iso.xml", CreationCollisionOption.ReplaceExisting);
// Write to it
await FileIO.WriteLinesAsync(myStorageFile, lines);
}
catch (Exception)
{
}
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我在itemspage上进行水平滚动时遇到了一些问题.
如果默认网格模板有更多数据并且屏幕调整到它,则它将水平滚动.但我也希望在页面中添加一个列表视图.
所以基本上,我希望页面与网格水平滚动,然后滚动到列表.
目前,它只是部分切断了"MessageList".
请参阅下面的XAML:
<common:LayoutAwarePage.Resources>
<!-- Collection of items displayed by this page -->
<CollectionViewSource
x:Name="itemsViewSource"
Source="{Binding Items}"
d:Source="{Binding AllGroups, Source={d:DesignInstance IsDesignTimeCreatable=True, Type=data:SampleDataSource}}"/>
</common:LayoutAwarePage.Resources>
<!--
This grid acts as a root panel for the page that defines two rows:
* Row 0 contains the back button and page title
* Row 1 contains the rest of the page layout
-->
<Grid Style="{StaticResource LayoutRootStyle}" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="0,0,0.429,0.429">
<Grid.RowDefinitions>
<RowDefinition Height="140"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<VisualStateManager.VisualStateGroups>
<!-- Visual states reflect the application's view …Run Code Online (Sandbox Code Playgroud) 快速问题,我已经编写了这段代码(它完美无缺)
foreach (XElement element in xdoc.Descendants("camera").Where(info => info.Element("group").Value == "A"))
{
A.Items.Add(AddToGroup(element));
}
foreach (XElement element in xdoc.Descendants("camera").Where(info => info.Element("group").Value == "B"))
{
B.Items.Add(AddToGroup(element));
}
Run Code Online (Sandbox Code Playgroud)
有没有办法让我更有效率?特别是,我想知道foreach循环是否可以以某种方式融合在一起,和/或foreach循环中的参数可以更容易地以某种方式...