Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6601525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:45:51+00:00 2026-05-25T18:45:51+00:00

if i use sqlite3.exe the text is returned from my tables correctly however within

  • 0

if i use sqlite3.exe the text is returned from my tables correctly
however within android i get squares where the spaces are

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import android.widget.TextView;

public class SqlLiteHelper extends SQLiteOpenHelper {

    private static final String DB_NAME = "movelist";

    private static String DB_PATH = "/data/data/ packagename /databases/";

    private Context context;

    private SQLiteDatabase DB;

    public SqlLiteHelper(Context context) {
        super(context, DB_NAME, null, 1);
        this.context = context;
    }

    public List<TextView> getTextViews(String charName, int consoleSwitch,
            int textSize, String moveTypeSource) {

        List<TextView> moveList = new ArrayList<TextView>();
        String movesSql = new String();
        String tableName = new String();

        if (moveTypeSource.equals("Grappling")) {
            tableName = "SevenTypedMoves";
            movesSql = "SELECT moveCommand, moveName, moveType, moveDmg, moveEscape, moveProperties FROM "
                    + tableName
                    + " WHERE character_name = '"
                    + charName
                    + "' and moveArt = '" + moveTypeSource + "'";
        }
        DB = getWritableDatabase();

        Cursor movesCursor = DB.rawQuery(movesSql, null);

        if (movesCursor.moveToFirst()) {
            do {
                String moveCommand = movesCursor.getString(movesCursor
                        .getColumnIndex("moveCommand"));
                String moveName = movesCursor.getString(movesCursor
                        .getColumnIndex("moveName"));
                String moveType = movesCursor.getString(movesCursor
                        .getColumnIndex("moveType"));
                String moveDmg = movesCursor.getString(movesCursor
                        .getColumnIndex("moveDmg"));
                String moveEscape = movesCursor.getString(movesCursor
                        .getColumnIndex("moveEscape"));
                String moveProperties = movesCursor.getString(movesCursor
                        .getColumnIndex("moveProperties"));
                Log.e("movename: ", moveName);

                if (consoleSwitch == 1) {
                    // PS3
                    moveCommand = moveCommand.replaceAll("1", "(͹)");
                    moveCommand = moveCommand.replaceAll("2", "(▲)");
                    moveCommand = moveCommand.replaceAll("3", "(X)");
                    moveCommand = moveCommand.replaceAll("4", "(O)");
                    moveEscape = moveEscape.replaceAll("1", "(͹)");
                    moveEscape = moveEscape.replaceAll("2", "(▲)");
                    moveEscape = moveEscape.replaceAll("3", "(X)");
                    moveEscape = moveEscape.replaceAll("4", "(O)");
                } else if (consoleSwitch == 2) {
                    // XBOX
                    moveCommand = moveCommand.replaceAll("1", "(X)");
                    moveCommand = moveCommand.replaceAll("2", "(Y)");
                    moveCommand = moveCommand.replaceAll("3", "(A)");
                    moveCommand = moveCommand.replaceAll("4", "(B)");
                    moveEscape = moveEscape.replaceAll("1", "(X)");
                    moveEscape = moveEscape.replaceAll("2", "(Y)");
                    moveEscape = moveEscape.replaceAll("3", "(A)");
                    moveEscape = moveEscape.replaceAll("4", "(B)");
                }

                String s = "|" + moveName + ": " + moveCommand
                        + " |Positioning: " + moveType + " |Escape: "
                        + moveEscape + " |Properties: " + moveProperties;

                TextView Move = new TextView(context);
                Move.setText(s);
                if (textSize == 1) {
                    Move.setTextSize(20);
                } else {
                }
                moveList.add(Move);
            } while (movesCursor.moveToNext());
        }
        movesCursor.close();

        String footnoteSql = "SELECT footnoteText FROM footnote WHERE charname = '"
                + charName + "' and movesType = '" + moveTypeSource + "'";
        Cursor footnoteCursor = DB.rawQuery(footnoteSql, null);
        if (footnoteCursor.moveToFirst()) {
            do {
                TextView footnoteMove = new TextView(context);
                String footnoteBodyText = footnoteCursor
                        .getString(footnoteCursor
                                .getColumnIndex("footnoteText"));
                String footnoteText = String.format("FOOTNOTES: \n%s",
                        footnoteBodyText);
                footnoteMove.setText(footnoteText);
                moveList.add(footnoteMove);
            } while (footnoteCursor.moveToNext());
        }
        footnoteCursor.close();

        DB.close();
        return moveList;
    }

