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

    // Setup the list
    adapter = new IconAdapter<FileWrapper>(this, R.layout.line_list_item);
    ListView list = (ListView) findViewById(R.id.list);
    list.setAdapter(adapter);
    list.setOnItemClickListener(this);

    // Load Directory
    if (savedInstanceState != null) {
      backStack = savedInstanceState.getParcelableArrayList("BACKSTACK");
    }

    if (backStack == null || backStack.size() == 0) {
      backStack = new ArrayList<BackStackItem>();
      String startPath =
          (startDirectory == null || startDirectory.isEmpty())
              ? Environment.getExternalStorageDirectory().getPath()
              : startDirectory;
      backStack.add(new BackStackItem(startPath, false));
    }

    wrapFiles();
    this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
  }
  public void getTestCaseExecutionDetails() throws Exception {
    //                testCaseObj.setTestCaseId("001");
    TestCase testCaseObj = tmsManager.getTestCaseExecutionDetails("001");

    Activity activityObj = testCaseObj.getActivityObj();
    System.out.println(activityObj.getActivityId());
    System.out.println(testCaseObj.getTestCaseId());
    User userObj = testCaseObj.getUserObj();
    System.out.println(userObj.getUserId());
    System.out.println(testCaseObj.getActualDate());

    System.out.println(testCaseObj.getTestCaseStatus());
    System.out.println(testCaseObj.getComments());
    System.out.println(testCaseObj.getActualBehaviour());
  }
  public void getTestCase() throws Exception {

    TestCase testCaseObj = tmsManager.getTestCase("15");

    System.out.println(testCaseObj.getTestCaseId());
    System.out.println(testCaseObj.getTestCaseDescription());
    System.out.println(testCaseObj.getTestCasePhase());
    Project projectObj = testCaseObj.getProjectObj();
    System.out.println(projectObj.getProjectId());
    User userObj = testCaseObj.getUserObj();
    System.out.println(userObj.getUserId());
    Activity activityObj = testCaseObj.getActivityObj();
    System.out.println(activityObj.getActivityId());
    System.out.println(testCaseObj.getExpectedBehaviour());
  }
  /** Called when the activity is first created */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    Log.d(TAG, "LoaderActivity created");
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.content);

    // Instantiate custom adapter
    mAdapter = new LoaderAdapter();

    // Handle listview and assign adapter
    mListView = (ListView) findViewById(R.id.content_list_view);
    mListView.setAdapter(mAdapter);
    mListView.setVisibility(View.GONE);
    mListView.setOnItemLongClickListener(
        new AdapterView.OnItemLongClickListener() {
          public boolean onItemLongClick(AdapterView parent, View view, int position, long id) {
            selectItem(position);
            return true;
          }
        });

    mStatusLabel = (TextView) findViewById(R.id.content_status_label);
    mStatusLabel.setVisibility(View.VISIBLE);

    String userHash = NavigineApp.Settings.getString("user_hash", "");
    if (userHash.length() == 0) showUserHashDialog();
    else refreshMapList();
  }
