Connect with us and we'll make all your dreams come true!

Category: tips

This simple Objective-C code excerpt prints the methods and arguments of a class instance using the NSLog functionality.

  1. //
  2. // List the methods of the class instance "myClass"
  3. methods = class_copyMethodList([myClass class], &methodCount);
  4. for (int i=0; i<methodCount; i++)
  5. {
  6. char buffer[256];
  7. SEL name = method_getName(methods[i]);
  8. NSLog(@"Method: %@", NSStringFromSelector(name));
  9. char *returnType = method_copyReturnType(methods[i]);
  10. NSLog(@"The return type is %s", returnType);
  11. free(returnType);
  12. // self, _cmd + any others
  13. unsigned int numberOfArguments = method_getNumberOfArguments(methods[i]);
  14. for(int j=0; j<numberOfArguments; j++)
  15. {
  16. method_getArgumentType(methods[i], j, buffer, 256);
  17. NSLog(@"The type of argument %d is %s", j, buffer);
  18. }
  19. }
  20. free(methods);

This simple Objective-C code excerpt prints the methods and arguments of a class instance using the NSLog functionality.

  1. //
  2. // List the methods of the class instance "myClass"
  3. methods = class_copyMethodList([myClass class], &methodCount);
  4. for (int i=0; i<methodCount; i++)
  5. {
  6. char buffer[256];
  7. SEL name = method_getName(methods[i]);
  8. NSLog(@"Method: %@", NSStringFromSelector(name));
  9. char *returnType = method_copyReturnType(methods[i]);
  10. NSLog(@"The return type is %s", returnType);
  11. free(returnType);
  12. // self, _cmd + any others
  13. unsigned int numberOfArguments = method_getNumberOfArguments(methods[i]);
  14. for(int j=0; j<numberOfArguments; j++)
  15. {
  16. method_getArgumentType(methods[i], j, buffer, 256);
  17. NSLog(@"The type of argument %d is %s", j, buffer);
  18. }
  19. }
  20. free(methods);

I've been a fan of Eclipse for a long time now, even before FDT and Flash Builder were built around it. The use of workspaces, once you get your head around them, is powerful for focusing your head on the work at hand, keeping all associated projects within the one space.

However there are times when I wish I was able to have multiple workspaces open. And too the rescue comes the command line.
Read more →

I've been a fan of Eclipse for a long time now, even before FDT and Flash Builder were built around it. The use of workspaces, once you get your head around them, is powerful for focusing your head on the work at hand, keeping all associated projects within the one space.

However there are times when I wish I was able to have multiple workspaces open. And too the rescue comes the command line.
Read more →

We've been doing a lot with Native Extensions for AIR lately, both in Android and iOS, and I just wanted to put together a quick "how to" on using other people's Actionscript Native Extensions (ANE) in Flash Builder 4.6.

I'm going to assume you already understand the process of developing and deploying mobile applications using AIR.

The process is quite simple, you'll need the supplied ANE for the extension. In your mobile project you want to add it into, open up the project properties (Right click / Properties) and find the "Actionscript Build Path" (or "Flex Build Path" if it's a Flex project).

You'll see a tab up the top labeled "Native Extensions" in which you can "Add ANE...". Click on this and select the ANE extension file. Once it's added in, you can expand out the details of the extension to see the target platforms supported by the extension. Below I'm showing the details on our Android Camera Extension.


Read more →

We've been doing a lot with Native Extensions for AIR lately, both in Android and iOS, and I just wanted to put together a quick "how to" on using other people's Actionscript Native Extensions (ANE) in Flash Builder 4.6.

I'm going to assume you already understand the process of developing and deploying mobile applications using AIR.

The process is quite simple, you'll need the supplied ANE for the extension. In your mobile project you want to add it into, open up the project properties (Right click / Properties) and find the "Actionscript Build Path" (or "Flex Build Path" if it's a Flex project).

You'll see a tab up the top labeled "Native Extensions" in which you can "Add ANE...". Click on this and select the ANE extension file. Once it's added in, you can expand out the details of the extension to see the target platforms supported by the extension. Below I'm showing the details on our Android Camera Extension.


