你如何在2014年将谷歌Admob添加到手机应用程序(Android)?
我在网上查了很多例子,例如link1 link2 Link3 Link4.大多数链接到谷歌即将被弃用的Android 6.4.1教程.
除了特定的Android或iOS教程,我找不到任何演示如何将最新的admob实现到跨平台应用程序的phonegap.我已经看过inmobi但看起来您必须先发布您的应用,然后才能获得广告的发布商ID.
使用Android简化说明进行更新 我正在获取广告的黑盒子,但没有别的,没有警报消息,没有广告
phonegap create myproject
cd mypproject
phonegap run android
Run Code Online (Sandbox Code Playgroud)
关闭模拟器
1.Install the Google Play Services plugin: cordova plugin add https://github.com/MobileChromeApps/google-play-services.git
2.Install this plugin: cordova plugin add https://github.com/floatinghotpot/cordova-plugin-admob.git
Run Code Online (Sandbox Code Playgroud)
然后我去了index.js和onDeviceReady我添加了
onDeviceReady: function() {
app.receivedEvent('deviceready');
if( window.plugins && window.plugins.AdMob ) {
var admob_android_key = 'pub-6xxxxxxxxxxxxx';
var am = window.plugins.AdMob;
am.createBannerView(
{
'publisherId': admob_android_key,
'adSize': am.AD_SIZE.BANNER,
'bannerAtTop': true
},
function() {
am.requestAd(
{ 'isTesting':true },
function(){ …Run Code Online (Sandbox Code Playgroud) 我正在使用Google Chart API,并将折线图(见下文)转换为柱形图,但列宽会根据数据列的数量而变化.如果我将鼠标悬停在上面,它会告诉我正确的日期,但是由于列的宽度变化,您实际上无法准确地看到列应该表示的日期.一个点可以工作,所以我可以恢复到折线图,但是,对于我正在使用的数据集,列确实看起来更好.不知道如何解决这个问题?
日期是动态的,因此X轴必须是可变的.
谢谢
// Create a line chart, passing some options
var LineChart = new google.visualization.ChartWrapper({
'chartType': 'ColumnChart',
'containerId': 'chart_div',
'options': {
'vAxis': {'title': 'Species Abundance', 'minValue': 0, 'maxValue': 32},
'width': 300,
'height': 300,
'legend': 'top',
'title': 'Selected Site and Species abundance over time'
},
'view': {'columns': [0, 1]},
});
Run Code Online (Sandbox Code Playgroud)

目前,我有一个PostGIS数据库,我有基础工作.但是,我正在使用直接插入数据库pg_query.我被建议用来pg_query_params帮助防止SQL注入,但我不确定如何实现它.以下是我当前insert对网站位置声明的简要示例.例如,我如何利用pg_query_params这个例子?我知道我必须实施进一步的安全性,但这是一个起点.
编辑:我打算使用drupal表单API但它让我很头疼.我意识到这会自动完成很多这样的事情.
$sql = "INSERT INTO sites_tbl (river_id ,sitename ,the_geom) VALUES ('$_POST[river_id]','$_POST[sitename]',st_geomfromtext('POINT($geomstring)',27700))";
$result = pg_query($sql);
Run Code Online (Sandbox Code Playgroud)