    public List<String> getTypes() {
        List<String> types = new ArrayList<String>();
        String footnoteSql = "SELECT footnoteText FROM footnote WHERE charname = '"
                + charName + "' and movesType = '" + moveTypeSource + "'";
        Cursor footnoteCursor = DB.rawQuery(footnoteSql, null);
        return types;
    }

    public void createDataBase() throws IOException {

        boolean dbExist = checkDataBase();

        if (dbExist) {
            // do nothing - database already exist
        } else {
            this.getReadableDatabase();
            try {
                copyDataBase();
            } catch (IOException e) {
                Log.e("Error copying database: ", e.toString());
            }
        }
    }

    private boolean checkDataBase() {

        SQLiteDatabase checkDB = null;

        try {
            String myPath = DB_PATH + DB_NAME;
            checkDB = SQLiteDatabase.openDatabase(myPath, null,
                    SQLiteDatabase.OPEN_READONLY);

        } catch (SQLiteException e) {

            // database does't exist yet.

        }

        if (checkDB != null) {

            checkDB.close();

        }

        return checkDB != null ? true : false;
    }

    private void copyDataBase() throws IOException {

        InputStream myInput = context.getAssets().open(DB_NAME);
        String outFileName = DB_PATH + DB_NAME;
        OutputStream myOutput = new FileOutputStream(outFileName);
        // transfer bytes from the inputfile to the outputfile
        byte[] buffer = new byte[1024];
        int length;
        while ((length = myInput.read(buffer)) > 0) {
            myOutput.write(buffer, 0, length);
        }

        // Close the streams
        myOutput.flush();
        myOutput.close();
        myInput.close();

    }

    public void openDataBase() throws SQLException {
        String myPath = DB_PATH + DB_NAME;
        DB = SQLiteDatabase.openDatabase(myPath, null,
                SQLiteDatabase.OPEN_READONLY);
    }

    @Override
    public synchronized void close() {

        if (DB != null)
            DB.close();

        super.close();

    }

    @Override
    public void onCreate(SQLiteDatabase db) {

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }

}

RETURNS:
sqlite:SQLITE RETURN

logcat and emulator screen: logcatreturns

just wanted to add that the string manipulation being done with .replaceall isnt on the name field at all. and from the output on the screen i can tell its working. PLUS the logcat pic u see was a Log.e placed before all of the manipulation code

