Tag: mobile

Free Unity 3 “basic” License

Last year I talked a bit about some of my augmented reality projects. Many of you have sent questions and posted comments so I suppose there is a certain level of interest in that field. One of the conclusions I had back then was that to achieve a certain level of quality (great lighting effects, surface reflection, etc.) when rendering a 3D model in an augmented reality project, you better use a good 3D engine (such as Unity). I still think this is true.

Yesterday I “discovered” that Unity is offering its iOS and Android “basic” license for free until April 8th. Normally, you’d have to pay $400 for each of them. So if you were unsure Unity was a good choice for your project of not, go ahead and buy it for free. 😉 What a great way to finally test it out.

  1. Go to https://store.unity3d.com/index.html
  2. Select Unity FREE
  3. Add features: iOS and Android (both free until April 8th)
  4. Proceed to checkout
  5. Open email upon reception, and follow the instructions

Now enjoy your brand new installed Unity development tools!

Detect Mobile Devices with PHP

Detecting when your visitors are using mobile devices may be very useful, and sometimes you don’t need or want a complete detection plugin with advanced functionalities. So for those cases where you only need basic Mobile OS recognition, here’s a very simple PHP function you can integrate to your scripts:

/**
 * Based on the HTTP_USER_AGENT, this function tries to detect a
 * mobile user agent and returns its name in a string.
 * @return A string that represents the mobile user agent when one
 *         is found, false otherwise.
 * @author Matt (www.evilcodingmonkey.com)
 */
function getMobileAgent() {
    $mobileUA = false;

    // Make sure the user agent is set
    if(isset($_SERVER['HTTP_USER_AGENT'])) {
        $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);

        if(strpos($userAgent, 'android')) {
            $mobileUA = 'android';
        }
        elseif(strpos($userAgent, 'iphone') ) {
            $mobileUA = 'iphone';
        }
        elseif(strpos($userAgent, 'ipad')) {
            $mobileUA = 'ipad';
        }
        elseif(strpos($userAgen, 'windows phone os 7.0')) {
            $mobileUA = 'winphone7'
        }
        elseif(strpos($userAgent, 'blackberry')) {
            $mobileUA = 'blackberry';
        }
    }

    return $mobileUA;
}

This very simple function will tell you when a user is behind an iPhone, iPad, Android, Windows Phone 7 or Blackberry. It returns false when none of these user agents are detected. Depending on your specific needs, you way need more specific information or more advanced features. There are several open source offers out there, such as this one: Detect Mobile Browser. Also, feel free to use this code and modify it as you wish.

© 2017 Evil Coding Monkey

Theme by Anders NorenUp ↑