Read more →

Well if you use OSX or any program that produces metadata files on your file-system, it can become a nightmare trying to sort through the files you need to check in to svn... However! Once you discover there is a little hidden global ignore feature in svn, all the horror goes away.

On OSX the file of concern is located :

~/.subversion/config

Linux (sometimes) :

/etc/subversion/config

Windows... No idea sorry, depends on your client, though apparently TortoiseSVN has it as an option...

To add a file or folder to the list just open up that file and find the "global-ignores" option. It's just a space separated list of potential file or folder names that you want to ignore.

Mine now looks like this:

global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo _notes .DS_Store .#* .AppleDouble *:2e_* ._*

Have fun with a cleaner svn...


More information on the config options:
Subversion Manual: Config

Well if you use OSX or any program that produces metadata files on your file-system, it can become a nightmare trying to sort through the files you need to check in to svn... However! Once you discover there is a little hidden global ignore feature in svn, all the horror goes away.

On OSX the file of concern is located :

~/.subversion/config

Linux (sometimes) :

/etc/subversion/config

Windows... No idea sorry, depends on your client, though apparently TortoiseSVN has it as an option...

To add a file or folder to the list just open up that file and find the "global-ignores" option. It's just a space separated list of potential file or folder names that you want to ignore.

Mine now looks like this:

global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo _notes .DS_Store .#* .AppleDouble *:2e_* ._*

Have fun with a cleaner svn...


More information on the config options:
Subversion Manual: Config

So we all know and love our Android notification bar. So I just wanted to post a quick example application to show how easy it is to display a local notification.

The process runs something like this:

  • retrieve a reference to the NotificationManager
  • create a Notification
  • notify the manager of the notification you've created

Read more →

So we all know and love our Android notification bar. So I just wanted to post a quick example application to show how easy it is to display a local notification.

The process runs something like this:

  • retrieve a reference to the NotificationManager
  • create a Notification
  • notify the manager of the notification you've created

Read more →

So I went to update all my CS5.5 last night and ended up spending hours trying to get the application manager to actually allow me to update. I kept getting an error saying "You are already running the Adobe Application Manager. Please close all instances of Adobe Application Manager in order to continue with this installation."

Now I had been getting this error for a while, on two (OSX) machines so I decided that enough was enough and needed to get this running. I knew I only had one instance running, I had checked top multiple times to confirm this. So after much research I figured out that it was simply a permissions problem, so who better to alleviate a permissions problem than my good friend sudo.

sudo /Library/Application\ Support/Adobe/OOBE/PDApp/core/Adobe\ Application\ Manager.app/Contents/MacOS/PDApp

And that was it! The Application Manager ran without that annoying message.

So I went to update all my CS5.5 last night and ended up spending hours trying to get the application manager to actually allow me to update. I kept getting an error saying "You are already running the Adobe Application Manager. Please close all instances of Adobe Application Manager in order to continue with this installation."

Now I had been getting this error for a while, on two (OSX) machines so I decided that enough was enough and needed to get this running. I knew I only had one instance running, I had checked top multiple times to confirm this. So after much research I figured out that it was simply a permissions problem, so who better to alleviate a permissions problem than my good friend sudo.

sudo /Library/Application\ Support/Adobe/OOBE/PDApp/core/Adobe\ Application\ Manager.app/Contents/MacOS/PDApp

And that was it! The Application Manager ran without that annoying message.

So as many people know, I've been promising an update to the KML Loader for a while now, and even to the point where I've had some local revisions and haven't had the time to check them in (I know, I know, bad practice!)

The major update has been to enable the ability to load linked assets. Initially this just extends to ground overlays and custom icons, but now that I have the structure setup to do this I'll be able to add in linked files and styles easily.

Read more →

So as many people know, I've been promising an update to the KML Loader for a while now, and even to the point where I've had some local revisions and haven't had the time to check them in (I know, I know, bad practice!)

The major update has been to enable the ability to load linked assets. Initially this just extends to ground overlays and custom icons, but now that I have the structure setup to do this I'll be able to add in linked files and styles easily.

Read more →

