小编For*_*ing的帖子

Google Maps V2无法使用正确的密钥在生产环境中工作

我在使用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)

这个错误显然表明我的身份证明有问题吗?我究竟做错了什么?

android google-maps

29
推荐指数
2
解决办法
3万
查看次数

在C#中对嵌套字符串列表进行排序

我想要实现的是按字母顺序排序的嵌套列表.

我的输入:

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)

我不确定如何在外面对列表进行排序.帮助将不胜感激!

提前致谢!

c# sorting

5
推荐指数
1
解决办法
2090
查看次数

将文件从应用程序安装文件夹复制到本地存储

我正在尝试将文件从我的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)

有任何想法吗?

c# windows

3
推荐指数
1
解决办法
3802
查看次数

XAML水平滚动有两个项目

我在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)

xaml windows-8

2
推荐指数
1
解决办法
4011
查看次数

使foreach循环参数更有效

快速问题,我已经编写了这段代码(它完美无缺)

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循环中的参数可以更容易地以某种方式...

c# foreach

0
推荐指数
1
解决办法
69
查看次数

标签 统计

c# ×3

android ×1

foreach ×1

google-maps ×1

sorting ×1

windows ×1

windows-8 ×1

xaml ×1