// Path: source-code/app/src/main/java/org/buildmlearn/toolkit/constant/Constants.java
// public class
// Constants {
// 
//     public final static String BUILD_M_LEARN_PATH = "/BuildmLearn/";
//     public final static String UNZIP = BUILD_M_LEARN_PATH + "unzipped/";
//     public final static String APK_DIR = BUILD_M_LEARN_PATH + "apk/";
//     public final static String SAVED_DIR = BUILD_M_LEARN_PATH + "saved/";
//     public final static String DRAFT_DIR = BUILD_M_LEARN_PATH + "draft/";
//     public final static String TEMPLATE_ID = "TEMPLATE_ID";
//     public final static String TEMPLATE_OBJECT = "TEMPLATE_OBJECT";
//     public final static String SIMULATOR_FILE_PATH = "SIMULATOR_FILE_PATH";
//     public final static String PROJECT_FILE_PATH = "PROJECT_FILE_PATH";
//     public final static String START_ACTIVITY = "START_ACTIVITY";
//     public final static String START_FRAGMENT = "START_FRAGMENT";
// 
// 
// }


import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import com.crashlytics.android.Crashlytics;
import org.buildmlearn.toolkit.R;
import org.buildmlearn.toolkit.constant.Constants;
import io.fabric.sdk.android.Fabric;

        findViewById(R.id.focus_thief).clearFocus();
        Animation anim_bounceinup=AnimationUtils.loadAnimation(getBaseContext(),R.anim.bounceinup);
        name = (EditText) findViewById(R.id.first_name);
        name.startAnimation(anim_bounceinup);
        name.setOnKeyListener(new View.OnKeyListener() {
            @Override
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                if (event.getAction() == KeyEvent.ACTION_DOWN) {
                    switch (keyCode) {
                        case KeyEvent.KEYCODE_DPAD_CENTER:
                        case KeyEvent.KEYCODE_ENTER:

                            if (name.getText().toString().equals("")) {
                                name.setError(getApplicationContext().getResources().getString(R.string.enter_name));
                                return false;
                            }
                            else if(!Character.isLetterOrDigit(name.getText().toString().charAt(0)))
                            {
                                name.setError(getApplicationContext().getResources().getString(R.string.valid_msg));
                                return false;
                            }


                            SharedPreferences.Editor editor = prefs.edit();

                            editor.putString(getString(R.string.key_user_name), name.getText().toString());
                            editor.putBoolean(FIRST_RUN, true);
                            editor.apply();
                            Intent intent = new Intent(getApplicationContext(), TutorialActivity.class);
// Path: source-code/app/src/main/java/org/buildmlearn/toolkit/constant/Constants.java
// public class
// Constants {
// 
//     public final static String BUILD_M_LEARN_PATH = "/BuildmLearn/";
//     public final static String UNZIP = BUILD_M_LEARN_PATH + "unzipped/";
//     public final static String APK_DIR = BUILD_M_LEARN_PATH + "apk/";
//     public final static String SAVED_DIR = BUILD_M_LEARN_PATH + "saved/";
//     public final static String DRAFT_DIR = BUILD_M_LEARN_PATH + "draft/";
//     public final static String TEMPLATE_ID = "TEMPLATE_ID";
//     public final static String TEMPLATE_OBJECT = "TEMPLATE_OBJECT";
//     public final static String SIMULATOR_FILE_PATH = "SIMULATOR_FILE_PATH";
//     public final static String PROJECT_FILE_PATH = "PROJECT_FILE_PATH";
//     public final static String START_ACTIVITY = "START_ACTIVITY";
//     public final static String START_FRAGMENT = "START_FRAGMENT";
// 
// 
// }


// Path: source-code/app/src/main/java/org/buildmlearn/toolkit/activity/FirstRunActivity.java
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import com.crashlytics.android.Crashlytics;
import org.buildmlearn.toolkit.R;
import org.buildmlearn.toolkit.constant.Constants;
import io.fabric.sdk.android.Fabric;


        findViewById(R.id.focus_thief).clearFocus();
        Animation anim_bounceinup=AnimationUtils.loadAnimation(getBaseContext(),R.anim.bounceinup);
        name = (EditText) findViewById(R.id.first_name);
        name.startAnimation(anim_bounceinup);
        name.setOnKeyListener(new View.OnKeyListener() {
            @Override
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                if (event.getAction() == KeyEvent.ACTION_DOWN) {
                    switch (keyCode) {
                        case KeyEvent.KEYCODE_DPAD_CENTER:
                        case KeyEvent.KEYCODE_ENTER:

                            if (name.getText().toString().equals("")) {
                                name.setError(getApplicationContext().getResources().getString(R.string.enter_name));
                                return false;
                            }
                            else if(!Character.isLetterOrDigit(name.getText().toString().charAt(0)))
                            {
                                name.setError(getApplicationContext().getResources().getString(R.string.valid_msg));
                                return false;
                            }


                            SharedPreferences.Editor editor = prefs.edit();

                            editor.putString(getString(R.string.key_user_name), name.getText().toString());
                            editor.putBoolean(FIRST_RUN, true);
                            editor.apply();
                            Intent intent = new Intent(getApplicationContext(), TutorialActivity.class);
                            intent.putExtra(Constants.START_ACTIVITY, true);