问题列表 - 第31029页

带有mapview的Google地图和应用有不同的当前位置

我有一个mapview,我想跟踪用户的当前位置.我的手机设置中激活了GPS以及"使用无线网络".然而,由于我在室内,我没有得到GPS定位,因此位置是通过网络确定的; wifi点可用.

我正在运行Google地图应用以及我的应用运行.

奇怪的是,谷歌地图和我的应用程序之间的当前位置不同,谷歌地图非常准确,而在我的应用程序中,位置不知何故离开了几百米.

在我的应用程序中,我基本上执行以下操作(现在用于调试目的):

1)最初在地图上放置一个标记:通过检索到的geopoint locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

2)最初在地图上放置另一个标记:通过检索到的geopoint locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

这会将两个提供者的最后已知位置放在地图上(最终从我的应用程序外部知道).

3)然后定期更新(因为我在这里室内没有获得GPS修复),我这样做:

locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, baseLocationListener);
Run Code Online (Sandbox Code Playgroud)

在两种情况下,您都可以看到我传递0参数的频率和距离.

在应用清单中,授予以下权限:

android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_MOCK_LOCATION
Run Code Online (Sandbox Code Playgroud)

实际上我的baseLocationListener确实被调用,我在日志中看到了,但更新的位置与上一个已知的当前位置(LocationManager.NETWORK_PROVIDER)相同,相同的纬度/经度.

我想也许我忽略了某些东西或错过了参数或设置,或者我的代码有错误.因此,我在Android市场安装了一些其他(总共3个)LBS应用程序,这些应用程序也显示当前用户的位置.这些应用程序中显示的当前位置等于我的应用程序中的位置 - 它们都是100米关闭 - 但至少完全相同.

请看截图: 截图http://img33.imageshack.us/img33/8679/mapproblem.png

http://img33.imageshack.us/img33/8679/mapproblem.png

现在我想知道:

1)据我所知,getLastKnowLocation是系统范围而不是应用程序范围,为什么Google地图中的位置与所有其他应用程序之间存在差异?

2)Google Maps不会更新提供商的lastKnownLocation吗?

3)Google地图是否使用了除GPS_PROVIDER或NETWORK_PROVIDER之外的其他自定义位置提供商(即由于许可原因),因为它们在SDK中?

4)如何使用像Google Maps这样的NETWORK_PROVIDER实现同样准确的结果呢?

android google-maps android-maps

8
推荐指数
1
解决办法
7514
查看次数

如果我的retainCount为4则对iphone不利

更新代码

