23 Ocak 2015 Cuma

How To Make a Splash Screen In Android Like Facebook or Twitter Or Linkedin .

In This post i will show you how to create a Splash Screen in Android .lets start;
  1. Create a FullScreen Activity in Your Development Environment (mine is Eclipse Luna EE) and Pick This Activity As Launcher Activity.
  2. Comment out everything except for the parts in onCreate block till setContentView method.
  3. In Layout Editor delete all form items , have it just like this one below: layout xml:
    
    
        
    
    
    
        
    
        android:background="@drawable/your_splash_image"
            android:fitsSystemWindows="true" >
    
            
            
        
    
    
    
    Now Your Splash Screen is Done :) you only have to make some time count.
  4. After your "setContentView(R.layout.activity_welcome)" method Create a Timer Object which is from Java.Util.Timer and implment the logic as follows.
    setContentView(R.layout.activity_welcome);
    
    		Timer timeToLaunch = new Timer();
    		timeToLaunch.schedule(new TimerTask() {
    
    			@Override
    			public void run() {
    				// TODO Auto-generated method stub
    				
    				boolean isUserLoggedIn= here is your business logic whether is user Logged in , or is connection ok , do some logic or nothing just route to your mainActivity Screen After some time (in miliseconds)
    
    
    				if (isUserLoggedIn) {
    					Intent intentToMainActivity = new Intent(
    							WelcomeActivity.this, UserMainActivity.class);
    					startActivity(intentToMainActivity);
    				}
    				else
    				{
    					Intent intentToMainActivity = new Intent(
    							WelcomeActivity.this, MainActivity.class);
    					startActivity(intentToMainActivity);
    					
    				}
    			}
    		}, 3000);
    

12 Ocak 2015 Pazartesi

Angular Js Custom Filters Example .

Hello My Friends , Filters Are really powerfull in in Angular Js , you can manipulate your date spans ,customize according to local date format , capitilize your strings , convert currencies , anything that you need is possible by Filters.As you can see Custom Filters are important , so lets take a closer look and define a default filter provided by angular then create our own custom filter that does a specific job.