Top Menu

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Friday, 10 July 2015

Create Wordpress Website on a localhost using XAMPP

Hi Friends,

I believe this blog help you make it very simple to create your own website on Wordpress.
So without wasting much time lets start creating it,

1. Firstly download XAMPP.

    XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is           really very easy to install and to use - just download, extract and start.
    http://www.apachefriends.org/en/xampp

   
2. After completion of XAMPP download lets run the "XAMPP Control Panel"
    Start 'Apache' & 'MySQL'

3. Now download Wordpress from http://wordpress.org/download/

4. Extract the zip folder of wordpress in C:\xampp\htdocs\wordpress location

5. Click on the admin button on 'MySQL' from XAMPP control panel which opens http://localhost/phpmyadmin/

6. Create a new database by selecting new on left menu drawer and named it 'wordpress'

7. Now go to wordpress folder located in htdocs (C:\xampp\htdocs\wordpress) and open in Notepad/Notepad++ and change the database name default to 'wordpress' as shown below:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

and save as "wp-config.txt" in the same folder (C:\xampp\htdocs\wordpress)

8. Now go to webpage and open http://localhost/wordpress and select 'Create configure file'
and configure the wordpress page as mentioned below:

Database username - wordpress
User Name - root (default username for MySQL)
Password -  (can left blank)
Database Host - (left as it is)
Table Prefix - (left as it is)

9. Now select "Run the install" and you can see the Welcome page of Wordpress. Now you can create worpress page as you want (eg. shown below:)

Set Title - Test
Username - (enter whatever you need)
Password -
Confirm Password -
Your Email -

Make sure the Privacy should be checked.

And select 'Install WordPress'.
Now you can start with WordPress login details.

Thats it!

Now you can see your WordPress website by selecting test - View site from top menu bar.


Congratulations!!
You have created your own website. Enjoy!!!

Thanks




Read more...

Friday, 1 May 2015

Shake Animation Example

1.) Create a new project by File-> New -> Android Project name it ShakeAnimationExample.
2.) You will see some default code into your main.xml, strings.xml and android manifest file.
3.) Write following into main.xml file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical"
    android:padding="10dip"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    
    <TextView 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dip"
        android:text="Please enter your password:"
    />
    
    <EditText android:id="@+id/pw"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:singleLine="true"
        android:password="true"
    />

    <Button android:id="@+id/login"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Login"
    />

</LinearLayout>
4.) Create and Write following into anim/shake.xml:
<translate xmlns:android="http://schemas.android.com/apk/res/android"
 android:fromXDelta="0" android:toXDelta="10" android:duration="1000"
 android:interpolator="@anim/cycle_7" />
5.) Create and Write following into anim/cycle_7.xml:
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" />
Steps:
1.) Create a project named ShakeAnimationExample and set the information as stated in the image.
2.) Open ShakeAnimationExample.java file and write following code there:
package com.example.ShakeAnimation;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Toast;

public class ShakeAnimation extends Activity implements View.OnClickListener {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        View loginButton = findViewById(R.id.login);
        loginButton.setOnClickListener(this);
    }

    public void onClick(View v) {
        Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
        findViewById(R.id.pw).startAnimation(shake);
        Toast.makeText(this, "Wrong Password", Toast.LENGTH_SHORT).show();
    }

}       
3.) Compile and build the project.
4.) Run on simulator or phone for the output.
Read more...

Thursday, 16 April 2015

Android character by character display text animation

This may not be the most elegant solution, but the simplest is probably a quick subclass of TextView with a Handler that updates the text every so often until the complete sequence is displayed:
 
public class Typewriter extends TextView {

    private CharSequence mText;
    private int mIndex;
    private long mDelay = 500; //Default 500ms delay


    public Typewriter(Context context) {
        super(context);
    }