Beispiel #5
0
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
      // We can read and write the media

      try {
        url = (String) getIntent().getExtras().get(Intent.EXTRA_TEXT) + "#view:list";
      } catch (Exception e) {
        url = "https://www.dropbox.com/s/8owsfcia59ko76i#view:list";
        // Used for testing if it's not opened from the dropox action menu
        // Obviously what needs to happen here is a message suggesting that the user use the dropbox
        // app, and a textbox in case they've got the url copied.
      }

      showDialog(
          PROGRESS_DIALOG); // Do the work in a separate thread so we can update the UI
                            // simultaneously.

    } else {
      // Can't write files, so show a message and quit.

    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // remove title
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_main_game);

    allDoneLevels = new ArrayList<>();
    AssetManager am = getResources().getAssets();

    final GameBoard boardView = (GameBoard) this.findViewById(R.id.gameBoard);
    final HowdyShadeView howdyShadeView = (HowdyShadeView) this.findViewById(R.id.howdyShadeView);
    final GlowingBoard glowingBoard = (GlowingBoard) this.findViewById(R.id.glowingBoard);
    final HowdyView howdyView = (HowdyView) this.findViewById(R.id.howdyView);
    this.game = new Game();

    boardView.setHowdyShadeView(howdyShadeView);
    boardView.setGlowingBoard(glowingBoard);
    boardView.setHowdyView(howdyView);
    boardView.setOnTouchListener(new BoardGameTouchListener(this));
  }
  // pressing back button finishes this activity
  public void onBackPressed() {
    // writeProgress(completed_downloads,total_files_to_download);
    downloadThread.requestStop();
    super.onBackPressed();

    // download_photos.this.finish();
  }
  public void getTestActivityEffort(String activityId) throws Exception {
    Effort effortObj = tmsManager.getTestActivityEffort(activityId);

    Activity activityObj = effortObj.getActivityObj();

    System.out.println(activityObj.getActivityId());
    User userObj = effortObj.getUserObj();

    System.out.println(userObj.getEmpNo());
    System.out.println(effortObj.getEffortDate());
    System.out.println(effortObj.getStartDate());
    System.out.println(effortObj.getEndDate());
    System.out.println(effortObj.getEffort());
    System.out.println(effortObj.getEffortDescription());
    System.out.println(effortObj.getEffortTimeStamp());
  }
  @Override
  protected void onStart() {
    final GameBoard boardView = (GameBoard) this.findViewById(R.id.gameBoard);
    SharedPreferences prefs = getPreferences(Context.MODE_PRIVATE);

    this.level = prefs.getInt("level", 0);
    String mapJson = prefs.getString("map", null);

    if (mapJson == null) {
      waitForNext = true;
    } else {
      this.game.initGame(mapJson);
      String howdyPosition = prefs.getString("howdy", null);

      if (howdyPosition != null) {
        this.game.setHowdyPosition(howdyPosition);
      }

      Toast.makeText(this, this.level + "", Toast.LENGTH_SHORT).show();
    }

    String allDoneLevelsString = prefs.getString("doneLevels", null);

    if (allDoneLevelsString != null) {
      allDoneLevels = new ArrayList<String>(Arrays.asList(allDoneLevelsString.split(",")));
    }

    super.onStart();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    //
    //	this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.main_login);

    mEtAccount = (EditText) findViewById(R.id.mainLoginEditAccount);
    mEtPassword = (EditText) findViewById(R.id.mainLoginEditPassword);
    mBtnLogin = (Button) findViewById(R.id.mainLoginBtn);
    mBtnRegister = (Button) findViewById(R.id.main_btn_register);

    /* this is to render the password edittext font to be default */
    mEtPassword.setTypeface(Typeface.DEFAULT);
    mEtPassword.setTransformationMethod(new PasswordTransformationMethod());

    mBtnLogin.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            MainActivity.this.tryLogin();
          }
        });

    mBtnRegister.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            Intent intent0 = new Intent(MainActivity.this, RegisterActivity.class);
            startActivity(intent0);
          }
        });
  }
  public void updateTestActivityEffort() throws Exception {

    activityObj.setActivityId("001");
    effortObj.setActivityObj(activityObj);

    effortObj.setEffortDescription("Well");
    System.out.println(tmsManager.updateTestActivityEffort(effortObj));
  }
