Saturday, April 27, 2013

Google Play Developer Console: Upload Failed (Error uploading APK)

Are you getting this error?

Inline image 1

You need to refresh your browser. The application running at https://play.google.com/apps/publish/v2/ wants to be refreshed regularly or it stops functioning. Sometimes I need to clear cache / restart Chrome to get it to come back to life.

Tuesday, April 09, 2013

Upgrade from cocos2d-2.0-x-2.0.4 to cocos2d-2.1rc0-x-2.1.2


- CCDirector::sharedDirector()->getScheduler()->unscheduleAllSelectorsForTarget(this);
+ CCDirector::sharedDirector()->getScheduler()->unscheduleAllForTarget(this);



-       virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, cocos2d::CCString * pSelectorName);
-       virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::CCObject * pTarget, cocos2d::CCString * pSelectorName);
-       virtual bool onAssignCCBMemberVariable(cocos2d::CCObject * pTarget, cocos2d::CCString * pMemberVariableName, cocos2d::CCNode * pNode);
+       virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, const char * pSelectorName);
+       virtual cocos2d::extension::SEL_CCControlHandler onResolveCCBCCControlSelector(cocos2d::CCObject * pTarget, const char * pSelectorName);
+       virtual bool onAssignCCBMemberVariable(cocos2d::CCObject * pTarget, const char * pMemberVariableName, cocos2d::CCNode * pNode);


-       CCScale9Sprite *backgroundButton2 = CCScale9Sprite::spriteWithFile("button.png");
-       CCScale9Sprite *backgroundHighlightedButton2 = CCScale9Sprite::spriteWithFile("buttonHighlighted.png");
-       CCLabelTTF *menuButton = CCLabelTTF::labelWithString("Menu", "Marker Felt", 30);
+       CCScale9Sprite *backgroundButton2 = CCScale9Sprite::create("button.png");
+       CCScale9Sprite *backgroundHighlightedButton2 = CCScale9Sprite::create("buttonHighlighted.png");
+       CCLabelTTF *menuButton = CCLabelTTF::create("Menu", "Marker Felt", 30);



-       dbPath = CCFileUtils::sharedFileUtils()->getWriteablePath();
+       dbPath = CCFileUtils::sharedFileUtils()->getWritablePath();


-               fullPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("data.mp3");
+               fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename("data.mp3");






Saturday, April 06, 2013

Tracking SQLite3 Database Version with user_version Pragma

Building an SQLite3 layer into your games without the help of Android's awesome SQLiteOpenHelper? One thing you will need to keep track of is the version of the schema in use in your SQLite database.

Thankfully, the SQLite database and the API for accessing it provides some functions that will help you out.

in particular, these commands are "pragma" which reads and sets values in a properties list of the database and "user_version" which is an in-built database property intended to be used to track schema version.

sqlite> pragma user_version=10;
sqlite> pragma user_version;
user_version
------------------------------
10

sqlite> pragma user_version=12;
sqlite> pragma user_version;
user_version
------------------------------
12

This is the same process that your SQLiteOpenHelper implementation with Android uses, and provides you the ability to write onCreate and onUpdate methods as you would in Java.

http://stackoverflow.com/questions/2659797/how-do-i-use-sqlite3-pragma-user-version-in-objective-c