Wednesday, February 12, 2014

Animation tuotial

https://code.google.com/p/apidemos/source/browse/#svn%2Ftrunk%2FApiDemos%2Fres%2Fanim

playing .swf on application startup into Android



import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.webkit.WebView;
import android.webkit.WebSettings.PluginState;

public class Splash_Screen extends Activity {

     private static int SPLASH_TIME_OUT = 3000;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.startup);

        String localUrl ="file:///android_asset/Kiss-o-meter.swf";

        WebView wv=(WebView) findViewById(R.id.webview);
        wv.getSettings().setPluginState(PluginState.ON);
        wv.loadUrl(localUrl); 

        new Handler().postDelayed(new Runnable() {

            /*
             * Showing splash screen with a timer. This will be useful when you
             * want to show case your app logo / company
             */

            @Override
            public void run() {
                // This method will be executed once the timer is over
                // Start your app main activity      
                Intent yes_krao = new Intent(Splash_Screen.this, KissingMeter.class);
                startActivity(yes_krao);
                finish();
            }
        }, SPLASH_TIME_OUT);
    }   
}