The Blog

Custom Alert View for iOS4

Hi everyone!

CustomAlertViewSampleProject Screen Shot

CustomAlertView Screen Shot

With some of the changes in iOS4, it has become more difficult to create UIAlertViews with UITextFields as subviews and have it look right.  So I went ahead and made a fully customizable alert view replica called CustomAlertView (clever huh?).

One thing I didn’t want to do was re-factor a bunch of my code, so I recreated most of the methods in UIAlertView based on the description of their functionality in the API.  Some of the names are slightly different, particularly in the CustomAlertViewDelegate.  I have attached a sample project that should show how to use it, but I’ll also paste it below.

Two things to note in the project are that I connected the UITextFields in Interface Builder and that I set the main view to be the RootViewController of the main window.  The code relies on being able to access the root view controller, you you need to make sure it is set.  Here’s how I did it in CustomAlertViewSampleAppDelegate.m:


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// Override point for customization after application launch.

// Add the view controller’s view to the window and display.
[window setRootViewController:viewController];
[window makeKeyAndVisible];
return YES;
}


Also, be sure to get the images from the sample project as well if you want to use this as is.

I hope you find this useful!  Please let me know if you find any bugs or ways to clean this up!  Also, I didn’t include the animation to move the CustomAlertView up to make space for the keyboard, but I can if people want :)

Download: http://www.namazustudios.com/files/CustomAlertViewSample.zip

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter

checkpasswd-imap – A mod_authnz_external style password checker.

For those of you who out there who have ever set up Trac in the past, you probably know that the out-of-the-box installation requires that you use some sort of external authentication mechanism to validate users who have access to Trac.  You’ll also know that if you use Google Accounts that and mod_auth_openid, it’s really difficult to authenticate users without adding a little bit of custom code to either Trac, mod_auth_openid, or both.  (Or if you don’t, I haven’t figured out a way to do it).   In the end I just ended up sidestepping the whole process and resorted to using mod_auth_imap against Google’s IMAP server.  Unfortunately, that lead to a second problem….it appears that mod_auth_imap validates users credentials against the server for each HTTP request resulting in lots and lots of unnecessary traffic, painfully slow HTTP requests and if the IMAP server happens to have rate-limiting  it’s an easy way to quickly lock out all your accounts.  So for anybody who is faced with a similar problem, I hacked this little checkpasswd style external authentication program.  Here’s a quick rundown of the features:

  • Configurable for multiple IMAP servers with filtering of users by regular expressions
  • Compatible with mod_authnz_external
  • Login credentials are cached with unrecoverable encryption and then stored to disk.  Optionally this can be configured to be put in a RAM drive and cleaned regularly with a cron job.
  • Portable, written in Python.  Tested on Gentoo Linux only with Python 2.6.
  • Can be used in conjunction with mod_dav_svn

If anybody has any questions or comments feel free to email me.  If you find bugs or issues, please wear the white hat and let me know so I can fix them immediately.  The code is released under GPL v3.

Download it Here

All the instructions are included in the archive.


Patrick “Invictvs” Twohig <invictvs@namazustudios.com> (A.K.A. “The Server Guy”)



Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter

iDuel Online 1.1 Update is Live!

We’ve been reading the TouchArcade forums as well as user reviews and feedback from the App Store reviews and have made several changes to the game and the server to improve performance and game play! Be sure to update so you can keep playing!

Features added to the new release:

  • Added “Sleepwalker” mode.  When a player has disconnected or logged off, opponents may challenge them and the server will play in their place.  If the server population is low there is always somebody to fight, even if that person is just a bot.  Winning a “Sleepwalker” match reduces your match point earnings, however, so it’s always best to fight live players when possible!
  • Added auto-refresh to the lobby.  This will keep you up to date with the players entering and leaving the lobby in real time.
  • If a player disconnects during game play (ie you see them “Do Nothing”), the player will automatically forfeit on the next turn if he/she does not take action.  The winner is awarded full match points and credits if an opponent disconnects.  The loser will receive zero credits and zero match points.

Major Bug fixes/Improvements:

  • If you have multiple challenges pending, the server will automatically decline all other challenges when you enter a game.  This prevents many situations where you issue a challenge and wait forever for somebody to accept or decline and never get a response.
  • Made the lobby more efficient.  We greatly reduce the rate at which games fail to connect.
  • Found and fixed a number of crash problems.
  • Fixed the major issue where the duel screen simply waits forever on the opponent.
  • iDuel Online now requires iPhone OS 3.0 or greater.

