Monday, March 12, 2012

COCOS2D AND XCODE

I have been testing out Cocos2d and after installing it xCode started going crazy.

'New File' started crashing


I have installed cocos2d 1.0.1 on xCode 3.2.6, everything is okay, templates are installed and HelloWorld project compiles successfuly.
But when i need to create a new class,after clicking on "New File" i will get this error twice:
File: /SourceCache/DevToolsIDE/DevToolsIDE-1760/pbxinterface/Wizards.subproj/PBXWizardChooserWizard.m
Line: 1158
Object:
Method: _addWizardProxiesFromBaseSearchPath:subpath:
Assertion failed: _currentMultiWizard == nil


I had to delete any folder called cocos2d in both my user and system Libraries:

/Library/Application Support/Developer/Shared/Xcode/File Templates/



Adding References to Libraries in XCode

It did not work the way that I thought it would.

The tutorial I found that got me past the obvious issues was this:
http://www.theappcodeblog.com/2011/03/07/db-app-tutorial-part-1-create-a-database-using-sqlite/

This tutorial also helped:
http://www.techotopia.com/index.php/An_Example_SQLite_based_iOS_4_iPad_Application_(Xcode_4)

And this post was very, very useful figuring out which strategy to go with:
http://www.cocos2d-iphone.org/forum/topic/9308

First iOS Bug Cycle

I ran into a compile error today working on an iPhone application using Cocos2d.

The error was:

[CCTouchDispatcher addTargetDelegate:priority:swallowsTouches:]: unrecognized selector sent to instance

and I entered that into Google.

A few results down I found this link:

Which shows a fix that is totally irrelevant to my issue.

I later figured it out on my own. Learning iPhone development so far is fun, but slower than Android.

Tuesday, October 11, 2011

Pages From 99% I liked

This piece on the power of uncertain times was a good read:

This one about 25 insights on how to be a better writer was also worth a read:

And this about how a talented executive learned to lead:

And last but not least, 12 attributes of a really great place to work:

Thursday, October 06, 2011

Android Application Trouble with "android.hardware.screen.landscape"

The Problem:

When you upload your APK to the Android Market it is flagged with an awful and mysterious permisison called "android.hardware.screen.landscape" and this limits your devices to a very small number.


The Issue:

You have a landscape application that does not support portrait. However, your application will run on many devices that are rotated even if they do not specifically have the landscape hardware (ie, no portrait mode?)


The Solution:

Add the following line to your AndroidManifest.xml and everything will be fine.




Notes


At some point Google added this as a filter during upload. It came on and off for a while depending on what SDK you use. Various people have posted / Tweet'd that it can be fixed with an SDK upgrade. That may or may not be true on your platform or at the time you read this.

Monday, July 25, 2011

Saturday, July 23, 2011

Android Development on Windows

If you are doing any Android development on Windows 7 OS you should install these Codecs:


They will really help you get around inside the media that Android APK are packaging, like OGG files.

Follow me on Twitter @corytrese

Tuesday, June 28, 2011

Monday, June 27, 2011

Codedependent: Android Rendering Options

Codedependent: Android Rendering Options: "I've given some talks about Android graphics recently, and the same questions keep coming up: What is Renderscript appropriate for? Is it a ..."

Friday, June 03, 2011

Android ADT Eclipse: Unknown error: java.lang.NullPointerException

Do you have this error?

[2011-06-03 09:52:51 - AndroidSamNinteen] Unknown error: java.lang.NullPointerException

If you have this error, GIVE UP NOW.

This error cannot be fixed.

Eclipse is corrupted in a way that cannot be recovered.

the only solution I have ever found (sixth time) is the second you see this error, remove everything, delete all files and start over.

1. New install of Eclipse
2. New install of ADT
3. Recreate project by hand (import source files)
4. Now it will build

Thursday, June 02, 2011

Eclipse Android

#Eclipse ADT for #Android and Windows XP -- a match made in heaven. They both need to be restarted about 27 times a day.

Questions I should have Asked at Google IO

Questions I should have asked :

Why 9-patches, why not XML?
Why is /tools/ so bad?
Does Google use any of these tools?

Wednesday, June 01, 2011

Working From Home

