刚刚开始在我的Android应用程序中实施Google Analytics V2,尽管我遇到了麻烦.
我相信我已经正确设置了属性和配置文件的帐户.我已经在analytics.xml文件和我使用的每个活动中提供了我的密钥
EasyTracker.getInstance().activityStart(this); 在onStart方法中
和
EasyTracker.getInstance().activityStop(this); 在每个活动的onStop方法中.
但是,我似乎没有在Google Analytics网站上看到任何结果.此外,我打开了调试选项,我可以在log cat中看到来自Gav2(Google Analytics)的各种消息,这意味着一个问题.
例如
11-04 21:56:48.000: W/GAV2(6376): Thread[main,5,main]: **Connection to service failed 1**
11-04 21:56:48.040: W/GAV2(6376): Thread[main,5,main]: **Need to call initialize() and be in fallback mode to start dispatch.**
11-04 21:56:48.050: I/GAV2(6376): Thread[main,5,main]: ExceptionReporter created, original handler is com.keypod.utils.AppCrashExceptionHandler
11-04 21:56:50.055: I/GAV2(6376): Thread[GAThread,5,main]: No campaign data found.
11-04 21:56:50.060: I/GAV2(6376): Thread[GAThread,5,main]: putHit called
11-04 21:56:50.410: I/GAV2(6376): Thread[GAThread,5,main]: putHit called
11-04 21:56:53.035: I/GAV2(6376): Thread[Service Reconnect,5,main]: connecting to Analytics service
11-04 21:56:53.035: …Run Code Online (Sandbox Code Playgroud) 我有一个我正在开始研究的android项目,我希望它的结构尽可能健壮.
我来自WPF MVVM背景,我一直在阅读有关Android应用程序架构的一些内容,但我无法找到关于我应该使用哪种架构的明确答案.
有人建议使用MVVM - http://vladnevzorov.com/2011/04/30/android-application-architecture-part-ii-architectural-styles-and-patterns/
和其他人建议使用MVC,但没有具体说明应该如何实现.
正如我所说,我来自WPF-MVVM背景,因此我知道它在很大程度上依赖于绑定,据我所知,Android中默认不支持绑定.
似乎有第三方解决方案 - http://code.google.com/p/android-binding/ 但我不知道我是否愿意依赖它.如果它的开发会停止并且未来的API等不支持它会怎么样?
基本上我正在寻找的是一个全面的教程,它将教会我构建应用程序结构的最佳实践.文件夹和类结构等我找不到任何全面的教程,我本以为Google会为其开发人员提供这样的教程.我只是不认为这种文档处理技术方面足够好 - http://developer.android.com/guide/topics/fundamentals.html
我希望我已经不够清楚,我不是要求太多,我只是想确保我的应用程序的结构,在我的代码将变成面条怪物.
谢谢!
我正在VS2010中创建一个Visual Basic程序.我正在使用DataGridView来显示.csv,但我不想显示左列,这很难看.
有什么形式可以隐藏它吗?

