Multimedia Pioneering – xCode (Objective C)

To complete our mobile development circuit, I present to you: xCode.

We had a quick overview of programming in xCode (Objective C). It is an object-oriented programming language in the C programming language. It is used primarily on Apple’s Mac OS X and iPhone/iPad iOS. Its additions to C are mainly based on Smalltalk, one of the first object-oriented programming languages. Objective C was designed to give C full object-oriented programming capabilities in a simpler and more straightforward way. It has some similar components to the languages we’ve used so far (classes, objects, properties) and typical programming logic, but also includes many new concepts and protocols (as it is based in C).

We put together a quick little application involving the delightfully created date/time picker component. Here is the code:

//  DateViewController.m
//  Date
//
//  Created by Florence Kwok on 11-03-15. //because you need a Mac to work on it – so I followed along with a colleague of mine, Florence.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import “DateViewController.h”

@implementation DateViewController
@synthesize myLabel, myPicker;

//This is where we loaded the components we were going to use – “DateViewController”.
/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];

NSLog(@”Hi from IMM”); //like trace(“”) in Flash.
}

- (IBAction)setDate: (id)sender{

//myLabel.text= myDate;

NSDate *myDate2 = myPicker.date;

myLabel.text= myDate2.description;

NSString *myDate = myDate2.description;
NSLog(@”Date Picked = %@”, myDate);

}
//Here we have some simple ‘instance’ field assignments.

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

//Just some error checking.
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn’t have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren’t in use.
}

- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (void)dealloc {
[super dealloc];
}

@end

 

Some useful tips/links:

  • iOS developer library – Apple’s official documentation regarding developing in Objective C.
  • iCode Blog – A blog dedicated to all things mobile.
  • xCode Tutorials – A number of helpful tutorials that go through some simple examples.
  • Cocoa Dev Central – Another set of helpful tutorials for learning Objective C.
  • Mac & Computer Help (YouTube) – Believe it or not, this YouTube channel has a specific section for helping programmers in Objective C. I didn’t take it seriously at first, but it’s proven itself effective

In conclusion,

Like most thing we’ve taken a look into in Multimedia Pioneering, xCode deserves a second look. I only wish we had more time to look at it – but it is definitely something I look forward to experimenting with in the future. (as soon as I get a mac).

Posted in Multimedia Pioneering | Leave a comment

Multimedia Pioneering – Flash for Android OS

Greetings Pioneers! Let’s continue the MOBILE-STREAK!

Another set of Multimedia Pioneering, this time around – Android OS. This developer kit was much less complicated to set up when compared to the iPhone developer kit. The only tricky thing involved was installing the RUNTIME.APK file onto the android emulator. What the Android SDK (software development kit) does is it creates a virtual device on your computer – complete with visuals and functionality (browsing works too). From there, we can load our applications on to the virtual (emulated) device, and see how it looks and operates.

How the Android OS and Emulator works:

The developer kit allows us to create a virtual device on our computers – for testing purposes. This works out well seeing as we don’t currently have any Android devices floating around our classroom. The emulator lets you create virtually (no pun intended) any size or style of Android device. You can simulate storage space, CPU, GPU, and Operating System. Since the actual OS doesn’t support Flash itself (I don’t think), but it does support Flash AIR – that is the work around to get our apps onto the devices. 

Other iPhone-Flash developer examples:

United Mindset
Flex Blog
Flash Mobile Blog

There isn’t much out there – but because Flash for Android is AIR-based, it’s a simple matter of making a Flash application, and exporting for AIR (so full “support” isn’t actually an issue).

Project Development:

In order to get this working properly, you first register to become an Android developer at developer.android.com (for free), and then you need to download the Adobe AIR SDK. From the Android SDK, you can set up various emulator profiles for OS, resolution, and all other sorts of goodies. Then you need to install the RUNTIME.APK on each emulator to get Adobe AIR to run. From there, we can set up our Flash document to package for Android OS and transfer the files over for testing and debugging. Thankfully, the Android emulator is quite developer friendly – and it has an option to PUBLISH your APK to the “connected device” (which it finds automatically) and opens it upon installation.

Probably the most difficult task was finding a WORKING version of the Android OS. We tried the newest HONEYCOMB, then 2.3.3, then 2.3.1, and FINALLY 2.2 worked.

But wait, there’s more! We had 2 Viewsonic android tablets to test around with in class today. The export function was exactly the same as the emulator (which was nice). So getting this figured out was real simple. There was also a command prompt method to install APK files onto the connected device – which I now have abundant experience with.

Here’s some pictures.

This slideshow requires JavaScript.

