How to create a Splash Screen in Android?
packagecom.livrona.apps.justsikh.activity; importandroid.app.Activity;importandroid.content.Intent;importandroid.os.Bundle;...
View ArticleHow to create a Tabbed Screen in Android?
publicclass BaniTabbedScreen extends TabActivity implements OnTabChangeListener { private TabHost tabHost; @Override publicvoid onCreate(Bundle savedInstanceState){...
View ArticleHow to create an Intent to launch audio in Android?
String audioUrl ="Your Audio URL mp3 file/stream here";Intent audioIntent =new Intent();Uri audioData = Uri.parse(audioUrl);audioIntent.setDataAndType(audioData, "audio/mp3");...
View ArticleHow to Youtube videoID from the URL in Android?
publicclass YouTubeUtils { publicstaticString getVideoIdFromUrl(String url){ Log.d("getVideoIdFromUrl : "+ url); String vid =null; try{ // <a href="http://www.youtube.com/watch?v=Vr_Bq_GWyuU"...
View ArticleHow to show an Alert Dialog in Android?
publicstaticvoid showDialog(finalContext context, finalString title, finalString message){ MainThread.run(context, newRunnable(){ @Override publicvoid run(){ AlertDialog.Builder builder =new...
View ArticleHow to get content of Http URL as a String Android?
packagecom.livrona.andriod.commons.utils;...
View ArticleHow to check if file is writable in PHP?
function is_really_writable($file){ // If we're on a Unix server with safe_mode off we call is_writable if(DIRECTORY_SEPARATOR=='/' AND @ini_get("safe_mode")==FALSE) {...
View ArticleHow to write a utility method to print redirect in PHP?
function redirect($uri='',$method='location', $http_response_code=302){ if(!preg_match('#^https?://#i',$uri)){ $uri= BASE_URL .$uri; }switch($method){...
View ArticleHow to get file extension in PHP?
/* Extract the file extension * * @access public * @param string * @return string */ function get_extension($filename)...
View ArticleHow to create a UIButton programatically in iOS?
UIButton *button =[UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame= CGRectMake(100.0, 200.0, 180.0, 60.0); // on click, which method to call[button addTarget:self...
View ArticleHow to create and load URL in UIWebview in iOS?
// NSURL class is used to create an object which will hold the URL information. // NSURLRequest is used to create a request to the URL. // Method loadRequest of UIWebView is used to load the request...
View ArticleHow to clean phone number string in Objective C?
+(NSString*) cleanPhoneNumber:(NSString*) input{ NSString *output = @"";for(int i=0; i<[input length]; i++){ if(isdigit([input characterAtIndex:i])){ output= [output...
View ArticleHow to create a PINAnnotationView in IOS?
Annotation*anno =[[[Annotation alloc] init] autorelease]; anno.coordinate= xxx// get it map view; anno.title= @"Current Location"; anno.subtitle=[NSString stringWithFormat:@"%f, %f",...
View ArticleHow to encode Mysql Result into JSON?
<?php // connect to db mysql_set_charset('utf8',$dbc); $sqlStr="SELECT * FROM category;"; $result=mysql_query($sqlStr,$dbc) or die($sqlStr); $rows=array();...
View ArticleHow to clean file name for security reasons in PHP?
/** * Clean the file name for security * * @access public * @param string * @return string */ function...
View ArticleHow to limit file name to a given length in PHP?
/** * Limit the File Name Length * * @access public * @param string * @return string */ function...
View ArticleHow to sent Push Notification for APNS in Java?
importcom.notnoop.apns.APNS;importcom.notnoop.apns.ApnsService; ApnsService service = APNS.newService() .withCert("../config/push-prod-cert.p12", "xyz")...
View ArticleHow to send email for GoDaddy using Java?
packagecom.infuze.server.util; importjava.util.List;importjava.util.Properties;...
View ArticleHow to cleanup Quartz Jobs on shutdown in Java?
/*** Shutdown the scheduler */privatevoid shutdownScheduler(){ try{ log.info("Performing Job Resources CleanUp"); Scheduler scheduler = SchedulerManager.getInstance().getScheduler(); if(scheduler...
View ArticleHow to print NSMutableArray in Objective C?
SolutionNSMutableArray array = nil;array = [NSMutableArray arrayWithObjects:@"Hat", @"Bat", @"Mat" nil];// method 1NSLog(@"array: %@", array);// method2for (id obj in array) NSLog(@"obj: %@", obj);
View Article