I'm stuck working from my house a lot due to the fact that they re-assigned my desk at work to a contractor. (Seriously.)


There are some good tips from our friends over at GoPayment.

Wednesday, May 25, 2011

Class for Creating Bold Text in Android

This class has saved me TONS of time ...


public class StyleableSpannableStringBuilder extends SpannableStringBuilder {

public StyleableSpannableStringBuilder appendWithStyle(CharacterStyle c, CharSequence text) {
super.append(text);
final int startPos = length() - text.length();
setSpan(c, startPos, length(), 0);
return this;
}

public StyleableSpannableStringBuilder appendBold(CharSequence text) {
return appendWithStyle(new StyleSpan(Typeface.BOLD), text);
}

public StyleableSpannableStringBuilder appendItalic(CharSequence text) {
return appendWithStyle(new StyleSpan(Typeface.ITALIC), text);
}
}

Wednesday, May 18, 2011

Dealing with the "gen" folder in Android -- Clean, Error, Clean, Build, Etc

From StackOverflow:

http://stackoverflow.com/questions/3820517/clean-in-eclipse-temporarily-destroys-android-project-with-error-message-missing


So valuable I needed to repost it

We have finally tracked the last problem regarding this bug.

The "clean" action used to always delete the "gen" folder which was wrong. This was fixed in ADT 8 or 9, I can't remember.

However, if the "gen" folder is marked as derived it still gets deleted which leads to the error.

When the "New Project Wizard" is run, the gen folder is created normally, without the "derived" flag, so this is fine.

The following scenario however is broken:

  • delete manually gen, or
  • check in the source code in a repository (git/svn/...) and don't put the "gen" folder in there, then do a check out on another computer.

  • This leads to ADT recreating automatically the "gen" folder during build, this time enabling the "derived" flag, which will trigger the wrong behavior on "clean".

The temporary solution is to:

  • right click "gen"
  • choose "Properties"
  • uncheck "Derived"

as long as the "gen" folder doesn't get deleted you'll be able to clean your project without side effect.

I just checked in a fix to: - never mark the folder as "derived" - during clean, first remove the "derived" flag from "gen" so that it doesn't get deleted in the case of older projects. Patch is visible at:https://review.source.android.com/#change,22410

Friday, May 13, 2011

Bookmarks and Reading for 5/13

Artificial Intelligence
Anyone who is trying to build compelling single player games will be faced with the need to create a compelling second player -- the AI.



IDE vs. Command Line
For those of us who are building in Eclipse for our Android projects, there is another way if you are willing to work at it.



Thursday, May 12, 2011

Why the HTML5 vs. Flash Debate Is Already Over

This is a battle of one vs. many.

Adobe vs. Google/Apple/Microsoft/Opera

JavaScript and HTML5 cannot help but win because they have numbers.

Maybe not browser numbers yet -- but Adobe doesn't even make a browser.

Saturday, April 16, 2011

Trese Brother's Software: Star Traders RPG v3.6.9 Released

Trese Brother's Software: Star Traders RPG v3.6.9 Released: "The newest version of Star Traders RPG has been released to the Android Market! You can download the free to play edition also available f..."

Another release of my Star Traders RPG game, a from-scratch one-man development project using Java and Eclipse.

Thursday, April 14, 2011

Trese Brother's Software: Star Traders RPG v3.6.8 Released

Trese Brother's Software: Star Traders RPG v3.6.8 Released: "Full Screen Option Better Honeycomb Support Improved Game Skins Added First 4 Backgrounds for Game Screens Improved Map Movement Performance..."

Friday, April 08, 2011

Bad Idea

Geeking out reading old backstory of The Ur-Quan Masters on Wiki pages when I should be coding

Wednesday, April 06, 2011

Refactoring Tools: Eclipse v. Visual Studio 2010

After coding with both Visual Studio 2010 Professional and Eclipse Basic 3.6 I can honestly say, Visual Studio sucks at refactoring.

The basic "change method signature" tool in Eclipse -- which is free -- is honestly at least 5 times better than the Visual Studio version which cost me -- literally -- thousands of dollars.

It seems that the best way to get Visual Studio to refactor at roughly the same level as Eclipse is to purchase ANOTHER commercial product -- ReSharper to plug into Visual Studio and bring up the refactoring. Really?