    public Typewriter(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    private Handler mHandler = new Handler();
    private Runnable characterAdder = new Runnable() {
        @Override
        public void run() {
            setText(mText.subSequence(0, mIndex++));
            if(mIndex <= mText.length()) {
                mHandler.postDelayed(characterAdder, mDelay);
            }
        }
    };

    public void animateText(CharSequence text) {
        mText = text;
        mIndex = 0;

        setText("");
        mHandler.removeCallbacks(characterAdder);
        mHandler.postDelayed(characterAdder, mDelay);
    }

    public void setCharacterDelay(long millis) {
        mDelay = millis;
    }
}
You can then use this in an Activity like so:


public class MyActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Typewriter writer = new Typewriter(this);
        setContentView(writer);

        //Add a character every 150ms
        writer.setCharacterDelay(150);
        writer.animateText("Sample String");
    }
}
  
If you want some animation effects with each letter added, perhaps look at subclassing TextSwitcher instead.
Hope that Helps!

There are many ways to show the characters using "string.xml".
/* One method to get the characters from String*/
writer.animateText(getString(R.string.poem_one)); //get the text from string.xml
       
/* One more method to retrieve the character from String*/
CharSequence  cs = getText(R.string.poem_one);
writer.animateText(cs);
Read more...

Wednesday, 15 April 2015

How to create Ticker (marquee text)

If you want marquee text in your application, here is the simplest example.
In your xml-layout file, add this to your TextView
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
and in your code to start animation:
TextView tv = (TextView) findViewById(R.id.tv);
tv.setSelected(true);
 
Via the API:
 
Read more...

Sunday, 1 March 2015

How to set string array from string.xml in listview

If you want the values of string array to listview.
private String [] fiilliste={"A","Ağlamak","Almak","B","Bulmak"};
ArrayAdapter<String> adapter;
adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, fiilliste);
vlist.setAdapter(adapter);
And wanna use xml file for string-array. 
<?xml version="1.0" encoding="utf-8"?>
<resources>

     <string-array name="fi">
        <item>A</item>
        <item>Almak</item>
        <item>Anlamak</item>
        <item>Anlasmak</item>
        <item>Anlatmak</item>
        <item>Ayrilmak</item>
    </string-array>

</resources>
So you just have to do like this:
String [] fiilliste;
ArrayAdapter<String> adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.verbs);
    fiilliste = getResources().getStringArray(R.array.fi); 
    // move this in onCreate
Read more...

Wednesday, 18 February 2015

Open any Website into Android Application

If you want to open any website in your custom view of Android application,
Here are the few steps to get it.

1. Create a new Project
2. Modify the activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:ignore="MergeRootFrame">

    <WebView
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </WebView>
   
</FrameLayout>
3. Now open the MainActivity.java class
package com.example.webviewdemo;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;

public class MainActivity extends Activity{
    private WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        webView = (WebView)findViewById(R.id.webview);

        // Enable Javascript
        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webView.loadUrl("http://www.fashionandyou.com/");

        // Stop local links and redirects from opening in browser instead of WebView
        webView.setWebViewClient(new MyWebViewClient());
    }

    @Override
    public void onBackPressed() {
        if (webView.canGoBack()){
            webView.goBack();
        }else {
            super.onBackPressed();
        }
    }
}
4. Now create a new class MyWebViewClient.java
package com.example.webviewdemo;

import android.content.Intent;
import android.net.Uri;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MyWebViewClient extends WebViewClient{
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if(Uri.parse(url).getHost().endsWith("fashionandyou.com")){
            return false;
        }
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
        view.getContext().startActivity(intent);
        return true;
    }
}
5. Now add the INTERNET permission in AndroidMenifest.xml

    <uses-permission android:name="android.permission.INTERNET"/>
Read more...

Monday, 9 February 2015

Show Hindi font (custom font) text in Android

In your custom apps you will most probably want to use your own font. This post will show you how you can do so. This is a simple example... create a folder in the root of your project called assets/fonts/ then paste the TTF font file (in this case Devanagri.TTF). Then, if you want to apply that font to, say a TextView, do the following
TextView tv = (TextView ) findViewById(R.id.textView);
Typeface face=Typeface.createFromAsset(getAssets(),"fonts/hindi.ttf");
tv.setTypeface(face);
tv.setText("Hindi font");
Read more...