Beispiel #12
0
  @Override
  public void onPause() {
    Log.d(TAG, "LoaderActivity paused");
    super.onPause();

    mTimerTask.cancel();
    mTimerTask = null;
  }
 /*-----------------------------------------ViewAssignment------------------------------------------*/
 public void getActivityAssignment() throws Exception {
   activityObj.setActivityId("1001");
   activityUserObj.setActivityObj(activityObj);
   activityObj = activityUserObj.getActivityObj();
   ActivityUser activityUserObj1 =
       tmsManager.getTestActivityAssignment(activityObj.getActivityId());
   activityObj = activityUserObj1.getActivityObj();
   System.out.println(activityObj.getActivityId());
   activityObj = activityUserObj1.getActivityObj();
   System.out.println("activity_id : " + activityObj.getActivityId());
   userObj = activityUserObj1.getUserObj();
   System.out.println("emp_no : " + userObj.getEmpNo());
   System.out.println("activity_effort : " + activityUserObj1.getActivityEffort());
   System.out.println("start_date : " + activityUserObj1.getStartDate());
   System.out.println("end_date : " + activityUserObj1.getEndDate());
   System.out.println("status : " + activityUserObj1.getStatus());
   System.out.println("percentage_completed : " + activityUserObj1.getPercentageCompleted());
   System.out.println("time_stamp : " + activityUserObj1.getTimeStamp());
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.xiph_copyright);

    TextView tv = (TextView) findViewById(R.id.text);
    tv.setText(getXiphCopyright());
    tv.setMovementMethod(new ScrollingMovementMethod());
  }
  public void createTestCase() throws Exception {
    testCaseObj.setTestCaseId("15");
    testCaseObj.setTestCaseDescription("this s Next testcase Description");
    testCaseObj.setTestCasePhase("normal ");

    Project projectObj = new Project();
    projectObj.setProjectId("2");
    testCaseObj.setProjectObj(projectObj);

    User userObj = new User();
    userObj.setUserId("123");
    testCaseObj.setUserObj(userObj);

    Activity activityObj = new Activity();
    activityObj.setActivityId("001");
    testCaseObj.setActivityObj(activityObj);

    testCaseObj.setExpectedBehaviour("Bad");
    System.out.println(tmsManager.createTestCase(testCaseObj));
  }
Beispiel #16
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.c19_sdcard);

    mEdit = (EditText) findViewById(R.id.edittext);

    String ext = Environment.getExternalStorageState();
    if (ext.equals(Environment.MEDIA_MOUNTED)) {
      mSdPath = Environment.getExternalStorageDirectory().getAbsolutePath();
    } else {
      mSdPath = Environment.MEDIA_UNMOUNTED;
    }
  }
  @Override
  public void onWindowFocusChanged(boolean hasFocus) {
    // TODO: Implement this method
    super.onWindowFocusChanged(hasFocus);

    if (waitForNext) {
      this.nextLevel();
      waitForNext = false;
    }

    ((GameBoard) findViewById(R.id.gameBoard)).setGame(this.game);
    findViewById(R.id.gameBoard).invalidate();
    ((GameBoard) findViewById(R.id.gameBoard)).getHowdyShadeView().invalidate();
  }
 public void updateActivityAssignment() throws Exception {
   activityObj.setActivityId("1001");
   activityUserObj.setActivityObj(activityObj);
   userObj.setEmpNo("002");
   activityUserObj.setUserObj(userObj);
   activityUserObj.setActivityEffort(0);
   Date startDate = new Date(2010, 05, 07);
   activityUserObj.setStartDate(startDate);
   Date endDate = new Date(2010, 05, 10);
   activityUserObj.setEndDate(endDate);
   activityUserObj.setStatus(0);
   activityUserObj.setPercentageCompleted(0);
   activityUserObj.setTimeStamp("null");
   System.out.println(tmsManager.updateTestActivityAssignment(activityUserObj));
 }
Beispiel #19
0
  @Override
  public void onResume() {
    Log.d(TAG, "LoaderActivity resumed");
    super.onResume();

    // Starting interface updates
    mTimerTask =
        new TimerTask() {
          @Override
          public void run() {
            mHandler.post(mRunnable);
          }
        };
    mTimer.schedule(mTimerTask, 100, 100);
  }
