Sunday 20 July 2014

Android Splash Screen Example with Animation | Animated Splash Screen android

Hello Friends,
        Today, I am going to share the tutorial of android splash screen with animation.
With help of this tutorial you can easily implement the facebook like splash screen
or skype like splash screen.
                           
Android animated splash screen

1. Create an Android Project "SplashScreen"
2. Create an folder "anim" inside the res folder
3. Create two file inside the "anim" folder
      a. alpha.xml
   
         <?xml version="1.0" encoding="utf-8"?>

              <alpha
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:fromAlpha="0.0"
              android:toAlpha="1.0"
              android:duration="3000" />

     b. translate.xml
<?xml version="1.0" encoding="utf-8"?>

         <set

              xmlns:android="http://schemas.android.com/apk/res/android">
             <translate
                 xmlns:android="http://schemas.android.com/apk/res/android"
                 android:fromXDelta="0%"
                 android:toXDelta="0%"
                 android:fromYDelta="900%"
                 android:toYDelta="0%"
                 android:duration="2000"
                 android:zAdjustment="top" />
         </set>

4. inside your oncreate() called this method
 
public class SpalshScreenActivity extends Activity {

    /** Called when the activity is first created. */

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        StartAnimations();

    }
     ................
     ................

  }

      private void StartAnimations() {
    	Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
		anim.reset();
		LinearLayout l = (LinearLayout) findViewById(R.id.lin_lay);
		l.clearAnimation();
		l.startAnimation(anim);

		anim = AnimationUtils.loadAnimation(this, R.anim.translate);
		anim.reset();
		ImageView iv = (ImageView) findViewById(R.id.logo);
		iv.clearAnimation();
		iv.startAnimation(anim);

		anim = AnimationUtils.loadAnimation(this, R.anim.translate);
		anim.reset();
		LinearLayout l2 = (LinearLayout) findViewById(R.id.linear2);
		l2.setVisibility(View.VISIBLE);
		l2.clearAnimation();
		l2.startAnimation(anim);
    }


Download the code : Android animate splash sreen

Hope this will help someone
Enjoy Coding.... :)

ActiveAndroid Tutorial | ActiveAndroid: Android ORM base database |Getting Started with ActiveAndroid - Part1

ActiveAndrid :                                                                               
Active Android


ActiveAndroid is an ORM (object relational mapper) . Which allows you to save(insert)
and retrieve(read) SQLite database records without even writing a single SQL statement.
Each database record is wrapped neatly into a class with methods like save().
It is same a Java Hibernate. It also based on annotation like: @Column(name="Column")  for creating column and Table(name = "Table")  for creating table .

Getting started : 
A.Now here we are going to start integrating ActiveAndroid in your project.
    1. Download the ActiveAndroid library
    2. Now generate the ActiveAndroid.jar by executing ant in root folder
    3. If you are unable to generate the jar file then download it from here

 Now, we have ActiveAndroid.jar file.  Now, we can add it inside the "libs" folder of
Android Project.    

B. Configuring Android Project with ActiveAndroid :
    1. Open the AndroidManifest.xml file located at the root directory of your Android project.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.developer.solutions"
    android:versionCode="1"
    android:versionName="1.0" >
        <application
           android:name="com.activeandroid.app.Application"
           android:allowBackup="true"
           android:icon="@drawable/ic_launcher"
           android:label="@string/app_name"
           android:theme="@style/AppTheme" >
           <activity
             android:name=".MainActivity"
             android:label="@string/app_name"
             android:screenOrientation="landscape" >
             <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
          </activity>
        
         <meta-data android:name="AA_DB_NAME" android:value="Student.db" />
         <meta-data android:name="AA_DB_VERSION" android:value="1" />
        </application>
</manifest>


Note:  In your manifest.xml, if you are not using any Custom Application class then the application name points to the ActiveAndroid application class as we are doing above. But if you are using any Application levele custom class then your Custom Application class must extend com.activeandroid.app.Application instead of android.app.Application.

public class MyApplication extends com.activeandroid.app.Application { ...


And initialize and dispose ActiveAndroid in the Application class.

public class MyApplication extends com.activeandroid.app.Application {

    @Override
    public void onCreate() {
        super.onCreate();
        ActiveAndroid.initialize(this);
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        ActiveAndroid.dispose();
    }
}

Note : If you want to create your db in a specific location inside your Sd Card then change below line in manifest.xml

<meta-data android:name="AA_DB_NAME" android:value="/sdcard/Student.db" />

<meta-data android:name="AA_DB_VERSION" android:value="1" />

Here, we are creating our database file inside the sd card root folder.
So that we can easily import it in Sqlite Browser .

Tuesday 8 July 2014

Android Google Glass Configuration | Glass Development Kit | Android Google Glass Setup | Android Google Glass Development -Part1

Hello Friend ,
    This is my first blog on Android Google Glass . Lats month Google launches
some awesome feature like:                                                          
         1. Android L Developer Preview
         2. Android Wear SDK
         3. Android TV Preview SDK
         4. Google glass


Today, I am going to share my small tutorial on Google glass which helps you in 
in Configuring the Google glass development environment in Eclipse.

Glass Development Kit :  First you need GDK
The Glass Development Kit (GDK) is an add-on to the Android SDK that lets you build Glassware that runs directly on Glass. 

Steps to setup Google Glass Development :
    1.Get the Android 4.4.2 (API 19) SDK and Glass Development Kit Preview 
       add-on from the Android SDK Manager. see the image 


   2. On Glass, turn on USB debugging (Settings > Device Info > Turn on debug).
   3. Import some GDK samples with the File > New Project > Android Sample Project menu.
   4. When you're ready to create a project for your own Glassware, use these settings:
- Minimum and Target SDK Versions: 19 (There is only one Glass version, 
           so minimum and target SDK are the same.)
- Compile with: Glass Development Kit Developer Preview
- Theme: None (ADT and Android Studio usually assign a theme automatically,
           even if you specify no theme, so remove the android:theme property from your manifest after
           creating a project.)

For more Detail Check this link
                                  https://developers.google.com/glass/develop/gdk/quick-start


2. Android Google Glass Development -Part2 - (coming soon)


Hope, this will helps someone.
Enjoy Coding..... :)

 

Copyright @ 2013 Android Developers Blog.