How to animated text like marquee on iPad?
Snippet In order to create a rotating banner marquee on screen we can use a label along with help of core animation to achieve the effect as follows. The location of the text and duration can be...
View ArticleHow to create vertical menu in Cocos2D?
Snippet In order to create a Menu in Cocos2D, simply create MenuItems and then add create the Menu with those items and finally align the items vertical for a vertical menuCCMenu *endMenu =nil;...
View ArticleHow do you post and recieve notifications via Notification Center in iOS
Snippet Notification Center allows to send internal asynchronous notification with the application. Ex. you can define these methods as below to send notification when required in your app.-(void)...
View ArticleHow to check if network is Reachable in iOS?
Snippet Any good mobile application would keep a track or aleast check whether the network is reachable or not as the iPhone may have a bad reception, the wifi may not be connected etc. This is also a...
View ArticleHow to use a LED like font in iOS?
Snippet LED like font is available on the iOS platform. The following snippet shows how to set the font to LED like for a label. UILabel *remainLabel =[UILabel alloc] init]; [remainLabel...
View ArticleHow to display a Dialog using UIAlertView in iOS?
SnippetThe following utility method shows how to display a Dialog using UIAlertView.+(void) displayAlertOk:(NSString*) title andMessage:(NSString*) message {[self displayAlert: title andMessage:...
View ArticleHow to progamatically Java version?
Snippet The key here is to use the system property java.version and get minor and point version. publicclass CheckVersion { publicstaticvoid main(String[] args){ String version...
View ArticleHow to programatically download mp3 file from Web using PHP?
Code Using PHP built in function fopen we can read a remote stream, read the contents in the buffer and flush it to the file.// Copy remote file locally $remote_file='http://www.example.com/music.mp3';...
View ArticleHow to check if file exists in PHP?
Snippet Using the file_exists function it is very easy to check whether a file exists in a given directory or not. Say we want to check if file name audio.mp3 exists or not in /tmp...
View ArticleHow to get button text on click in Android?
The following code shows how to associated the OnClickListener with the button and later on when its clicked and that handler is invoked how to get the title to the button.Button buttonAdvert =...
View ArticleHow do you convert CharSequence to String in Android?
AnswerThe CharacterSequence is an interface as defined below// Compiled from CharSequence.java (version 1.5 : 49.0, no super bit)public abstract interface java.lang.CharSequence { // Method...
View ArticleHow to Resize UIView using Core Animation in iOS?
Core Animation based on Quartz provides very simple ways to create special effects in your game or application.The following shows how to create a Resize Effect of any UIView (e.g. UIButtonView,...
View ArticleHow to Move UIViews using Core Animation in iOS?
Core Animation based on Quartz provides very simple ways to create special effects in your game or application.The following shows how to create a Move Effect of any UIView (e.g. UIButtonView,...
View ArticleHow to create a Pulse Effect on UIViews using Core Animation in iOS?
Core Animation based on Quartz provides very simple ways to create special effects in your game or application.The following shows how to create a Pulse Effect of any UIView (e.g. UIButtonView,...
View ArticleWhen you transition scene in cocos2d what methods do get called?
The following three callback methods are called when one Scene is transitioned into another in Cocos2D. -(void) onEnter{// Called right after a node's init method is called.// If using a...
View ArticleHow do you add a colored background in Cocos2d?
Adding colored background to a layer is very easy, just create a CCLayer from the subclass CCLayerColor and in the constructor define the name of the color as show below.// Set background color to...
View ArticleUnderstanding Cocos2D CCNode?
/** CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode. The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu. The main features of a CCNode...
View ArticleHow to check if UIImage the is loaded?
AnswerSometimes when we load the UIImage and try to use it, it does not display or given an exception. The very simple way is to check whether the image handle is null or not as shown below.UIImage...
View ArticleHow to make UIWebView background transparent?
AnswerAt times the UIWebView background needs to be made transparent so that the html content is displayed flushed against the screen background.For this set the following properties on the...
View ArticleCan you have the same development and distribution certificates for your iOS...
AnswerYou can, but then both your development and distribution certificates will be tied to the same public/private key pair (which is generated when you create the certificate request). This may work...
View Article