本文整理汇总了PHP中Mobile_Detect::isAndroidOS方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile_Detect::isAndroidOS方法的具体用法?PHP Mobile_Detect::isAndroidOS怎么用?PHP Mobile_Detect::isAndroidOS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile_Detect
的用法示例。
在下文中一共展示了Mobile_Detect::isAndroidOS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMobileOs
public static function getMobileOs()
{
$deviceOs = "";
if (isset($_SERVER['AMF_DEVICE_OS'])) {
// APACHE MOBILE FILTER IS INSTALLED
$deviceOs = $_SERVER['AMF_DEVICE_OS'];
if (stripos($deviceOs, "iphone") !== false) {
$deviceOs = "IOS";
} else {
if (stripos($deviceOs, "android") !== false) {
$deviceOs = "ANDROIDOS";
}
}
} else {
$detect = new Mobile_Detect();
if ($detect->isiOS()) {
$deviceOs = "IOS";
} else {
if ($detect->isAndroidOS()) {
$deviceOs = "ANDROIDOS";
}
}
}
return $deviceOs;
}
示例2: isAndroidOS
function isAndroidOS()
{
// instantiate Mobile_Detect Object
$detect = new \Mobile_Detect();
// determine if the device is Android
$isAndroidOS = $detect->isAndroidOS() ? true : false;
// return true or false
return $isAndroidOS;
}
示例3: detect
public function detect()
{
$detect = new Mobile_Detect();
if ($detect->isiOS()) {
$this->device = 'ios';
}
if ($detect->isAndroidOS()) {
$this->device = 'android';
}
return $this->device;
}
示例4: detectmobile
function detectmobile()
{
$detect = new Mobile_Detect();
$mobile = $detect->isMobile();
$tablet = $detect->isTablet();
if ($detect->isAndroidOS()) {
//elgg_extend_view( 'forms/login' , 'mobile_app/login' );
//elgg_extend_view( 'forms/register', 'mobile_app/login' );
}
if ($mobile == true && $tablet == false) {
return true;
} else {
return false;
}
}
示例5: distribute
/**
* Distributor Function
*/
public function distribute()
{
$detect = new Mobile_Detect();
if ($detect->isiOS()) {
$finalURL = strlen($this->iOSURL) > 0 ? $this->iOSURL : (strlen($this->optionalURL) > 0 ? $this->optionalURL : $this->androidURL);
$this->redirect($finalURL);
} else {
if ($detect->isAndroidOS()) {
$finalURL = '';
// To open de Market Place for Android devices, we must transform the original URL into a URL Scheme
if (strlen($this->androidURL) > 0) {
$urlQuery = parse_url($this->androidURL, PHP_URL_QUERY);
$finalURL = "market://details?" . $urlQuery;
} else {
$finalURL = strlen($this->optionalURL) > 0 ? $this->optionalURL : $this->iOSURL;
}
$this->redirect($finalURL);
} else {
$finalURL = strlen($this->optionalURL) > 0 ? $this->optionalURL : (strlen($this->androidURL) > 0 ? $this->androidURL : $this->iOSURL);
$this->redirect($finalURL);
}
}
}
示例6: getMobileInformation
function getMobileInformation()
{
$detect = new Mobile_Detect();
$isMobile = "false";
$isTablet = "false";
$mobileOS = '';
$mobileVersion = '';
$versionIsSufficient = false;
if ($detect->isMobile()) {
$isMobile = "true";
if ($detect->isTablet()) {
$isTablet = "true";
}
if ($detect->isiOs()) {
$mobileOS = 'iOS';
$mobileVersion = $detect->version('iOS');
$versionArray = explode('_', $mobileVersion);
if ($versionArray[0] >= 6) {
$versionIsSufficient = true;
}
} elseif ($detect->isAndroidOS()) {
$mobileOS = 'Android';
$mobileVersion = $detect->version('Android');
$versionArray = explode('.', $mobileVersion);
if ($versionArray[0] >= 4 && $versionArray[1] >= 1) {
$versionIsSufficient = true;
}
} elseif ($detect->isWindowsPhoneOS()) {
$mobileOS = 'WindowsPhoneOS';
$mobileVersion = $detect->version('WindowsPhoneOS');
} else {
$mobileOS = 'Other mobile OS';
$mobileVersion = 'NONE';
}
}
return array('isMobile' => $isMobile, 'isTablet' => $isTablet, 'mobileOS' => $mobileOS, 'mobileVersion' => $mobileVersion, 'mobileIsSufficient' => $versionIsSufficient);
}
示例7: getrenderv1
public function getrenderv1()
{
$cr = 0;
$path_model = NULL;
$status_array = array();
$color_array = array('r' => NULL, 'l' => NULL);
$this->load->helper(array('printerstate', 'slicer'));
// $status_array = PrinterState_checkStatusAsArray();
// // check if we are in sliced status, assign colors if so
// if ($status_array[PRINTERSTATE_TITLE_STATUS] == CORESTATUS_VALUE_SLICED
// && array_key_exists(PRINTERSTATE_TITLE_EXTEND_PRM, $status_array)) {
// // check all extruders
// foreach (array('r' => PRINTERSTATE_TITLE_EXT_LENG_R, 'l' => PRINTERSTATE_TITLE_EXT_LENG_L)
// as $abb_cartridge => $status_length) {
// // check if we use selected extruder
// if (array_key_exists($status_length, $status_array[PRINTERSTATE_TITLE_EXTEND_PRM])) {
// $json_cartridge = array();
// $ret_val = PrinterState_getCartridgeAsArray($json_cartridge, $abb_cartridge);
// // check if cartridge info is all right
// if (in_array($ret_val, array(
// ERROR_OK, ERROR_MISS_LEFT_FILA, ERROR_MISS_RIGT_FILA,
// ERROR_LOW_LEFT_FILA, ERROR_LOW_RIGT_FILA,
// ))) {
// $color_array[$abb_cartridge] = $json_cartridge[PRINTERSTATE_TITLE_COLOR];
// }
// }
// }
// }
// check existed file for time-saving
foreach (array(SLICER_FILE_PREVIEW_M, SLICER_FILE_PREVIEW_S) as $filename) {
$path_model = $this->config->item('temp') . $filename;
if (file_exists($path_model)) {
$cr = ERROR_OK;
break;
}
}
if ($cr != ERROR_OK) {
$cr = Slicer_exportRenderModel($path_model, $color_array['r'], $color_array['l']);
}
if ($cr == ERROR_OK) {
if (file_exists($path_model)) {
// check mobile device and assign max filesize limit
@(include_once BASEPATH . '/../assets/mobile_detect.php');
// check system only if class is well loaded, ignore limit if loading error
if (class_exists('Mobile_Detect')) {
$detect_os = new Mobile_Detect();
$size_limit = NULL;
if ($detect_os->isiOS()) {
$size_limit = 9437184;
// 9M
} else {
if ($detect_os->isAndroidOS()) {
$size_limit = 83886080;
// 80M
}
}
if ($size_limit && $size_limit < filesize($path_model)) {
$cr = ERROR_WRONG_PRM;
}
}
if ($cr == ERROR_OK) {
$fileinfo = pathinfo($path_model);
$fileext = NULL;
if (is_array($fileinfo) && isset($fileinfo['extension']) && in_array(strtolower($fileinfo['extension']), array('stl', 'amf'))) {
$fileext = strtolower($fileinfo['extension']);
} else {
$fileext = 'bin';
}
$this->_sendFileContent($path_model, 'rendering.' . $fileext);
return;
}
} else {
$this->load->helper('printerlog');
PrinterLog_logError('export render model function returns ok, but file not found', __FILE__, __LINE__);
$cr = ERROR_INTERNAL;
}
}
$this->_return_cr($cr);
return;
}
示例8:
<meta name="google-site-verification"
content="9AtqvB-LWohGnboiTyhtZUXAEcOql9B-8lDjo_wcUew" />
<link rel="stylesheet" href="foundation/css/foundation.min.css" />
<link rel="stylesheet" href="openlayers/ol.css" />
<link rel="stylesheet" href="css/styleIndex.css" />
<script src="foundation/js/vendor/modernizr.js"></script>
</head>
<body>
<div class="row">
<div id="controlpanel" class="large-3 large-push-9 columns">
<div class="row center">
<img src="images/kiri200.png" alt="KIRI logo"/>
</div>
<?php
$detect = new Mobile_Detect();
if ($detect->isAndroidOS() && !$detect->isWindowsMobileOS()) {
?>
<div class="row">
<div class="large-12 columns">
<div data-alert class="alert-box secondary round">
<?php
echo $index_getapp['android'];
?>
<a href="#" class="close">×</a>
</div>
</div>
</div>
<?php
}
?>
<div class="row">
示例9: postMediaDiv
/**
* Post Media Div - Media Div For Posts That Auto-bootstraps
* OPTS: $opts['link'] = array("href"=>"","target"=>""); - Link Override For Image Post
*/
public function postMediaDiv($Dailyop, $opts = array())
{
App::import("Vendor", "Mobile_Detect", array("file" => "Mobile_Detect.php"));
$MobileDetect = new Mobile_Detect();
$template = $Dailyop['Dailyop']['post_template'];
if (isset($opts['MediaFile'])) {
$MediaFile = $opts['MediaFile'];
unset($opts['MediaFile']);
} else {
$MediaFile = $Dailyop['DailyopMediaItem'][0]['MediaFile'];
}
$platform = "computer";
//do some platform detection
if ($MobileDetect->isAndroidOS()) {
$platform = "android";
} else {
if ($MobileDetect->isiOS()) {
$platform = "ios";
}
}
//merge in default attributes with sent in attr's
$opts = array_merge(array("data-media-file-id" => $MediaFile['id'], "data-dailyop-id" => $Dailyop['Dailyop']['id'], "data-dailyop-section-id" => $Dailyop['Dailyop']['dailyop_section_id'], "data-media-type" => $MediaFile['media_type'], "data-slide-show" => $Dailyop['Dailyop']['slide_show'], "data-platform" => $platform, "data-dailyop-display-weight" => 1, "class" => "post-media-div", "id" => "media-file-div-" . $MediaFile['id']), $opts);
//if(isset($Dailyop['Dailyop']['ondemand_title_id']) && !empty($Dailyop['Dailyop']['ondemand_title_id']))
// $opts['data-ondemand-title-id'] = $Dailyop['Dailyop']['ondemand_title_id'];
//check for lazy load
$lazy = false;
if (isset($opts['lazy'])) {
$lazy = $opts['lazy'];
}
$w = 700;
//do width adjustments based on the template
switch (strtolower($template)) {
case 'large':
$w = 1114;
break;
}
unset($opts['lazy']);
$poster = $this->Media->mediaThumbSrc(array("MediaFile" => $MediaFile, "w" => $w, "type" => $template));
$img = $this->Media->mediaThumb(array("MediaFile" => $MediaFile, "w" => $w, "type" => $template, "lazy" => $lazy), array("class" => $MobileDetect->isMobile() ? "html5" : "swf"));
$opts['data-poster-file'] = $poster;
switch (strtolower($MediaFile['media_type'])) {
case 'img':
$hover = "<div class='img-hover'></div>";
$img = $hover . $img;
if (!empty($Dailyop['Dailyop']['url']) || isset($opts['link'])) {
if (isset($opts['link'])) {
$href = $opts['link']['href'];
$target = $opts['link']['target'];
} else {
$href = $Dailyop['Dailyop']['url'];
$target = $Dailyop['Dailyop']['window_target'];
}
$img = "<a href='{$href}' target='{$target}' >{$img}</a>";
}
break;
case "bcove":
$hover = "<div class='play-button'></div><div class='video-hover'></div>";
$img = $hover . $img;
break;
}
return $this->Html->tag("div", $img, $opts);
}
示例10: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
if (Configure::read('unloadDebugKit') == true) {
$this->Components->unload('DebugKit.Toolbar');
}
// language initialization
$language_list = Configure::read('Config.languageList');
$this->language = $language_list[Configure::read('Config.language')]['code'];
if (isset($this->params['language'])) {
foreach ($language_list as $locale => $language) {
if ($language['active'] && $language['code'] == $this->params['language']) {
$this->language = $this->params['language'];
Configure::write('Config.language', $locale);
break;
}
}
}
// set language
$this->set('language', $this->language);
$this->set('language_list', $language_list);
$this->Session->write('Config.language', $this->language);
// Detect device
$Mobile_Detect = new Mobile_Detect();
$this->device_info = 'Desktop';
$this->device_browser = '';
$this->device_info_type = '';
if ($Mobile_Detect->isTablet()) {
$this->device_info = 'Tablet';
if ($Mobile_Detect->isiPad()) {
$this->device_info_type = 'Ipad';
} else {
if ($Mobile_Detect->isAndroidOS()) {
$this->device_info_type = 'Android';
} else {
$this->device_info_type = 'others';
}
}
} else {
if ($Mobile_Detect->isMobile()) {
$this->device_info = 'Mobile';
if ($Mobile_Detect->isiPhone()) {
$this->device_info_type = 'Iphone';
} else {
if ($Mobile_Detect->isAndroidOS()) {
$this->device_info_type = 'Android';
} else {
$this->device_info_type = 'others';
}
}
}
}
if ($Mobile_Detect->isChrome() && $Mobile_Detect->isSafari()) {
$this->device_browser = 'AndroidDefault';
} else {
if ($Mobile_Detect->isChrome()) {
$this->device_browser = 'Chrome';
} else {
if ($Mobile_Detect->isSafari()) {
$this->device_browser = 'Safari';
} else {
if ($Mobile_Detect->isIE()) {
$this->device_browser = 'IE';
} else {
if ($Mobile_Detect->isFirefox()) {
$this->device_browser = 'Firefox';
} else {
if ($Mobile_Detect->isOpera()) {
$this->device_browser = 'Opera';
} else {
$this->device_browser = 'others';
}
}
}
}
}
}
$this->set('device_info', $this->device_info);
$this->set('device_info_type', $this->device_info_type);
$this->set('device_browser', $this->device_browser);
//GA account
$ga_account = Configure::read('ga_account');
$this->set('ga_account', !empty($ga_account[$this->language]) ? $ga_account[$this->language] : '');
//FB_appID
$FB_appID = Configure::read('FB_appID');
$this->set('FB_appID', $FB_appID);
}
示例11: get_device_name
//.........这里部分代码省略.........
}
if ($detect->isbqTablet()) {
$name = 'bq';
break;
}
if ($detect->isHuaweiTablet()) {
$name = 'Huawei';
break;
}
if ($detect->isNecTablet()) {
$name = 'Nec';
break;
}
if ($detect->isPantechTablet()) {
$name = 'Pantech';
break;
}
if ($detect->isBronchoTablet()) {
$name = 'Broncho';
break;
}
if ($detect->isVersusTablet()) {
$name = 'Versus';
break;
}
if ($detect->isZyncTablet()) {
$name = 'Zync';
break;
}
if ($detect->isPositivoTablet()) {
$name = 'Positivo';
break;
}
if ($detect->isNabiTablet()) {
$name = 'Nabi';
break;
}
if ($detect->isPlaystationTablet()) {
$name = 'Playstation';
break;
}
if ($detect->isGenericTablet()) {
$name = 'Generic';
break;
}
if ($detect->isAndroidOS()) {
$name = 'Android';
break;
}
if ($detect->isBlackBerryOS()) {
$name = 'BlackBerry';
break;
}
if ($detect->isPalmOS()) {
$name = 'Plam';
break;
}
if ($detect->isSymbianOS()) {
$name = 'Symbian';
break;
}
if ($detect->isWindowsMobileOS()) {
$name = 'WindowsMobile';
break;
}
if ($detect->isWindowsPhoneOS()) {
$name = 'WindowsPhone';
break;
}
if ($detect->isiOS()) {
$name = 'iOS';
break;
}
if ($detect->isMeeGoOS()) {
$name = 'MeeGo';
break;
}
if ($detect->isMaemoOS()) {
$name = 'Maemo';
break;
}
if ($detect->isJavaOS()) {
$name = 'JavaOS';
break;
}
if ($detect->iswebOS()) {
$name = 'WebOS';
break;
}
if ($detect->isbadaOS()) {
$name = 'badaOS';
break;
}
if ($detect->isBREWOS()) {
$name = 'BREWOS';
break;
}
} while (false);
return $name . ' ' . $deviceType;
}
示例12:
<?php
include_once 'libraries/Mobile-Detect-2.8.15/Mobile_Detect.php';
$detect = new Mobile_Detect();
if (!$detect->isMobile()) {
echo "PC: play.stdio.vn";
} else {
if ($detect->isTablet()) {
echo "TABLET: ";
if ($detect->version("Windows Phone")) {
echo "Windows Phone 8";
} else {
if ($detect->isiOS()) {
echo "iOS";
} else {
if ($detect->isAndroidOS()) {
echo "Android";
}
}
}
} else {
echo "PHONE: ";
if ($detect->version("Windows Phone")) {
echo "Windows Phone 8";
} else {
if ($detect->isiOS()) {
echo "iOS";
} else {
if ($detect->isAndroidOS()) {
echo "Android";
}
示例13: array
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* -----------------------------------------------------------------------
* The demo is running all the Mobile_Detect's internal methods.
* Here you can spot detections errors instantly.
* -----------------------------------------------------------------------
*
* @author Serban Ghita <serbanghita@gmail.com>
* @license MIT License https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt
*
*/
require_once './Mobile_Detect.php';
$detect = new Mobile_Detect();
$deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer';
$scriptVersion = $detect->getScriptVersion();
if ($deviceType == 'computer') {
$arr = array('os' => "pc");
echo json_encode($arr);
} elseif ($detect->isAndroidOS()) {
$arr = array('os' => "Android");
echo json_encode($arr);
} elseif ($detect->isiOS()) {
$arr = array('os' => "ios");
echo json_encode($arr);
}
示例14: set_device
function set_device($user_agent)
{
global $request_settings;
$key = 'di_' . $user_agent;
$cache_result = get_cache($key);
if ($cache_result) {
if (isset($cache_result['device_os'])) {
$request_settings['device_os'] = $cache_result['device_os'];
}
$request_settings['main_device'] = $cache_result['main_device'];
return true;
}
error_reporting(0);
require_once 'modules/devicedetection/Mobile_Detect.php';
$detect = new Mobile_Detect($user_agent);
if ($detect->isIphone()) {
$temp['device_os'] = get_device_osversion(1, $user_agent);
$temp['main_device'] = 'IPHONE';
} else {
if ($detect->isIpad()) {
$temp['device_os'] = get_device_osversion(1, $user_agent);
$temp['main_device'] = 'IPAD';
} else {
if ($detect->isIpod()) {
$temp['device_os'] = get_device_osversion(1, $user_agent);
$temp['main_device'] = 'IPOD';
} else {
if ($detect->isAndroidOS()) {
$temp['device_os'] = get_device_osversion(2, $user_agent);
$temp['main_device'] = 'ANDROID';
} else {
if ($detect->ismobile()) {
$temp['main_device'] = 'OTHER';
} else {
$temp['main_device'] = 'NOMOBILE';
if (!MAD_SERVE_NOMOBILE) {
print_error(1, 'This ad-server does not serve ads to non-mobile devices.', $request_settings['sdk'], 1);
return false;
}
}
}
}
}
}
if (isset($temp['device_os']) && !empty($temp['device_os'])) {
$request_settings['device_os'] = $temp['device_os'];
}
$request_settings['main_device'] = $temp['main_device'];
set_cache($key, $temp, 1500);
}
示例15: elseif
<head>
<meta charset="UTF-8" />
<title>ソフトウェアダウンロード</title>
</head>
<body>
<?php
$md = new Mobile_Detect();
if ($md->isiOS()) {
?>
<!-- iOSの場合 -->
<a href="https://itunes.apple.com/jp/app/google-maps/
id585027354?mt=8&uo=4" target="itunes_store"style="display:inline-block;overflow:hidden;background:url(https://linkmaker.itunes.apple.com/htmlResources/assets/ja_jp//images/web/linkmaker/badge_appstore-lrg.png) no-repeat;width:135px;height:40px;@media onlyscreen{background-image:url(https://linkmaker.itunes.apple.com/htmlResources/assets/ja_jp//images/web/linkmaker/badge_appstorelrg.
svg);}"></a>
<?php
} elseif ($md->isAndroidOS()) {
?>
<!-- Androidの場合 -->
<a href="https://play.google.com/store/apps/details?id=com.google.earth">
<img alt="Android app on Google Play"
src="https://developer.android.com/images/brand/ja_app_rgb_wo_45.png" />
</a>
<?php
} else {
?>
<!-- PCなどの場合 -->
<a href="https://itunes.apple.com/jp/app/google-maps/
id585027354?mt=8&uo=4" target="itunes_store"style="display:inline-block;overflow:hidden;background:url(https://linkmaker.itunes.apple.com/htmlResources/assets/ja_jp//images/web/linkmaker/badge_appstore-lrg.png) no-repeat;width:135px;height:40px;@media onlyscreen{background-image:url(https://linkmaker.itunes.apple.com/htmlResources/assets/ja_jp//images/web/linkmaker/badge_appstorelrg.svg);}"></a>
<a href="https://play.google.com/store/apps/details?id=com.google.
earth">
<img alt="Android app on Google Play"