- (void) searchBarSearchButtonClicked:(UISearchBar *)theSearchBar {
    mytimer3=[NSTimer scheduledTimerWithTimeInterval:.03 target:self selector:@selector(show) userInfo:nil repeats:NO];


        NSLog(@" search is down");  



    //////////// rnd to hold keyboard





     //ovController.view.backgroundColor = [UIColor grayColor];


     self.tableView.scrollEnabled = NO;




     UserText=[self.searchDisplayController.searchBar text];
     myInt= UserText.length;
     //int myInt= [save length];



    // NSString *myStringPrt1 = [[NSString alloc] init];
    // NSString *myStringPrt2 = [[NSString alloc] init];


     if(UserText.length>3)

     {
     //[ovController.view removeFromSuperview];
     //[tableView reloadData];
     url=nil;
    // myStringPrt1=@"http://find.php?keyword=";
    NSString * myStringPrt2=UserText;
    // myStringPrt1=[myStringPrt1 stringByAppendingString:myStringPrt2];
    // myStringPrt1 = [myStringPrt1 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

    // loadingView.hidden=NO;




         NSString *outputString = [[NSString stringWithString:@"http://find.php?keyword="] stringByAppendingString: UserText];
         outputString …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c

-1
推荐指数
1
解决办法
279
查看次数

最简单的MDX请求?

什么是最简单的MDX请求?

我想测试我的MDX端点是否正确回答了一个非常简单的请求.
在SQL中,我会说SELECT 1;

mdx business-intelligence

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

如何使用C在char中存储8位

我的意思是,如果我想存储例如11110011我想将它存储在内存中的1个字节而不是字符数组中.

例如:如果我在使用scanf时写入10001111作为输入,它只获取第一个1并将其存储在变量中,而我想要的是将整个值放入char类型的变量中,只消耗一个字节的内存.

c binary char

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

如何将哈希数据转换为原始数据?

可能重复:
是否可以解密md5哈希?

我散列数据,ComputeHash如何从散列数据中学习原始数据?

private void btn_Hash_Click(object sender, EventArgs e)
{
    HashAlgorithm ha = HashAlgorithm.Create();
    Stream file = new FileStream(@"C:\temp\simetrik.txt", FileMode.Open, FileAccess.Read);
    hashClass.hash = ha.ComputeHash(file);

    listBox1.Items.Add(BitConverter.ToString(hashClass.hash));
}
Run Code Online (Sandbox Code Playgroud)

.net c# cryptography visual-studio-2008 visual-studio

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

VBScript:具有多个名称空间的XPath查询

XPath应该使用什么查询来访问GetLogisticsOfferDateResult节点?我附上了我正在使用的vbscript.我怀疑问题与文档中的多个名称空间有关.但是如何在XPath中引用第二个命名空间?

Dim responseXML
responseXML = '"<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/""><s:Body><GetLogisticsOfferDateResponse xmlns=""http://schneider-electric.com/OrderEntryService""><GetLogisticsOfferDateResult>2010-07-20</GetLogisticsOfferDateResult></GetLogisticsOfferDateResponse></s:Body></s:Envelope>"'

Dim responseDoc
Set responseDoc = WScript.CreateObject("MSXML2.DOMDocument.6.0")
responseDoc.loadXML(responseXML)
responseDoc.setProperty "SelectionNamespaces", "xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'"
Dim requestedNode
'This node is not found
'Set requestedNode = responseDoc.selectSingleNode("//s:Envelope//s:Body//GetLogisticsOfferDateResponse//GetLogisticsOfferDateResult")

'This node is found
Set requestedNode = responseDoc.selectSingleNode("//s:Envelope//s:Body")
'This node is found
'Set requestedNode = responseDoc.selectSingleNode("//s:Envelope")

If requestedNode Is Nothing Then
    WScript.Echo "Node not found"
Else
    WScript.Echo requestedNode.text
End If

Set responseDoc = Nothing
Set LODateNode = Nothing
Run Code Online (Sandbox Code Playgroud)

vbscript xpath

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

按最大条件匹配排序

请帮我创建一个包含10'where'子句的选择查询,顺序应该是这样的:结果应该按照大多数关键字(条件)匹配到最不匹配的顺序显示.

注意:所有10个条件都带有"OR".

请帮我创建这个查询.我正在使用ms-sql server 2005

喜欢:

Select *
  from employee
 where empid in (1,2,4,332,434)
    or empname like 'raj%'
    or city = 'jodhpur'
    or salary >5000
Run Code Online (Sandbox Code Playgroud)

在上面的查询中,所有那些匹配最大条件的记录应该在顶部,而较少匹配的条件记录应该在底部.

sql select sql-order-by where-clause

7
推荐指数
1
解决办法
2159
查看次数

Android相对布局放置问题

我在使用XML创建相对布局时遇到问题,列表项用于ListView中的一系列项目.我已经尝试了好几个小时,我试图让它看起来像我想要的但是不能让所有东西出现在正确的位置而不是重叠或错位.我可以获得第一个图像和下两个textview,但无法获得最后的textview和imageview.

我附上了一个线框样式的图像,说明我是如何尝试它的,并且想知道是否有人可以帮助我?

替代文字http://i26.tinypic.com/6fz702.jpg

  • 右边的ImageView是行的整个高度的设置图标,周围是否有填充?
  • 两个TextView占据了宽度的大部分.地址textview有可能文本很长,所以如果空间不足,可能需要截断,或理想情况下缩小字体大小?
  • 下一个TextView将只包含一个最多5个字符的小字符串.
  • 最后一个ImageView是一个小箭头,表示此列表项可以单击以获取更多信息.它需要像显示的那样居中.
  • 我想如果图标,最后一个textview和最后一个图像总是在列表中的同一位置/对齐方式.

如果有人可以提供一些帮助,我将非常感激.

干杯伙计们

android listview textview relativelayout imageview

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

如何使用原型获取锚标记的父ID?

Event.observe(window, 'load',
function() { 

    $$('a.tag_links').each(function(s) {
        //alert(s.parent.parent.id); //How to get id of its parent to parent
    });
}
);
Run Code Online (Sandbox Code Playgroud)

我想获得父元素的id.

结构是这样的.

 <div class="home-page" id='entity-1'>
    <div class="index-page-category">

    <a href="/entities/category/food" class="tag_links">food</a>

</div>
Run Code Online (Sandbox Code Playgroud)

结果应该是entity-1

html javascript prototypejs

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

为什么ItemContainerGenerator返回null?

我有一个ListBox,我需要将其ControlTemplate设置为Virtualizing WrapPanel,它是一个扩展VirtualizingPanel的类,使用如下所示的样式:

<Style TargetType="{x:Type ListBox}" x:Key="PhotoListBoxStyle">
                <Setter Property="Foreground" Value="White" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate  TargetType="{x:Type ListBox}" >
                            <s:VirtualizingVerticalWrapPanel>
                            </s:VirtualizingVerticalWrapPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
Run Code Online (Sandbox Code Playgroud)

现在,在下面虚拟化WrapPanel的私有方法中,我尝试访问this.ItemContainerGenerator,但我得到null值,任何想法是什么问题?

private void RealizeFirstItem()
{
    IItemContainerGenerator generator = this.ItemContainerGenerator;
    GeneratorPosition pos = generator.GeneratorPositionFromIndex(0);

    using (generator.StartAt(pos, GeneratorDirection.Forward))
    {
        UIElement element = generator.GenerateNext() as UIElement;

         generator.PrepareItemContainer(element);

                    this.AddInternalChild(element);
    }
 }
Run Code Online (Sandbox Code Playgroud)

wpf

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