Til the next time,

Interactive Will

Posted in Multimedia Pioneering | Tagged , , , , , , , , , | Leave a comment

Multimedia Pioneering – Flash for iPhone OS

Happy New Year fellow Multimedialists!

We’re back, and with possibly the most exciting development in Multimedia Pioneering yet. We’ve recently had the chance to work with the iPhone developer kit in Flash! That’s riiiight, though it took quite a while to figure out the developer’s certificate and all that – we have begun testing/developing iPhone applications! Thanks to Dan Zen and Sheridan College, everyone in our class now has student developer certificates! (savings of $99!) Except we can’t publish our apps to the App Store and sell them for money. But, not a big deal – this is still really cool stuff.

How the iPhone developer kit works:

It seems so simple – I wonder what took so long to get this working! When developing for the iPhone, Flash lets you customize the following application settings:

  • Aspect Ratio
  • Portrait or Landscape Orientation
  • Full-screen and Auto-orientation
  • Rendering on CPU or GPU
  • Device output: iPhone, iPad, or both
  • And you can also include menu icons

Based on the nature of your Flash file, you should customize these settings appropriately. A peer of mine, Justin Howlett, has wonderful insight into how to make your iPhone Flash application run smoother. A few (of many) guidelines involve avoiding the use of nested movieclips, blend modes, timeline animations, and filters. My previous tilt application had tons of the aforementioned “do-not”s. So, I decided to make a less graphic/motion intensive application – I went with a puzzle style game.

Other iPhone-Flash developer examples:

  • Republic of Code – This site has a couple of good tutorials regarding Flash development for the iPhone. I’ve personally attempted to follow their Swipe Gesture tutorial, but to no avail.

Other than that, there aren’t many sites dedicated to Flash development on the iPhone – since this is still a fairly new process.

Project Development:

My application is a simple puzzle game I remember playing as a kid. I gave it a robot theme – since I couldn’t remember what the puzzle was called in the first place. Basically, there’s a grid of buttons – with two states. Every button you press affects itself and the ones around it (turning them to the opposite state). The objective is to get all the buttons in the opposite state. While developing this application – I because frustrated and buried in the mathematical logic and programming involved. Despite having spent most of my time figuring out the math and logic in the programming, I’ve come to somewhat of a final file – of which I specifically avoided graphics and tweens.

Here are some problems I ran into along the way:

  1. Efficiency all over: Array numbering system – I think this could be more efficient with a multidimensional array or just a better naming system – 1-1,2-2,3-3 etc.
  2. Like I said, I avoided heavy graphics for a reason. Not FRIENDLY, so I stuck with static images.
  3. Tried GESTURES, but they didn’t end up working.
  4. RESTARTING the game – removingChild doesn’t reset the status of all the buttons (keeps “winning”). This is a problem I should be able to figure out though. Silly little thing.

This slideshow requires JavaScript.

Final Thoughts:

This has been one of the most exciting Multimedia Pioneering sessions – not to discredit the previous. But it’s fun and exciting to see our applications on a device. I look forward to porting my game onto other devices. I’d love to see how it looks on the iPad. GIGANTIC! Also, I’m very interested in manipulating and using data and information from the iPhone/mobile device itself. Like the camera information or the GPS coordinates. From there, I’m one step closer to becoming an app-creating millionaire!

Watch out Zuckerberg!

 

-Will

Posted in Multimedia Pioneering | Tagged , , , , , , | Leave a comment

Multimedia Pioneering – Multi-user Technology

It’s me again!

As exciting as tilt was, I’ve recently had the pleasure of working with a much lesser known technology in Flash – multi-user technology. It is surprising that there hasn’t been much development in this area, considering the potential of the types of applications that can be based on multi-user tech. An example of  multi-user technology in its simplest form is a chat/messaging board.

How MULTI-USER works:

From what I can tell, the way this technology works is quite simple. The flash document is accessed from multiple computers, and the inputs/actions/events are recorded and constantly updated in a PHP script that is running on the server. Then the updates are displayed on all the connected users’ Flash documents. In order to edit and experiment with the technology, we used Dan Zen’s Robin application. We also simulated servers on our desktop machines via XAMPP.

Other MULTI-USER examples:

When searching for other examples of multi-user technology, I immediately thought of online Flash games. The principles of the technology are designed for multiple user interactionswhich is the basis of multiplayer games. An example of a site that hosts these  types of games is: Lunchtimers. Another very good use for multi-user tech is communications purposes – specifically for collaboration. A company called Collab specializes in creating communications applications in Flash. They also make games.

Project Development:

For this project, the most difficult aspect in terms of creating a working sample was getting the Robin application properly running on our local hosts. One thing we had to consider/keep in mind was that we needed to have the PHP document running (which records all user activity) while we edited/published our Flash document. Since Dan Zen provided us with a number of working samples already, there were many options to choose from in terms of creating a working sample. I went with the avatar choice sample.

Experiences during development:

  • I find that my ability to code in AS3 is getting much and much stronger. I’m feeling a lot more confident with myself – the area I need to improve is programming logic.
  • Thanks to Dan Zen’s build-it labs and equations, I was able to throw in some features in my game that make it look that much more impressive (scrolling background).
  • Also, with use of TweenMax – my tween animations were made much easier and eased my workflow.
  • One problem that I and most of my classmates seem to be running into is animation tweens only being viewed on one of the two computers involved in the multi-user experience. Hopefully we’ll come up with a solution soon.

Here’s a couple screenshots:

This slideshow requires JavaScript.

Final Thoughts:

I really do enjoy experimenting with multi-user technology. I actually wish we had more time to gain a better understanding of how it works. It’s definitely something I’m going to look into in the future. The combination of interactivity plus multiple users makes the idea of application creation even more elaborate. The only problem I can see at the moment is the lag that’s involved with the Flash and multi-user interface.

PEACE OUT!

-Will

http://www.collab.com/c
Posted in Multimedia Pioneering | Tagged , , , , , , , | Leave a comment

Multimedia Pioneering – Tilt Technology

So we meet again.

A couple of weeks have passed since my last update, but fear not. I’ve been busy at work with a new technology – the tilt technology based on accelerometer information. You’re probably most familiar with this technology in Apple’s iPhone and iPod touch products. Additionally, such technology is becoming more and more prominent on most new mobile devices.

How TILT works:

Again, don’t quote me on this, but this is my understanding of how this technology works. It was much simpler this time around, because inventor Dan Zen managed to adapt his Penguin application to read the native Flash accelerometer information. Prior to this, the Penguin app used a tilt simulator that Dan Zen created via Papervision. The accelerometer information native to Flash reads the amount of tilt in the X and Y directions and assigns it a number from -1 to 1. In order to properly read the directions, device central forces you to choose an orientation (flat, or right-side up). From there, we can code movements based on the tilt coefficients. Hopefully soon, we’ll be able to program using TRANSLATION info as well.

Other samples:

The first sample I found was an application called TiltViewer. It’s a Flash application for photo-viewing. It’s a pretty simple application for those who want an attractive way of browsing through photos hosted on Flickr. However, the application seems to imitate tilting via mouse gestures, rather than actually being capable of receiving information via accelerometers.

Next, I thought about all the applications created for the iPhone/iPod Touch that can be found in the iTunes store. However, none of these applications were developed in Flash – because the ability to export Flash to iPhone hadn’t been made available until very recently.

Project Development:

Since we’ve built a couple of applications thus far into the program, I’m feeling much more confident in my abilities. Naturally, that makes me challenge myself to make a more complicated and elaborate application.

Experiences during development:

  • ENTER_FRAME: As simple as this sounds, my greatest accomplishment while coding this app was the complete understanding of what the ENTER_FRAME event is. I’d previously thought that this command runs once the frame is entered. Only until I experienced numerous crashes did I realize that this event occurs on every frame that runs.
  • Thanks to Dan’s build-it labs, developing most of the game components came fairly easy. The only thing I’m still having trouble with is making a visible timer based on the Timer event.
  • Thankfully, understanding the tilt technology is quite simple – since it evaluates the amount of tilt into a decimal value. The main problems I ran into during development involved the graphics – since I experimented with blur filters and color transforms.
  • Also, thanks to some logical thinking, I put together a randomly moving sun that “bounces” off the sides of the stage. The reason I say “bounces” is because it doesn’t exactly follow any sort of gravity rules. It’s a perfectly elastic bounce.

Final Thoughts:

Again, it has been fun putting together this application. Admittedly, it seemed a lot easier to put this one together compared to last time, but that may be attributed to my level of comfort with Flash now. Still haven’t quite figured out how to upload the SWF itself – since it’s supported in Device Central, but here are some images of the final product.

This slideshow requires JavaScript.

Future Thoughts:

Like always – when developing this application, there are things I always think of adding – but either run out of time before adding it, or I haven’t quite figured out how to implement them. Like the following:

  • Adding a gravitational pull to the sun – such that when you get closer to it, it’s harder to pull out (need a higher tilt coefficient to break free).
  • Changing the trail color of our space ship as we go faster.
  • Redesigning the game function: One idea I had was to have targets appear to fly towards us and have to dodge them. This idea creates a sense of depth while tilting.
  • If I haven’t figured it out yet, adding a proper timer countdown display for gaming usability.
  • Physically porting my application onto a mobile device – because from there, I can properly tweak the difficulty level. Also, I could add a TAP or PINCH function into the game as well.
