Firebase的实时数据库SDK内置了回调方法,允许客户端监听数据库更改.(例如,根据https://firebase.google.com/docs/database/android/start/)
Azure在SQL数据库或DocumentDB产品中是否具有类似的功能?如果没有,为什么不呢?使用Azure实现此功能的最佳方法是什么?
谢谢.
编辑上下文:我正在使用Xamarin构建一个跨平台的移动应用程序.
我正在尝试在游戏顶部添加横幅广告.我的活动使用RelativeLayout和自定义SurfaceView.我希望广告与SurfaceView重叠.
广告加载并且可以点击,但不会被绘制到屏幕上.当我离开活动和回报,广告绘制(例如,通过按下home键,然后通过近期]菜单返回到应用程序).
这不是等待广告加载的问题,因为1)如果我等待,则广告不会显示; 2)即使广告不可见,广告也是可点击的.
这是我的布局代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout_mainmenu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.xxx.menu.SurfaceViewMainMenu
android:id="@+id/view_mainmenu"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.google.android.gms.ads.AdView
android:id="@+id/ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@id/view_mainmenu"
android:layout_alignLeft="@id/view_mainmenu"
ads:adSize="BANNER"
ads:adUnitId="@string/ad_unit_id_banner"/>
Run Code Online (Sandbox Code Playgroud)
加载广告的代码张贴一个Runnable由RenderThread UI线程当RenderThread是第一次运行.
有没有人有任何想法我可以立即制作广告?或者为什么只有在我返回活动时才会制作广告?
我试过在RelativeLayout上调用forceLayout()/ requestLayout()但这没有帮助.我也尝试在视图上调用invalidate().
谢谢,汤姆.
编辑
我在AdView中添加了一个AdListener,可以确认是否正在调用onAdLoaded.广告已加载但不可见.
有效:我在onAdLoaded回调中制作了另一个adLoad请求,然后广告出现了.
因此广告只会在我提出的第二个请求后显示.谁知道这里发生了什么?