我正在使用他们的原生SDK为Android和iOS单独开发一个应用程序.但是,应用程序中有一些模块应该支持基本的2D(也可以是3D)技能,例如倾斜,缩放,矢量图形的旋转+例如在简单纹理平面上的各种可选花式效果.
我想将这个模块托管在一个视图的某个部分中,并且它的代码将尽可能在iOS和Android平台之间共享.
我一直潜伏在网络上寻求各种解决方案.
有像平台这样的平台
一个.Clutter(http://www.clutter-project.org/) - 我在移动设备上找不到任何示例.
湾 像Unity3D这样的平台,虽然我不认为它们可以帮到我很多,因为据我所知,整个应用程序必须在他们的平台上运行,而这不是我想要的.
那么,你们认为在iOS和Android之间共享2d/3d代码是否可行?如果是这样,你有什么方法可以推荐吗?
或者我应该使用每个设备的本机方法2d或3d图形?
谢谢!
我在网格中有一个按钮,其中包含许多其他按钮和控件
<Grid IsEnabled="false">
<Grid.ColumnsDefinition>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnsDefinition>
<Button Content="Run"/>
<Button Grid.Column="1" Content="Test"/>
<Button Grid.Column="2" Content="Cancel" IsEnabled="true"/>
</Grid>
Run Code Online (Sandbox Code Playgroud)
如您所见,网格已禁用,但其中的取消按钮应启用.
我遇到的问题是,即使我将内部按钮设置为启用,它仍然处于禁用状态,可能是因为其父级已禁用.
有没有办法覆盖此行为并强制启用该按钮?
我正在使用它来处理在后台运行长进程的情况,因此应禁用除取消进程之外的所有UI操作.
谢谢!
我遇到了多个字段之间的验证问题.例如 - 我得到了一个名为RangeDateViewModel的ViewModel,它包含名为DateViewModel的类的2个实例,每个实例分别代表一个开始日期和结束日期.
所以我的绑定看起来像这样 -
<TextBox Text="{Binding StartDate.Date, ValidateOnDataError=True}">
<TextBox Text="{Binding EndDate.Date, ValidateOnDataError=True}">
Run Code Online (Sandbox Code Playgroud)
我的RangeDateViewModel类实现了IDataErrorInfo接口.在我的计划中,RangeDateViewModel将通过在IDataErrorInfo ["propertyName"]函数中应用验证逻辑来验证开始日期是否在结束日期之前 -
public string this[string columnName]
{
get
{
return ValidationError();
}
}
Run Code Online (Sandbox Code Playgroud)
问题是永远不会调用它,而是调用驻留在每个DateViewModel类中的IDataErrorInfo属性.
我想这是因为bound属性不在RangeDateViewModel的同一级别,而是在子DateViewModel中.
我认为我的需求是非常基本的,必须有一个简单的解决方案来解决这个问题.我尝试使用ValidationRules而不是IDataErrorInfo,但后来我遇到了问题,让ViewModel知道ValidationRules当前的验证状态.
我正在寻找一种在凹面或凸面多边形内找到轴对齐矩形的方法.
我一直在寻找网络,我能找到的最接近的解决方案只适合凸多边形,而不是凹多边形.例如 -
说实话,我不是一个伟大的数学专家,所以我宁愿找到代码示例或代码库,但我想我可以自己处理一些数学,或者找人来帮助我.
如果解决方案也可以在Java中,那将是非常好的,但也许我太贪心了:P
编辑:回应罗素的评论,我正在添加更多信息.
有界矩形应尽可能大.矩形旨在包含其中的文本.最多1到4个字,支持文本换行.因此,如果它太薄,我会将文本垂直放置而不是水平放置.所以对于宽高比,我想它需要足够包含1-4个单词垂直或水平与自动换行.如果矩形很小,我可以调整文本大小,但最好是文本尽可能大.
另一个很好的要求是,如果多边形的一般方向是对角线,并且当对角线方向对齐时文本会更好,那么矩形不一定与轴对齐,而是与多边形的对角线.我想这个要求让这个变得非常棘手,但是如果你们认为它可能那么它会很棒!
我想我现在已经涵盖了所有的要求.:P
谢谢!
我最近开始在图像处理领域开展一个小型的业余爱好者计划,我有点像图像处理的菜鸟,但我想弄清楚它的至少某些方面.
我想要做的是通过颜色(最好是实时视频输入)将图像中的对象分开,然后识别它们的颜色.
我读了一些关于OpenCV以及一些不同算法的内容.我甚至开始使用canny算法进行一些工作,但我不确定这是我应该根据需要开始的算法,因为它检测对象的边缘而不管它们的颜色.
即使它是我应该使用的算法,识别它为我标记的对象的颜色的最佳方法是什么?
我希望我做得足够清楚.
非常感谢!
我正在创建一个自定义控件,我遇到了将DataTemplate中的UI元素绑定到自定义控件的依赖项属性的问题.
我的控件中有一个内容控件,应该根据某个属性更改其内容和内容模板,所以我这样绑定它 -
<ContentControl Content="{TemplateBinding ControlMode}" ContentTemplateSelector="{StaticResource TemplateSelector}"/>
Run Code Online (Sandbox Code Playgroud)
内容模板选择器以这种方式定义 -
<ns:TemplateSelector x:Key="TemplateSelector">
<ns:TemplateSelector.Template1>
<DataTemplate>
<TreeView ItemsSource="{TemplateBinding TreeSource}"/>
</DataTemplate>
</ns:TemplateSelector.Template1>
<ns:TemplateSelector.Template2>
<DataTemplate>
<ListView ItemsSource="{TemplateBinding ListSource}"/>
</DataTemplate>
</ns:TemplateSelector.Template2>
</ns:TemplateSelector>
Run Code Online (Sandbox Code Playgroud)
问题是TreeView和ListView无法使用TemplateBinding绑定到他们的itemssource,因为例如这个错误 -
"在ContentPresenter类型上找不到TreeSourceProperty"
我一直在四处寻找答案,我发现这个简单的答案表明这是不可能的.
如何在自定义控件(Silverlight)中的数据模板中使用模板绑定
所以,如果这真的不可能,我怎样才能将模板中的元素绑定到CustomControl的DependencyProperties?
谢谢!
只是想知道DependencyProperties。
通常,在DependencyProperty更改后执行某些代码时,我会看到这种编码标准。
public int SomeProperty
{
get { return (int)GetValue(SomePropertyProperty); }
set { SetValue(SomePropertyProperty, value); }
}
public static readonly DependencyProperty SomePropertyProperty =
DependencyProperty.Register("SomeProperty", typeof(int), typeof(MainWindow), new UIPropertyMetadata(new DependencyPropertyChangedEventHandler(OnSomePropertyChanged)));
private static void OnSomePropertyChanged(object obj, DependencyPropertyChangedEventArgs e)
{
//Some logic in here
}
Run Code Online (Sandbox Code Playgroud)
但我认为我从未见过这种实现方式-
public int SomeProperty
{
get { return (int)GetValue(SomePropertyProperty); }
set
{
SetValue(SomePropertyProperty, value);
//Execute code in here
}
}
public static readonly DependencyProperty SomePropertyProperty =
DependencyProperty.Register("SomeProperty", typeof(int), typeof(MainWindow), new UIPropertyMetadata(0));
Run Code Online (Sandbox Code Playgroud)
这被认为是不好的做法吗?
谢谢!
我正在尝试实施 Google AdMob 的 UMP,以实现 GDPR 等合规性。
在设备上部署时,此行运行后不久:
ConsentInformation.Update(request, OnConsentInfoUpdated);
Run Code Online (Sandbox Code Playgroud)
引发以下异常并停止游戏:
16054 16140 Error Unity Caused by: java.lang.ClassNotFoundException:
Didn't find class "com.google.android.ump.UserMessagingPlatform" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar",
zip file "/data/app/com.packagename-rCIR4M7S0arj_qYzQW_MZg==/base.apk"],
nativeLibraryDirectories=[/data/app/com.packagename-rCIR4M7S0arj_qYzQW_MZg==/lib/arm64, /data/a
Run Code Online (Sandbox Code Playgroud)
我尝试对 Proguard 进行一些更改,例如添加
-keep class com.google.android.gms.internal.consent_sdk.** { <fields>; }
Run Code Online (Sandbox Code Playgroud)
和
-keepattributes Signature
Run Code Online (Sandbox Code Playgroud)
但他们似乎没有帮助。
在 Unity 编辑器中运行它时没有任何问题。我正在使用 AdMob SDK v11.0.0 运行 Unity 2021.3.9f1。
任何帮助将不胜感激。
我在自定义控件中使用WPF的常规DataGrid。DataGrid的单元格模板内容之一应绑定到自定义控件上的Textblock的Text或DependencyProperty。(如果我可以将其绑定到其中任何一个上,对我来说就足够了)
我尝试使用ElementName进行以下绑定,但是没有用。我不断得到DependencyProperty.UnsetValue-
<DataGridTemplateColumn Header="Test">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ContentPresenter>
<ContentPresenter.Content>
<MultiBinding Converter="{StaticResource TextToSpecialTextblockConverter}">
<Binding Path="SomeTextOnTheViewModel"/>
<Binding ElementName="SearchBox" Path="Text" Mode="OneWay"/>
</MultiBinding>
</ContentPresenter.Content>
</ContentPresenter>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Run Code Online (Sandbox Code Playgroud)
绑定到DependencyProperty也不起作用。
<DataGridTemplateColumn Header="Test">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ContentPresenter>
<ContentPresenter.Content>
<MultiBinding Converter="{StaticResource TextToSpecialTextblockConverter}">
<Binding Path="SomeTextOnTheViewModel"/>
<Binding RelativeSource="{RelativeSource Mode=TemplatedParent}" Path="SomeDP" />
</MultiBinding>
</ContentPresenter.Content>
</ContentPresenter>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Run Code Online (Sandbox Code Playgroud)
我希望有人可以帮助我!
谢谢!
我有一个Android应用程序,我想将其使用日志发送到我的服务器,所以它将保存在数据库中.
基本上我想记录几乎用户所做的每一个动作,甚至是简单的按钮点击.
由于MQTT已经在应用程序中使用,我认为也许将它用于日志记录也是一件好事.
例如:每次我想记录某些内容时,我只会通过MQTT发布操作,然后一些服务器端服务会订阅该日志记录通道,每次日志发布到达时,它都会将其插入到数据库中.
但是有几件我担心的事情 -
另一种选择是通过常规REST方法发送数据,但是我有2个选项,要么以大块发送它(我必须知道何时是在应用程序关闭之前发送它的时候)或者是真实发送它 - 发生日志记录操作的时间.
然后我不需要订阅MQTT日志记录通道的服务.
我们假设我的服务器应该能够同时处理数千个用户.
任何有趣的想法?
谢谢!
wpf ×5
android ×4
mvvm ×2
admob ×1
architecture ×1
binding ×1
button ×1
clutter ×1
data-binding ×1
datagrid ×1
datagridview ×1
datatemplate ×1
geometry ×1
grid ×1
ios ×1
isenabled ×1
java ×1
logging ×1
mqtt ×1
opencv ×1
opengl-es ×1
rest ×1
validation ×1
vb.net ×1
winforms ×1