Beispiel #20
0
  @Override
  public void onResume() {
    Log.i(LOG_FILE_NAME, "resume");
    if (checkLaunchState(LaunchState.GeckoRunning)) GeckoAppShell.onResume();
    // After an onPause, the activity is back in the foreground.
    // Undo whatever we did in onPause.
    super.onResume();

    // Just in case. Normally we start in onNewIntent
    if (checkLaunchState(LaunchState.PreLaunch) || checkLaunchState(LaunchState.Launching))
      onNewIntent(getIntent());

    registerReceiver(mConnectivityReceiver, mConnectivityFilter);
    GeckoNetworkManager.getInstance().start();
    GeckoScreenOrientationListener.getInstance().start();
  }
  public void addTestCaseExecutionDetails() throws Exception {

    activityObj.setActivityId("001");
    testCaseObj.setActivityObj(activityObj);

    testCaseObj.setTestCaseId("001");

    userObj.setUserId("12");
    testCaseObj.setUserObj(userObj);

    testCaseObj.setActualDate(new Date(1970, 01, 01));
    testCaseObj.setTestCaseStatus("complete");
    testCaseObj.setComments("better");
    testCaseObj.setActualBehaviour("got value");

    System.out.println(tmsManager.addTestCaseExecutionDetails(testCaseObj));
  }
Beispiel #22
0
  @Override
  public void onPause() {
    Log.i(LOG_FILE_NAME, "pause");
    GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_PAUSING));
    // The user is navigating away from this activity, but nothing
    // has come to the foreground yet; for Gecko, we may want to
    // stop repainting, for example.

    // Whatever we do here should be fast, because we're blocking
    // the next activity from showing up until we finish.

    // onPause will be followed by either onResume or onStop.
    super.onPause();

    unregisterReceiver(mConnectivityReceiver);
    GeckoNetworkManager.getInstance().stop();
    GeckoScreenOrientationListener.getInstance().stop();
  }
Beispiel #23
0
  @Override
  public void onStop() {
    Log.i(LOG_FILE_NAME, "stop");
    // We're about to be stopped, potentially in preparation for
    // being destroyed.  We're killable after this point -- as I
    // understand it, in extreme cases the process can be terminated
    // without going through onDestroy.
    //
    // We might also get an onRestart after this; not sure what
    // that would mean for Gecko if we were to kill it here.
    // Instead, what we should do here is save prefs, session,
    // etc., and generally mark the profile as 'clean', and then
    // dirty it again if we get an onResume.

    GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_STOPPING));
    super.onStop();
    GeckoAppShell.putChildInBackground();
  }
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.receiver);

    final Button cancelbtn = (Button) findViewById(R.id.ButtonCancel);
    // cancelbtn.setEnabled(false);
    cancelbtn.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            // streamtask.cancel(true);
            finish();
          }
        });

    try {
      Intent intent = getIntent();
      String action = intent.getAction();
      String type = intent.getType();

      if ((!(Intent.ACTION_SEND.equals(action))) || (type == null)) {
        throw new RuntimeException("Unknown intent action or type");
      }

      if (!("text/plain".equals(type))) {
        throw new RuntimeException("Type is not text/plain");
      }

      String extra = intent.getStringExtra(Intent.EXTRA_TEXT);
      if (extra == null) {
        throw new RuntimeException("Cannot get shared text");
      }

      final DownloadStreamTask streamtask = new DownloadStreamTask(this);

      //	Once created, a task is executed very simply:
      streamtask.execute(extra);

    } catch (Exception e) {
      Toast.makeText(this, e.toString(), Toast.LENGTH_LONG).show();
    }
  }
