Text Size
Tuesday, July 22, 2014

IOS and LAMP Web Developer Blog by Mike Zriel

IOS Xcode

IOS Xcode

Last Updated on Friday, 04 July 2014 07:42

Spritekit Categories

BY: Mike Zriel

In SpriteKit the interactions with objects collisions are defined this way:


object.physicsBody.categoryBitMask = { what category you belong to, usually one 1 category }
object.physicsBody.collisionBitMask = { what bounces off, the do not cross each other {
object.physicsBody.contactBitMask = { what category you want to be informed of when they touch each other }

Defining the Category, id's of each category if you wish. Put this code in the implementation file (.m) above the @implementation ..

// Valid Categories Examples:
static const uint32_t spaceshipCategory = 1; // 00000000000000000000000000000001
static const uint32_t bulletCategory = 2;    // 00000000000000000000000000000010
static const uint32_t asteriodCategory = 4;  // 00000000000000000000000000000100
static const uint32_t alienCategory = 8;     // 00000000000000000000000000001000

// Invalid Category Example:
static const uint32_t invalidCategory = 3;   // 00000000000000000000000000000011

Categories should only be the previous category *2 starting at 1, because that is how collision and contact detections work.

 
Java Android

Java Android

Test vibration on Samsung Galaxy S

BY: Mike Zriel

Open the Telephone App and dial this number:

*#0842#

STAR HASH ZERO EIGHT FOUR TWO HASH

A magic hidden menu shows up with Options to for: ON , OFF, 1 sec on/off, 2 sec on/off

 
Java Android

Java Android

Last Updated on Tuesday, 08 July 2014 10:58

How to use Android Samsung Galaxy S for developement

BY: Mike Zriel

To use an Android device for development so it appears in the DDMS, you need to turn to Activate USB Debugging.

The following are instructions how to do this on a Samsung Galaxy S, which I am using as a test phone.

  • Press the Menu Button
  • Settings
  • Applications
  • Development
  • Press on the checkbox for USB debugging ** you must unplug the phone from USB when you do this **
  • Plug the USB back into the phone and if all goes well, you should see your device listed in DDMS in Eclipse

Side note: to see DDMS in Eclipse, Click "Window" -> "Open Prospective" -> "Other" -> "DDMS"

 
IOS Xcode

IOS Xcode

xcode hide status bar with date time

BY: Mike Zriel

To hide the status bar, there are many ways you can add an entry into you {project}.plist or the way I prefer to do it in the View Controller, simply add the following code:

-(BOOL) prefersStatusBarHidden {
    return YES;
}

This is useful in iOS7 for games because the status bar is part of the playing field ( part of the view ).

 
Copyright © 2014 by Mike Zriel - Zriel.com