Posted in Multimedia Pioneering | Tagged , , , , , , , , | Leave a comment

Multimedia Pioneering – Motion Capture Technology

Greetings Blogoverse.

It is I, Interactive Will, here to tell you about my first and latest ActionScript 3.0 experience. Our first assignment of this class addresses Motion Capture Technology – which we’ve based off of inventor Dan Zen’s Ostrich Flash program. It is an open-source motion capture flash application. How does it work, you ask? Good question!

How it works.

Now, don’t quote me on this – but here’s the gist of how this rather clever application works. As the camera captures frame by frame, the application records each frame as an image, and processes it to blob/glob type looking images. It looks something like as if the subject in the foreground is green, and the background is black. Then, as the subject in the foreground moves around, frame by frame, the application captures the difference between the two images – indicating that there is motion happening. The cursor is instructed to follow the difference in motion, as best as it can. As a result, users can enjoy the technology of motion capture with a device as simple as their computer’s webcam. See here for further details.

Other samples?

While looking for similar samples of this technology, it was difficult to find anything similar or identical to Ostrich. Most of the links/pages I looked up related more towards 3-dimensional motion capture (with the funny suits).

  • Vicon – a company originally based in the UK, but merged with a US company to provide integrated solutions for both digital optical and video-based motion tracking.
  • House of Moves – owned by Vicon, this site advertises a facility used for motion capture, briefly overviewing the technology behind it.
  • Xsens – this company has something more to do with inertial sensor technology, kind of interesting – with cool lycra suits.
  • And finally, with some more relevance to our technology – GestureTek, SixthSense, and Mgestyk are all gesture capturing user input technologies.

Overall, this is a very exciting field to work in.

My project.

Given that my ActionScript 3.0 skills were virtually non-existent at the start of this month, I’d ask you to be kind on your critique of my application.

When given the Ostrich code in the beginning, I carefully analyzed and decided to edit the Ostrich Button document. I liked the notion of holding down on a button, which got me thinking of making a game where buttons would come up, be pressed, points awarded, and so forth. I’ll now list out the problems I encountered, and my solutions for them:

  • Making new buttons appear after the first one is pressed. SOLVED: Dan Zen provided the .dispose(); function.
  • Keeping and displaying score count. SOLVED: Adobe help section, putting a Number variable into a string variable.
  • Start screen, game screen, end screen. SOLVED: Dan Zen provided solution of adding MovieClip with a higher child index + click through.
  • Random location generation and color generation. SOLVED: Adobe help section, random math function.
  • Properly displaying the game timer. UNSOLVED: Could not quite figure out how to properly display the timer counting down from 30 seconds to zero. Attempted a “fake” count down as well, but ran into movieclip + timing issues…

Other than that, I used the Flash basics we learned in our Web Authoring class, as well as a few tips and tricks from Flash communities on the internet. Overall, the experience was similar to that of riding a roller coaster. In the beginning, the process and coding seemed overwhelming. As hours were spent in the lab, frustration and anxiety grew with every encountered problem. Luckily, persistence pays off. The more time I spent in the lab, the more I realized about the errors in my ways. And subsequently, the easier understanding the coding became. Granted, every other night I did happen to wake up thinking about code and ways to code, but that’s perfectly normal for an aspiring coder, right?

Final notes.

It’s been fun putting this together. It’s funny how the program doesn’t quite feel completed until it has a nice design to it as well. When I figure out how to properly upload this onto a site, you can believe that I’ll have a link set up. But until then, carpe diem!

-Interactive Will

Edit:

Future thoughts:

I’ve decided to talk a bit more about what I could add to my game to make it better. Obviously, these great ideas came to me, minutes prior to my assignment being evaluated – thus, attempting to implement these ideas last minute came to no success.

  • I just tried to include a MODE selection option (3 buttons at the start) – whereby EASY mode has bigger targets, and HARD mode has smaller targets to hit. (I figured the time should remain the same – in order to compete between the difficulty levels)
  • I still think it’s very important to include the count down timer.
  • Just a final thought (which would require a ton more of coding) – but how about a two-player mode? Targets would show up on either side of the screen, and since there is the two cursor application already, it’d be quite simple to develop.
Posted in Multimedia Pioneering | Tagged , , , , , | Leave a comment