Beispiel #25
0
  @Override
  public void onDestroy() {
    Log.i(LOG_FILE_NAME, "destroy");

    // Tell Gecko to shutting down; we'll end up calling System.exit()
    // in onXreExit.
    if (isFinishing()) GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_SHUTDOWN));

    if (SmsManager.getInstance() != null) {
      SmsManager.getInstance().stop();
      if (isFinishing()) SmsManager.getInstance().shutdown();
    }

    GeckoNetworkManager.getInstance().stop();
    GeckoScreenOrientationListener.getInstance().stop();

    super.onDestroy();

    unregisterReceiver(mBatteryReceiver);
  }
  public void addTestActivityEffort() throws Exception {

    activityObj.setActivityId("001");
    effortObj.setActivityObj(activityObj);
    userObj.setEmpNo("1");
    effortObj.setUserObj(userObj);

    effortObj.setEffortDate(new Date(2010, 10, 01));

    effortObj.setStartDate(new Date(2010, 10, 02));

    effortObj.setEndDate(new Date(2010, 11, 01));

    effortObj.setEffort(4);

    effortObj.setEffortDescription("I dont Know");

    effortObj.setEffortTimeStamp("2010-11-17");

    System.out.println(tmsManager.addTestActivityEffort(effortObj));
  }
  @Override
  protected void onStop() {
    SharedPreferences prefs = getPreferences(Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = prefs.edit();

    editor.putInt("level", this.level);
    editor.putString("map", game.getLabyrinth().getJsonMap());
    editor.putString("howdy", game.getJsonHowdy());

    String allDoneLevelsString = "";

    for (String s : allDoneLevels) {
      allDoneLevelsString += s + ",";
    }

    if (allDoneLevelsString.length() > 0) {
      editor.putString(
          "doneLevels", allDoneLevelsString.substring(0, allDoneLevelsString.length() - 1));
    }

    editor.commit();

    super.onStop();
  }
  /*---------------------------------------------------VieTestPhase----------------------------*/
  public void getTestActivity() throws Exception {
    activityObj.setActivityId("1001");

    Activity activityObj1 = tmsManager.getTestActivity(activityObj.getActivityId());
    System.out.println("activity_id:  " + activityObj1.getActivityId());

    TestPhase testphaseObj1 = activityObj1.getTestPhaseObj();
    System.out.println("phase_id:  " + testphaseObj1.getPhaseId());
    System.out.println("activity_name: " + activityObj1.getActivityName());
    System.out.println("activity_description: " + activityObj1.getActivityDescription());
    System.out.println("activity_type: " + activityObj1.getActivityType());
    System.out.println("start_date: " + activityObj1.getStartDate());
    System.out.println("end_date: " + activityObj1.getEndDate());
    System.out.println("activity_effort: " + activityObj1.getActivityEffort());
    System.out.println("status: " + activityObj1.getStatus());
    userObj = activityObj.getUserObj();
    System.out.println("emp_no: " + userObj.getEmpNo());
    System.out.println("time_stamp: " + activityObj1.getTimeStamp());
  }
  /* ----------------------------------------------Create Test activity-------------------------------------*/
  public void createTestActivity() throws Exception {

    activityObj.setActivityId("1001");
    testPhaseObj.setPhaseId("102");
    activityObj.setTestPhaseObj(testPhaseObj);
    activityObj.setActivityName("second activity test");
    activityObj.setActivityDescription("activity execution  ");
    activityObj.setActivityType(0);
    Date startDate = new Date(2010, 05, 07);
    activityObj.setStartDate(startDate);
    Date endDate = new Date(2010, 06, 10);
    activityObj.setEndDate(endDate);
    activityObj.setActivityEffort(20);
    activityObj.setStatus(1);
    userObj.setEmpNo("001");
    activityObj.setUserObj(userObj);
    java.sql.Date date = java.sql.Date.valueOf("2011-03-28");
    activityObj.setTimeStamp(date);
    System.out.println(tmsManager.createTestActivity(activityObj));
  }
 /*---------------------------------DeleteTestActivity-----------------------------------------*/
 public void deleteTestActivity() throws Exception {
   activityObj.setActivityId("1001");
   System.out.println(tmsManager.deleteTestActivity(activityObj.getActivityId()));
 }