On the table for the future:

  • Performance enhancements in the Gear Shop.
  • Performance enhancements in game.
  • AI Learning for sleepwalkers.  Your sleepwalker will fight matches based on how normally fight.
  • Other great stuff!

I would also like to thank the players who have provided the constructive criticism regarding these issues and have waited patiently while we fix them.  For any questions or comments, please feel free to follow up on this post or contact me directly via email.


Patrick “Invictvs” Twohig <invictvs@namazustudios.com> (A.K.A. “The Server Guy”)


Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter

iDuel Online 1.1 Update Submitted!

We’ve submitted our first update to Apple for review for iDuel Online and are now waiting for approval. Thanks to player feedback on forums and App Store reviews we’ve added new features and fixed several issues. We’ll post detailed notes on the changes when the update goes live!

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter

First iDuel Online Update is Coming Soon!

We’re now working on some updates to both the game and the server. We will improve performance in matchmaking and battle to take care of the issues many players have experienced.

We’ll also be adding a “Sleepwalker” bot mode. This will allow players to choose to duel a bot version of a character if they can’t successfully challenge another live player to a match or if other players are unavailable.

I’ll post updates here (as well as on Twitter, Facebook, and our thread on the TouchArcade Forums) as the changes go live.

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter

iDuel Online at PAX East!

Three of us will be going to PAX East in Boston to promote iDuel Online! We printed an ad in the convention program for the game. We don’t have a booth, but we’ll be wandering around the convention wearing t-shirts featuring the iDuel Online logo. If you spot us be sure to say hi! If you give us your e-mail, we’ll hook you up with some credits or other in-game goodies!

iDuel Online PAXE Ad

iDuel Online is now available on the App Store! Be sure to get it for your iPhone or iPod Touch!

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter

iDuel Online Submitted!

We’ve submitted iDuel Online to Apple for approval for the App Store!  Look for it soon!

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter

iDuel Online is on the way

Here’s the logo for our upcoming game, iDuel Online, for the iPhone and iPod Touch:

iDuel Online logo

iDuel Online is a multiplayer online RPG where players strategically duel other players. We’ll be showing off some more art soon with additional info. We’ll also be adding to the game’s page on the site as we reveal more.

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter

Upcoming iPhone Game

Coming Soon - Our First iPhone Game

We’ve been hard at work on our next project, our first game for the iPhone and iPod Touch!  I can’t say much now, but it’s in a totally different direction for us and we’re very excited about the project.

We can’t give too much more away at this time but it’s going to be big so keep your eyes open for more info in the very near future!

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter

Better Android Builds

While developing Guns of Legend for Android, we learned quite a few things about the Android build process.  Firstly, it’s not very well documented.  As far as we could tell, it didn’t perform much before-time optimizations on bytecode.  The dex compiler performs some optimizations, but we had observed a noticeable difference between debug and release builds made with Proguard.  Lastly, some common programming practices designed to improve code quality cause performance bottlenecks in unoptimized Java bytecode.  J2SE Virtual Machines solved this problem by implementing “just-in-time” compiling which performs whole program optimization while the bytecode loaded into memory.  We put together a set of Apache Ant build scripts to streamline the process of building, packaging, and fully optimizing an Android application before deployment.

Attached to this post is a copy of a template script designed to streamline your Android build process, protect your code from reverse engineering, and perform crucial optimizations on your code.  Additionally, Proguard can remove code that should only be left in for debugging.  It is common practice to write redundant checks for null arguments in functions.  Though these are often times handy in diagnosing problems, they can slow down performance.  If you were to isolate the checks to static methods in a single class, it is very easy to have Proguard simply throw out the class from the build all together.  It will make it more difficult to interpret crash stack traces but it will provide better performance.  When using this feature of Proguard, it is your responsibility to ensure that the removed code will not affect the normal behavior of the application. Only remove classes/methods which are well isolated from the rest of the program, or else you may find that obfuscated builds crash while debug builds don’t.

Lastly, please bear in mind that this script was originally written for pre-1.5 (Cupcake) releases of the Android SDK then later revised.  Parts of this script can be integrated into the ones auto-generated by the Android SDK, or you can use this with a little bit of modifications.  Please let me me know in the comments if you need help using this script or tailoring it to your particular application.  I hope that the Android community will find it useful in some way!

Download the Script

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • Reddit
  • Slashdot
  • Twitter