How to create SQLite database in android
<p>I have created a Databasehelper.java class and in that class I have called SQLite database class and implemented all its methods and in the main class when I am calling this class instance and  when I am running the app It is showing "Unfortunately your app has stopped"</p>

<p>this is code </p>

<pre><code>package com.example.android.viewpager1;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by Vikas on 5/1/2016.
 */
public class Databasehelper extends SQLiteOpenHelper
{
public static final String DATABASE_NAME="Answers.db";
    public static final String TABLE_NAME="answers_table";
    public static final String COL_1="QUESTION_NO";
    public static final String COL_2="QUESTION_ANS";



    public Databasehelper(Context context)
    {
        super(context,DATABASE_NAME,null,1);
        SQLiteDatabase db= this.getWritableDatabase();
    }
    @Override
    public void onCreate(SQLiteDatabase db)
    {
    db.execSQL("create table" + TABLE_NAME+"(QUESTION_NO INTEGER PRIMARY KEY AUTOINCREMENT,QUESTION_ANS VARCHAR);");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
    {
      db.execSQL("DROP TABLE IF EXISTS"+TABLE_NAME);
      onCreate(db);
    }
}
</code></pre>

<p>and this is mainactivity.java</p>

<pre><code>package com.example.android.viewpager1;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.RadioButton;

import java.util.List;
import java.util.Vector;

public class MainActivity extends FragmentActivity
{
    Databasehelper mydb;

    private PagerAdapter mPagerAdapter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.viewpager_layout);
        initialisePaging();
        mydb=new Databasehelper(this);//here I am making DB 

    }
</code></pre>

<p>here I am making database but it is not running and  I also know that on the main thread or UI thread we should not create database or networking object and fro that we should use AsynTask class  but can anyone tell how to use it or any other solution 
 the logcat are </p>

<p>05-02 01:34:29.710 32328-32328/com.example.android.viewpager1 E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.viewpager1/com.example.android.viewpager1.MainActivity}: android.database.sqlite.SQLiteException: near "TABLEanswers_table": syntax error (code 1): , while compiling: CREATE TABLEanswers_table (QUESTION_NO INTEGER PRIMARY KEY AUTOINCREMENT,QUESTION_ANS VARCHAR);
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2141)
                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2166)
                                                                                    at android.app.ActivityThread.access$700(ActivityThread.java:141)
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1221)
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                    at android.os.Looper.loop(Looper.java:137)
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:5019)
                                                                                    at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                    at java.lang.reflect.Method.invoke(Method.java:511)
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:807)
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:574)
                                                                                    at dalvik.system.NativeStart.main(Native Method)
                                                                                 Caused by: android.database.sqlite.SQLiteException: near "TABLEanswers_table": syntax error (code 1): , while compiling: CREATE TABLEanswers_table (QUESTION_NO INTEGER PRIMARY KEY AUTOINCREMENT,QUESTION_ANS VARCHAR);
                                                                                    at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
                                                                                    at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:882)
                                                                                    at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:493)
                                                                                    at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
                                                                                    at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:58)
                                                                                    at android.database.sqlite.SQLiteStatement.(SQLiteStatement.java:31)
                                                                                    at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1663)
                                                                                    at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1594)
                                                                                    at com.example.android.viewpager1.Databasehelper.onCreate(Databasehelper.java:27)
                                                                                    at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
                                                                                    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
                                                                                    at com.example.android.viewpager1.Databasehelper.(Databasehelper.java:22)
                                                                                    at com.example.android.viewpager1.MainActivity.onCreate(MainActivity.java:24)
                                                                                    at android.app.Activity.performCreate(Activity.java:5056)
                                                                                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2099)
                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2166) 
                                                                                    at android.app.ActivityThread.access$700(ActivityThread.java:141) 
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1221) 
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                                    at android.os.Looper.loop(Looper.java:137) 
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:5019) 
                                                                                    at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                                    at java.lang.reflect.Method.invoke(Method.java:511) 
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:807) 
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:574) 
                                                                                    at dalvik.system.NativeStart.main(Native Method) </p>