This is an example of the problem I am encountering

package com.triplebande.upupdowndown;

import java.util.ArrayList;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import android.widget.Toast;


public class GameUtils {

        public static String getDescription( Context context,
                        String inputGame ) {
                String description = "";
                SQLiteDatabase myDB = null;
                Cursor c = null;

                try {
                        /* Create the Database (no Errors if it already exists) 
*/
                        myDB = context.openOrCreateDatabase( 
Constants.DATABASE_NAME, 0,
null );
                        //title TEXT, cheats, console
                        String query = "SELECT _ID, cheats FROM games where 
title =\"" +
inputGame  + "\" LIMIT 1";

                        if (Constants.debug)
                                Log.d( Constants.TAG, "We query " + query);

                        c = myDB.rawQuery(query, null);
                        /* Check if our result was valid. */
                        if ( c != null ) {
                                /* Loop through all Results */
                                c.moveToFirst();
                                description = c.getString( c.getColumnIndex( 
Constants.CHEATS ) );
                        }
                } catch ( Exception e ) {
                        if (Constants.debug)
                                Log.e( Constants.TAG, "Exception on quering " + 
e );
                } finally {
                        if ( c != null ) {
                                c.close(  );
                        }

                        if ( myDB != null ) {
                                myDB.close(  );
                        }
                }

                return (description);
        }


        public static ArrayList<String> getGames(Context context, String
inputGame, String inputConsole) {
                SQLiteDatabase myDB = null;
                Cursor c = null;
                ArrayList<String> gamesList = new ArrayList<String>(  );

                try {
                        /* Create the Database (no Errors if it already exists) 
*/
                        myDB = context.openOrCreateDatabase( 
Constants.DATABASE_NAME, 0,
null );
                        //title TEXT, cheats, console
                        String query = "SELECT _ID, title, console FROM games 
where title
like \"" + inputGame  + "\" ";
                        if (!"All platforms".equalsIgnoreCase(inputConsole))
                        {
                                query = query + " and console like '" + 
inputConsole + "' ";
                        }
                        query = query + " LIMIT 100";

                        if (Constants.debug)
                                Log.d( Constants.TAG, "We query " + query);

                        c = myDB.rawQuery(query, null);
                        /* Check if our result was valid. */
                        String title ;

                        if ( c != null ) {
                                /* Loop through all Results */
                                c.moveToFirst();


                                // Loop through all Results
                                do {
                                        // for loops over columns in a row
                                        title = c.getString( c.getColumnIndex( 
Constants.TITLE ) );
                                        gamesList.add(title);
                                } while ( c.moveToNext() );
                        }

                } catch ( Exception e ) {
                        if (Constants.debug)
                                Log.e( Constants.TAG, "Exception on quering " + 
e );
                } finally {
                        if ( c != null ) {
                                c.close(  );
                        }

                        if ( myDB != null ) {
                                myDB.close(  );
                        }
                }

                return (gamesList);
        }


        public static void showMessage(Context context, String message)
        {
                int duration = Toast.LENGTH_SHORT;
                Toast toast = Toast.makeText(context, message, duration);
                toast.show();
        }

        public static void showLongMessage(Context context, String message)
        {
                int duration = Toast.LENGTH_LONG;
                Toast toast = Toast.makeText(context, message, duration);
                toast.show();
        }
}


On Jul 8, 8:55 pm, Miguel Morales <therevolti...@gmail.com> wrote:
> You might try further questions at the android-beginners 
> group:http://groups.google.com/group/android-beginners?pli=1
> orhttp://stackoverflow.com/questions/tagged/android
> You might try right clicking and hitting refresh on the folder where
> the database file is (in eclipse) if something doesn't automatically
> appear.  Other than that, you can't distribute any exe files to users
> via the android market.
>
>
>
> On Thu, Jul 8, 2010 at 7:50 PM, Edmund Higgins <ehiggins...@gmail.com> wrote:
> > Childish
>
> > On Jul 8, 2010 7:47 PM, "Edmund Higgins" <ehiggins...@gmail.com> wrote:
>
> > It's a database application built in Delphi I believe. It allows the user to
> > update an existing database but the database doesn't automatically refresh
> > in eclipse. That's where we are having the trouble.
>
> >> On Jul 8, 2010 7:42 PM, "metal mikey" <coref...@gmail.com> wrote:
>
> >> I'd be very warey of any ...
>
> >> On Jul 9, 12:19 pm, Official <ehiggins...@gmail.com> wrote:
>
> >> Ok so does anyone know of a newbie...
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --http://developingthedream.blogspot.com/,http://diastrofunk.com,http://www.youtube.com/user/revoltingx,
>  ~Isaiah 55:8-9

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to