Android Open Source - ARGiE D B Read Write






From Project

Back to project page ARGiE.

License

The source code is released under:

MIT License

If you think the Android project ARGiE listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package headrick.brandon.utilities;
/*  w w w . ja  v  a2s. c  om*/
import java.util.List;

import headrick.brandon.gamedata.GameState;
import headrick.brandon.models.QuestNode;

import android.content.Context;
import android.util.Log;

public class DBReadWrite{
  DatabaseHandler db;
  
  public DBReadWrite(Context context){
    db = new DatabaseHandler(context);
  }
  
  public void writeQuestData(){
    
    db.clearTable();
    
    for(QuestNode node : GameState.getInstance().getQuestNodes()){
      db.addQuestNode(new QuestNode(node.getTitle(), node.getPoint(), node.getScript(), node.getAnswer(), node.getRadialThreshold()));
    }
        // Inserting quests
        Log.d("Insert: ", "Inserting .."); 
         
        
        // Reading all quests
        Log.d("Reading: ", "Reading all quests.."); 
        List<QuestNode> questNodes = db.getAllQuestNodes();       
         
        for (QuestNode qn : questNodes) {
            String log = "Id: "+qn.getId()+" ,title: " + qn.getTitle() + " ,script: " + qn.getScript()
                + " ,latitude: " + qn.getLatitude() + " ,longitude: " + qn.getLongitude();
            // Writing quests to log
            Log.d("db output: ", "quests are: " + log);
        }
  }
  
}




Java Source Code List

android.UnusedStub.java
headrick.brandon.activities.AboutScreenActivity.java
headrick.brandon.activities.CreateGameActivity.java
headrick.brandon.activities.EditQuestActivity.java
headrick.brandon.activities.GameChooserActivity.java
headrick.brandon.activities.GameOptionsActivity.java
headrick.brandon.activities.RunGameActivity.java
headrick.brandon.activities.SettingsActivity.java
headrick.brandon.activities.SplashActivity.java
headrick.brandon.activities.TitleScreenActivity.java
headrick.brandon.gamedata.Constants.java
headrick.brandon.gamedata.GameSettingsState.java
headrick.brandon.gamedata.GameState.java
headrick.brandon.models.BaseGame.java
headrick.brandon.models.QuestNode.java
headrick.brandon.models.WaypointGame.java
headrick.brandon.utilities.DBReadWrite.java
headrick.brandon.utilities.DBTest.java
headrick.brandon.utilities.DatabaseHandler.java
headrick.brandon.utilities.MapHelper.java