also that the db is premade and i get NO errors in logcat when it displays.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:45:51+00:00Added an answer on May 25, 2026 at 6:45 pm

    i fixed this but forgot the fix. this code does work properly though:

    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.ArrayList;
    import java.util.List;
    
    import android.content.Context;
    import android.database.Cursor;
    import android.database.sqlite.SQLiteDatabase;
    import android.database.sqlite.SQLiteOpenHelper;
    import android.widget.TextView;
    
    public class SqlLiteHelper extends SQLiteOpenHelper {
    
        private static final String DB_NAME = "tekkenmovelist";
    
        private static String DB_PATH = "/<path deleted>/";
    
        private Context context;
    
        private SQLiteDatabase DB;
    
        public SqlLiteHelper(Context context) {
            super(context, DB_NAME, null, 1);
            this.context = context;
        }
    
        public List<TextView> getTextViews(String charName, int consoleSwitch,
                int textSize, String moveCatagory, int filterEscape, int filterDmg,
                String catMask) {
    
            List<TextView> moveList = new ArrayList<TextView>();
            String movesSql = new String();
    
            movesSql = "SELECT * FROM Moves" + " WHERE charName = '" + charName
                    + "' and moveCatagory = '" + moveCatagory + "'";
    
            DB = getWritableDatabase();
    
            String textviewText = new String();
            Cursor movesCursor = DB.rawQuery(movesSql, null);
    
            if (movesCursor.moveToFirst()) {
                do {
                    String moveId = movesCursor.getString(movesCursor
                            .getColumnIndex("_id"));
    
                    String moveCommand = new String("");
                    if (!movesCursor.isNull(movesCursor.getColumnIndex("moveCommand"))){
    
                    moveCommand = movesCursor.getString(movesCursor
                            .getColumnIndex("moveCommand"));
                    }
    
    
                    String moveName = new String("");
                    if (!movesCursor.isNull(movesCursor
                            .getColumnIndex("moveName"))) {
                    moveName = movesCursor.getString(movesCursor
                            .getColumnIndex("moveName"));
                    }
    
                    String moveType = new String("");
                    if (!movesCursor.isNull(movesCursor
                            .getColumnIndex("moveType"))) {
                    moveType = movesCursor.getString(movesCursor
                            .getColumnIndex("moveType"));
                    }
    
                    String moveDmg = new String("");
                    if (!movesCursor.isNull(movesCursor
                            .getColumnIndex("moveDmg"))) {
                    moveDmg = movesCursor.getString(movesCursor
                            .getColumnIndex("moveDmg"));
                    }
    
                    String moveEscape = new String("");
                    if (!movesCursor.isNull(movesCursor
                            .getColumnIndex("moveEscape"))) {
                    moveEscape = movesCursor.getString(movesCursor
                            .getColumnIndex("moveEscape"));
                    }
    
                    String moveProperties = new String("");
                    if (!movesCursor.isNull(movesCursor
                            .getColumnIndex("moveProperties"))) {
                    moveProperties = movesCursor.getString(movesCursor
                            .getColumnIndex("moveProperties"));
                    }
    
                    String moveStance = new String("");
                    if (!movesCursor.isNull(movesCursor
                            .getColumnIndex("moveStance"))) {
                        moveStance = movesCursor.getString(movesCursor
                                .getColumnIndex("moveStance"));
                    }
    
                    String moveHitRange = new String("");
                    if (!movesCursor.isNull(movesCursor
                            .getColumnIndex("moveHitRange"))) {
                        moveHitRange = movesCursor.getString(movesCursor
                                .getColumnIndex("moveHitRange"));
                    }
    
                    String moveHits = new String("");
                    if (!movesCursor.isNull(movesCursor.getColumnIndex("moveHits"))) {
                        moveHits = movesCursor.getString(movesCursor
                                .getColumnIndex("moveHits"));
                    }
    
                    if (consoleSwitch == 1) {
                        // PS3
                        moveCommand = moveCommand.replaceAll("1", "(͹)");
                        moveCommand = moveCommand.replaceAll("2", "(Δ)");
                        moveCommand = moveCommand.replaceAll("3", "(X)");
                        moveCommand = moveCommand.replaceAll("4", "(O)");
                        moveEscape = moveEscape.replaceAll("1", "(͹)");
                        moveEscape = moveEscape.replaceAll("2", "(Δ)");
                        moveEscape = moveEscape.replaceAll("3", "(X)");
                        moveEscape = moveEscape.replaceAll("4", "(O)");
    
                    } else if (consoleSwitch == 0) {
                        // XBOX
                        moveCommand = moveCommand.replaceAll("1", "(X)");
                        moveCommand = moveCommand.replaceAll("2", "(Y)");
                        moveCommand = moveCommand.replaceAll("3", "(A)");
                        moveCommand = moveCommand.replaceAll("4", "(B)");
                        moveEscape = moveEscape.replaceAll("1", "(X)");
                        moveEscape = moveEscape.replaceAll("2", "(Y)");
                        moveEscape = moveEscape.replaceAll("3", "(A)");
                        moveEscape = moveEscape.replaceAll("4", "(B)");
                    }
    
                        if (!moveCommand.equals("")) {
                            textviewText = "|" + moveCommand;
                        }
                        if (!moveName.equals("")) {
                            textviewText = textviewText + " |Name: " + moveName;
                        }
                        if (!moveHits.equals("")) {
                            textviewText = textviewText + " |Hits: " + moveHits;
                        }
                        if (!moveType.equals("")) {
                            textviewText = textviewText + " |Type: " + moveType;
                        }
                        if (!moveStance.equals("")) {
                            textviewText = textviewText + " |Stance: " + moveStance;
                        }
                        if (!moveDmg.equals("") && filterDmg != 1) {
                            textviewText = textviewText + " |Dmg: " + moveDmg;
                        }
                        if (!moveHitRange.equals("")) {
                            textviewText = textviewText + " |Hit Range: "+ moveHitRange;
                        }
                        if (!moveEscape.equals("") && !moveEscape.equals("None")
                                && filterEscape != 1) {
                            textviewText = textviewText + " |Escape: " + moveEscape;
                        }
                        if (!moveProperties.equals("")) {
                            textviewText = textviewText + " |Properties: "+ moveProperties;
                        }
    
                    TextView Move = new TextView(context);
                    Move.setText(textviewText);
                    textviewText="";
                    if (textSize == 1) {
                        Move.setTextSize(20);
                    }
                    moveList.add(Move);
                } while (movesCursor.moveToNext());
            }
            movesCursor.close();
    
            String footnoteSql = "SELECT footnoteText FROM footnotes WHERE charname = '"
                    + charName + "' and moveCatagory = '" + moveCatagory + "'";
            Cursor footnoteCursor = DB.rawQuery(footnoteSql, null);
            if (footnoteCursor.moveToFirst()) {
                do {
                    TextView footnoteMove = new TextView(context);
                    String footnoteBodyText = footnoteCursor
                            .getString(footnoteCursor
                                    .getColumnIndex("footnoteText"));
                    String footnoteText = String.format("\nFOOTNOTES: \n%s",
                            footnoteBodyText);
                    footnoteMove.setText(footnoteText);
                    moveList.add(footnoteMove);
                } while (footnoteCursor.moveToNext());
            }
            footnoteCursor.close();
    
            DB.close();
            return moveList;
        }
    
    
    
        public List<String> getCatagories(String charName) {
            DB = getWritableDatabase();
            List<String> catagories = new ArrayList<String>();
            String catagory = "SELECT moveCatagory FROM characters WHERE charname = '"
                    + charName + "'";
            Cursor catagoriesCursor = DB.rawQuery(catagory, null);
            if (catagoriesCursor.moveToFirst()) {
                do {
                    String currentCatagory = catagoriesCursor
                            .getString(catagoriesCursor
                                    .getColumnIndex("moveCatagory"));
                    catagories.add(currentCatagory);
                } while (catagoriesCursor.moveToNext());
            }
            catagoriesCursor.close();
            DB.close();
            return catagories;
        }
    
    
        @Override
        public void onCreate(SQLiteDatabase db) {
    
        }
    
        public boolean isDataBaseExist() {
            File dbFile = new File(DB_PATH+DB_NAME);
            return dbFile.exists();
            }
        public void copyDataBase() throws IOException {
            InputStream myInput = context.getAssets().open(DB_NAME);
    
            File f = new File( DB_PATH );
            if ( !f.exists() )
                f.mkdir();
    
            String outFileName = DB_PATH + DB_NAME;
            OutputStream myOutput = new FileOutputStream(outFileName);
            byte[] buffer = new byte[1024];
            int length;
            while ((length = myInput.read(buffer)) > 0) {
                            myOutput.write(buffer, 0, length);
            }
                    myOutput.flush();
                    myOutput.close();
                    myInput.close();
            }
    
    
    
    
        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            DB = getWritableDatabase();
            File f = new File( DB_PATH+DB_NAME );
            if ( !f.exists() )
                f.mkdir();
            f.delete();
            try {
                copyDataBase();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            DB.close();
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an Android 2.2 aplication. I use SQlite3 to store some text that
I'd sort of like to use SQLite from within C#.Net, but I can't seem
I want to use sqlite3 but pg for production on heroku. However, I don't
I'm learning how to use sqlite3 with python. The example in the text book
I use SQLite3 to read data from a database and then display the results
I have an app that needs to be able use either an sqlite3 datebase
I want to update/upgrade the standard Leopard install of Sqlite3 to >3.5 to use
I am intending to use SQLite 3 with PHP 5. I found this: http://packages.debian.org/etch/web/php5-sqlite3
What is a good .gitignore to use with Rails on Heroku? *.log *.sqlite3 what
I want to use SQLite within my MFC application. for that, i'll create an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.