Menu
  • HOME
  • TAGS

Error when pressing an item in a listview

android,android-activity,android-listview,android-database

This exception, ClassCastException, says that you have done an invalid class casting. lugar.setPosicion((GeoPuntoAlt) new GeoPunto(cursor.getDouble(3), cursor.getDouble(4))); In this line, you have casted output of new GeoPunto(...) to GeoPuntoAlt. Make sure this casting is valid....

Unable to display sqllite data into Table Layout

android,android-sqlite,android-database

java.lang.IllegalStateException: Couldn't read row 0, col -1 In the above line it is clearly stating that column index is -1 String userr = c.getString(c.getColumnIndex("Username")); In your case c.getgetColumnIndex(-) is returning -1. Once uninstall your app and check again. Hope this will helps you....

Failed to retrieve data from a database, to complete a listview

android,android-activity,android-listview,android-database

Since you have public Lugar(String nombre, String direccion, double longitud, double latitud, double altura, TipoLugar tipo, int telefono, String url, String comentario, int valoracion) in your Lugar class, default constructor won't be available. Either you need to always use above constructor or define an empty constructor public Lugar() { }...

How does an Android app automatically fill its database with values after the user installs it?

android,android-database

It is possible to include a filled database, and this might help: How to ship an Android application with a database? You don't have to run your own server or downloads or anything, because arbitrary files placed in the assets folder will be included in your APK. (However, if it...

Android Guaranteed Reference to a Contact

android,android-contacts,android-database

In Contacts DB we have many tables where we save information related to a Contacts, such as Contacts , Data , Mimetype , RawContacts , Accounts etc. The ContactsContract.Contact._ID changes when there is an update , merge or sync to the server , the ContactsContract.Contact._ID will change from time, you...

Android SQL Database ERROR (Code 1)

java,android,database,android-database

Your problem is here private static final String DATABASE_CREATE = "create table car (_id integer primary key autoincrement, " + "brand text, model text, price integer" // <-- NO COMMA after 'integer'! + "color text, img blob);"; You are missing a comma. It should be: private static final String DATABASE_CREATE...

SQLiteConstraintException: column id is not unique (code 19) exception when updating row

android,sqlite,android-database

Replace your query with the below String Query = "Select * from " + tableName + " where " + DEBTOR_ID + " = '" + value+"'"; since selection value is string , it must be enclosed in single quote. Updated : Instead of writing whole bunch code for checking...

Creating a scalable database for android app | cloud hosted

android,cloud,google-cloud-storage,cloud-hosting,android-database

I'm a bit of a freak in that I use Postgresql. I have a database with millions of users and have 10 to 30 update transactions per second. I have found the n1-standard-8 (8 vCPU, 30 GB memory) machine with SSD disk to be a real screamer. If you want...

Android: Rerun Database onCreate() if it fails

android,android-sqlite,sqliteopenhelper,android-database

Just create your tables in onCreate() and initialise the data in another Service or background thread. In that background thread, call beginTransaction() on your SQLiteDatabase object before you initialise the data. Then call setTransactionSuccessful() and endTransaction() when it has finished. Keep a flag in SharedPreferences so you can check if...

Handling database changes when app version number changes

android,android-database

Your database version is independent of your app version. If your database schema doesn't change at all, you shouldn't need to do anything to your database during an update. When your database schema changes, you should handle database updates in onUpgrade() of your SQLiteOpenHelper. This method is called when you...

creating listview using a local database has Error copying database android

android,listview,android-database

I found my mistake. The code is working and my mistake was the package name. I did copy paste that's why i get the wrong package. Now it's working.