This is just a quick post on how to retrieve your iPhone/iPad/iPod UUID (Unique Device Identifier).

We use this UUID to allow your phone to use development versions of our applications.

There are several ways to do this but the simplest is using Apple's flagship tool, iTunes.

  • Open up iTunes and plug in your device
  • Select your device in the "DEVICES" list
  • Select the Summary tab and you should see the Serial Number as in the screen shot below:

  • Click on the Serial Number label and it should change to reveal the UDID:

  • You can then either just hit Ctrl/Command-C, or go to Edit / Copy to copy the UDID to the clipboard

You should then be able to paste it into an email etc so we can add your device into our allowed development device list.

This is just a quick post on how to retrieve your iPhone/iPad/iPod UUID (Unique Device Identifier).

We use this UUID to allow your phone to use development versions of our applications.

There are several ways to do this but the simplest is using Apple's flagship tool, iTunes.

  • Open up iTunes and plug in your device
  • Select your device in the "DEVICES" list
  • Select the Summary tab and you should see the Serial Number as in the screen shot below:

  • Click on the Serial Number label and it should change to reveal the UDID:

  • You can then either just hit Ctrl/Command-C, or go to Edit / Copy to copy the UDID to the clipboard

You should then be able to paste it into an email etc so we can add your device into our allowed development device list.

Just assembling a quick list of some of the shortcuts I use everyday in Eclipse. Let me know if you have any other favourites!

  • Code hinting: Ctrl + Space
  • Change view: Cmd + 3
  • Open any file quickly without browsing for it in the Package Explorer: Cmd + Shift + R
  • Open a type (e.g.: a class, an interface) without clicking through interminable list of packages: Cmd + Shift + T
  • Go directly to a member (method, variable) of a huge class file, especially when a lot of methods are named similarly: Cmd + O
  • Go to line number N in the source file: Cmd + L, enter line number
  • Go to other open editors: Cmd + E
  • Go to a type declaration: F3 or Cmd + click on declaration

Note: Cmd == Ctrl on Windows/Linux

Just assembling a quick list of some of the shortcuts I use everyday in Eclipse. Let me know if you have any other favourites!

  • Code hinting: Ctrl + Space
  • Change view: Cmd + 3
  • Open any file quickly without browsing for it in the Package Explorer: Cmd + Shift + R
  • Open a type (e.g.: a class, an interface) without clicking through interminable list of packages: Cmd + Shift + T
  • Go directly to a member (method, variable) of a huge class file, especially when a lot of methods are named similarly: Cmd + O
  • Go to line number N in the source file: Cmd + L, enter line number
  • Go to other open editors: Cmd + E
  • Go to a type declaration: F3 or Cmd + click on declaration

Note: Cmd == Ctrl on Windows/Linux

For an upcoming project we needed to stream content from the user's webcam to be recorded on the server. In theory this sounded like a basic operation, having used FMS to this end before, but actually installing and setting up the Red5 server proved to be a little tricky. So I just wanted to outline the process I went through to get a Red5 Server running on ubuntu and how to setup your first recording stream.

Red5 is a powerful Java based video streaming and multi-user solution for the Flash Player. Red5 includes support for the latest multi-user API’s including NetConnection, NetStream and SharedObject’s while providing a powerful RTMP / Servlet implementation. It is basically an open source Flash Media Server.

We're going to go through two major steps here, firstly installing Red5 on Ubuntu and then building a simple application to record the webcam.
Read more →

For an upcoming project we needed to stream content from the user's webcam to be recorded on the server. In theory this sounded like a basic operation, having used FMS to this end before, but actually installing and setting up the Red5 server proved to be a little tricky. So I just wanted to outline the process I went through to get a Red5 Server running on ubuntu and how to setup your first recording stream.

Red5 is a powerful Java based video streaming and multi-user solution for the Flash Player. Red5 includes support for the latest multi-user API’s including NetConnection, NetStream and SharedObject’s while providing a powerful RTMP / Servlet implementation. It is basically an open source Flash Media Server.

We're going to go through two major steps here, firstly installing Red5 on Ubuntu and then building a simple application to record the webcam.
Read more →