Android :: Column _id Does Not Exist
Jul 29, 2010
I'm having trouble with something that works in the Notepad example.
Here's the code from the NotepadCodeLab/Notepadv1Solution:
CODE:.................
This code seems to work fine. But just to be clear, I ran the adb utility and run sqlite3 I inspected the schema as follows:
CODE:...............
All seems good to me.
Now on to My App, which as far as I can see is basically the same with a few minor changes. I've simplified and simplified my code, but the problem persists.
CODE:..............
When I run my app, I get a RuntimeException and the following prints in LogCat from my Log.e() statement:
LogCat Message: java.lang.IllegalArgumentException: column '_id' does not exist
So, back to sqlite3 to see what's different about my schema:
CODE:.................
I don't see how I'm missing the '_id'.
Can anyone point out what I've done wrong?
One thing that's different between my app and the Notepad example is that I started by creating my application from scratch using the Eclipse wizard while the sample app comes already put together. Is
there some sort of environmental change I need to make for a new app to use a sqlite database?
View 1 Replies
Jul 29, 2010
the error in my logcat is such Logcat
08-29 08:20:57.961: ERROR/AndroidRuntime(1766): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Booking}: java.lang.IllegalArgumentException: column '_id' does not exist
08-29 08:20:57.961: ERROR/AndroidRuntime(1766): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
08-29 08:20:57.961: ERROR/AndroidRuntime(1766): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284).................
View 2 Replies
View Related
Jul 14, 2010
I created a sql lite database with the following columns:
static final String dbName="demoDB";
static final String tableName="Employees";
static final String colID="EmployeeID";
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
db.execSQL("CREATE TABLE "+tableName+" ("+colID+" INTEGER PRIMARY KEY AUTOINCREMENT, "+
colName+" TEXT, "+colAge+" Integer);");
I want to select all the records in the database like this and display them in a gridview:SQLiteDatabase db=this.getWritableDatabase();Cursor cur= db.rawQuery("Select "+colName+", "+colAge+" from "+tableName, new String [] {});String [] from=new String []{DatabaseHelper.colName,DatabaseHelper.colAge};
int [] to=new int [] {R.id.colName,R.id.colAge};
SimpleCursorAdapter sca=new SimpleCursorAdapter(this,R.layout.gridrow,c,from,to);
GridView grid=(GridView)findViewById(R.id.grid);
grid.setAdapter(sca);but i receive the following exception:java.lang.IllegalArgumentException: column '_id' does not exist.the db table does not have a column with name '_id'so what is wrong with this code
View 3 Replies
View Related
Jul 16, 2010
This has got me all confused! I'm trying to return the max value from a column in my database but the return value is always the name of the column.
The query I use:
private static final String SELECTMAX = "SELECT MAX(?) FROM " + TABLE_NAME ;
The (test) function to return the max value:
CODE:............
The column i'm querying is an INTEGER type but the result 's' is always the column name and not the desired value.
View 2 Replies
View Related
Dec 17, 2009
I am looking for a program that would connect to my android phone, as long as it is actively connected to my wifi network, that would let me pull up a screen on my computer and read/reply/send sms messages...
View 21 Replies
View Related
Jul 22, 2010
Looking for an app that will notify me via a ringtone or other noise when my battery is fully charged.
I have HTC Desire stock 2.1
View 3 Replies
View Related
May 26, 2010
A widget that acts as a container for an application. Would be useful for applications that I want to be able to see on the Home Screens, but that don't have a widget.
View 6 Replies
View Related
Dec 3, 2009
I am looking for an app that will make my wallpaper "static", meaning it won't stretch across 3 screens. I'd want either all 3 screens to be the same wallpaper, or just have the wallpaper not move when the screen does.
View 3 Replies
View Related
Apr 16, 2009
public class DatabaseHelper extends SQLiteOpenHelper{ public DatabaseHelper(Context context, String name, CursorFactory factory, int version) { super(context, name, null, version); // TODO Auto-generated constructor stub init();}
View 2 Replies
View Related
Feb 10, 2010
I saw on http://developer.android.com/guide/topics/security/security.html that my app can declare a permission:
.....................
However, what if com.me.app.myapp is not yet installed on the device?
[a] I tested with "adb install", and Foo was installed on the device without incident. The only thing I see is "W/PackageManager( 62): Unknown permission com.me.app.myapp.permission.DEADLY_ACTIVITY in package com.foo.Foo"
[b] if I upload Foo into Android Market, but the user has not yet installed "myapp", will he be able to see Foo in market?
[c] if the answer to [b] is yes (I really hope so, or else it will be a major bummer ...) what message will the user see regarding com.me.app.myapp.permission.DEADLY_ACTIVITY? Since the description of this permission is declared only in "myapp", without "myapp" installed, will the user just see the name of the permission, which probably doesn't mean much?
If [c] is true, would this be a weakness to the Android permission system/Android Market? As long as I can fool the user to install my app first, I would be able to gain permissions that the user would not have otherwise granted me (had he known the true nature of such permissions).
View 2 Replies
View Related
May 31, 2009
Before I create a table, how can I know whether the table already exist in database? How to query?
View 3 Replies
View Related
Aug 7, 2010
I already have a home replacement app (tried out a few and settled on ADWlauncher for the time being.) I'm wondering if there's an app that (in a similar way to a home replacement) would replace the actual calls function of the phone, I find the 'slide to answer' very annoying as I often miss it - and navigating the call log and contacts list from within the default phone app is very annoying. Is there anything like that? Also is it possible to change the colour of the notification bar? I'd prefer if it was dark blue (or at least a darker colour) to fit in with the theme for the rest of my phone. (On the Moto Milestone 2.1 if this makes any difference)
View 3 Replies
View Related
Jun 11, 2010
Currently I use the desktop app quicken to track all my expenses. More and more I'm relying on my android phone to do my daily tasks. I have been searching and reading for weeks now trying to find an app that suits my needs and so far I haven't come up with what I need. Many come close but so far none can provide all three of my requirements. So, does any one of you l33t android users know of an app that can meet these three requirements?
(1) Must be stand alone - If it can sync with a desktop app like quicken for example, that's great but it shouldn't rely on that to function.
(2) Supports downloading bank data directly - My bank (USAA) supports just about every connection method. Every app I have tried for every phone that has this feature has been able to connect to USAA and retrieve my transactions without issue. Downloading to a file and importing manually is not an option.
(3) Must support recurring / scheduled transactions - I want to be able to plug in my monthly recurring bills and have some way of viewing my future balance as the bills hit. Quicken does this with a bar graph and a calender. Either one would work. The biggie (Mint.com) is great but doesn't support the third requirement even though hundreds of people have posted, asking for this feature (guess no one is listening or acting on it). Quicken doesn't have a mobile app. Splash money doesn't have an Android version. Ascendo Money doesn't have an android version. Seems like everything I have found is 2 out of 3.. I don't see how my list of 3 is asking that much?
View 4 Replies
View Related
Aug 6, 2010
I need help in sqlite query for check whether the data is already exist in table,or to check table is empty or not,let's give queries for it.
View 3 Replies
View Related
Mar 16, 2010
I have a sqlite database, and i put this file in "assets" folder. The code like below, Pls help and tell what's wrong in this code, How to use my own sqlite database.
CODE:.............
The error message:
CODE:.................
View 1 Replies
View Related
Jun 10, 2010
A couple of months ago I decided to jump on the Android bandwagon, starting with the Incredible then moving on to the Evo. Everything was going well, life was good, then Apple announces the iPhone 4! I watched the keynote in total awe and drooled when Jon I've explained how glorious the "new" iPhone was and how it will "change everything again." Then the dust settled. The iPhone 4 will be a great phone, however it doesn't offer anything new to me. Virtually all of the reasons I used to justify switching to Android still exist!
My take on the iPhone 4:
Excellent build quality (HTC should take notes)
Fantastic screen
Up to 32 Gig memory
Integrated Video Chat/Conferencing (Wifi Only)
Very thin
It's purdy
Pseudo multitasking
Glass back
For $25 month you can get 2Gig xfer
Here's why I STILL prefer the EVO on Sprint:
WiFi Mobile Hotspot (Saves me $30 per month over my Verizon MIFI)
WiFi Mobile Hotspot allows me to hop on my laptop or my 6 year old to stream Netflix on the iPad!
Sprint TV
Unlimited data baby!
4G
Text to Speech
Speech to Text
HDMI out
8 Megapixel w/dual Flash
Replaceable battery
Turn by turn directions
Voice search
I can VPN to my work computer
3G coverage! I paid $30 per month for Edge on the iPhone! Sprint offers 3G!
Ability to video chat over 3G/4G (Been using Fring)
Ability to transfer files via FTP to my host account
I can select an app to install without being kicked out of the Market!
I have the ability to create ringtones on the fly. No need to pay an additional fee to iTunes to "convert" a song.
Live wallpapers!
Built in radio
I've found the Amazon MP3 store to be much cheaper than iTunes. For example, Fray's "The Fray" is $9.99 on itunes vs. $5.00 on Amazon MP3!
Flash Lite
I can rotate my photos
I can expand my memory
Sprints plans are cheap as hell compared to AT&T
I can email photos at full resolution
How many times have iPhone users purchased an app, only to be disappointed? On the Market, you have 24 hours to test drive. Don't like it, full refund.
Notifications
Widgets
In all honesty, both phones are mind blowing. Look at the big picture and select what phone/service will benefit you the most.
View 4 Replies
View Related
Sep 19, 2010
I have a Dialog implemented with scrollview and a multiline edittext item in the scrollview. I see that I can use the scrollbar in the edittext as the scrollview will take over it. Can they co-exist and work together?
View 7 Replies
View Related
Jul 24, 2009
For now i have a list, using extends listactivity, and now i want to add mapview on the same activity using framelayout probably,
but if i want to use the mapview, the activity must extends mapactivity,
one must extends mapactivity,the other must extends list activity,
if it possible to do that?
View 7 Replies
View Related
Jul 9, 2010
I'm very happy with how my Hero is set up at the moment, but there are a couple of apps which would make my life a lot easier, and conserve my precious battery!
Location based profiles using wirless location (and not GPS) I'd love to be able to arrive at work (or within 1500 meters of work) and my phone recognise this and switches on wifi, turn itself to silent, or choose a more suitable ringtone. I know that there are a few apps out there that use GPS to trigger, but this really kills my battery. I also know that wireless location isn't that accurate, but I'd only need ball park triggers anyway.
Time based app to kill certain features/apply airplane mode I've got Silent Time Pro, which switches my phone to silent at my bed time, but in an effort to conserve battery, is there an app which can also turn off wifi, GPS, auto updates and/or switch to airplane mode at specific times?
Does anyone have any recommendations for these, or do they not exist yet? Is it just me, or would these be quite handy apps?
If they don't exist, does anyone have a recommendation for me to set these profiles up manually, and maybe trigger them by means of a shortcut/widget? Obviously auto activation would be better, but I'm really trying to cut down on recharges, as it seems that my phones forever flashing orange at me!
View 5 Replies
View Related
Dec 20, 2009
1. Any competent music app. The default one is pretty worthless, and the "best" (I use that term loosely) 3rd party one I could find was probably MixZing, but it leaves a lot to be desired
2. Any competent camera app.. The interface on the default one pretty much sucks, and doesn't focus very well even with the green corners. If you look at Google Goggles, it has a VERY nice-looking full-screen camera that takes better photos than the default, but it can't be used as an actual camera, only for searching Google..............
View 1 Replies
View Related
Jan 28, 2010
Actually I am developing one application in that when application run first time it will create one txt file and save IMSI number in that file. when mobile boot it will matches it's current IMSI number with IMSI number present in the txt file. But I don't know how to check that file is exist or not.
View 2 Replies
View Related
Jun 12, 2010
I read somewhere (and have observed) that starting threads is slow. I always assumed that AsyncTask created and reused a single thread because it required being started inside the UI thread.The following (anonymized) code is called from a ListAdapter's getView method to load images asynchronously. It works well until the user moves the list quickly, and then it becomes "janky".final File imageFile = new File(getCacheDir().getPath() + "/img/" + p.image);image.setVisibility(View.GONE);view.findViewById(R.id.imageLoading).setVisibility(View.VISIBLE);
(new AsyncTask<Void, Void, Bitmap>() {
@Override
protected Bitmap doInBackground(Void... params) {
try {Bitmap image;
if (!imageFile.exists() || imageFile.length() == 0) {
image = BitmapFactory.decodeStream(new URL(
"http://example.com/images/"
+ p.image).openStream());
image.compress(Bitmap.CompressFormat.JPEG, 85,
new FileOutputStream(imageFile));
image.recycle();
}image = BitmapFactory.decodeFile(imageFile.getPath(),
bitmapOptions);
return image;
} catch (MalformedURLException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
return null;
} catch (IOException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
return null;
@Override
protected void onPostExecute(Bitmap image) {
if (view.getTag() != p) // The view was recycled.
return;
view.findViewById(R.id.imageLoading).setVisibility(
View.GONE);
view.findViewById(R.id.image)
.setVisibility(View.VISIBLE);
((ImageView) view.findViewById(R.id.image))
.setImageBitmap(image);
}}).execute();I'm thinking that a queue-based method would work better, but I'm wondering if there is one or if I should attempt to create my own implementation.
View 2 Replies
View Related
Apr 3, 2010
Have been wondering whether there is an app out on the market that blocks phone calls at certain periods of time throughout the day! Such as at night time, I get obnoxious calls that wake me up! Or while I'm in class... Is there such an app that blocks phone calls from like 12AM to 7AM. I've been googling like crazy and I can only find apps that block certain phone numbers.
View 5 Replies
View Related
Apr 3, 2010
I'm new here and have been wondering whether there is an app out on the market that blocks phone calls at certain periods of time throughout the day! Such as at night time, I get obnoxious calls that wake me up! Or while I'm in class... Is there such an app that blocks phone calls from like 12AM to 7AM. I've been googling like crazy and I can only find apps that block certain phone numbers.
View 7 Replies
View Related
Nov 12, 2010
I am making an android app, and i need to connect to a remote database with a webservice. as i know, i will recibe a XML from the webservice, with the result's of my SELECT query (various rows in some cases) i have no idea about XML, and also i have no idea about web services, i only know that i will recibe a XML and i have to parse it to obtain the data. there is a XML parser for this purpose? easy to add to my app and easy to configure?
View 3 Replies
View Related
Oct 14, 2010
I had number of rows in my view now I want to add 2 columns for each row how to do this at runtime, I had tried but not succeed.
View 5 Replies
View Related
May 12, 2010
I'd like to get the value of Count column from cursor.
CODE:...............
I tried to get this count column value from cursor like below
Cursor cR = mDbHelper.getRCount(cplace);if (cR.getCount() > 0){long lCount = cR.getLong(0);}cR.close();}
I got the debug error. How to get it?
Could I use nested cursors?
View 2 Replies
View Related
Mar 4, 2010
I want to design a table whose first column items remain fixed when user scrolls horizontally, but should scroll when the user scrolls vertically. Similarly the first row items remain fixed when user scrolls vertically, but should scroll when the user scrolls horizontally. Can this be achieved using a TableLayout? Or is there any other combination of widgets that I could use?
View 2 Replies
View Related
Jan 1, 2010
One of my android apps performs the following specific SQLite query:
CODE:................
Now that works on some Android phones, but on a few of them it crashes with the following error:
CODE:..................
For some reason, "-1" is interpreted as a column rather than a number... that doesn't make much sense and when I read the SQLite query language I see no need to escape this number in parentheses. Could it be an issue of a different version of SQLite? Would adding parentheses this help any? Instead, I'll probably rewrite it using >= 0 but still I'd like to understand what's going on.
View 1 Replies
View Related
Jul 29, 2010
I'm not big into UI programming so this may be an easy thing I overlooked. I am trying have a screen that shows 8 TextView in a 2 column x 4 row table. And, of course, I want the TextViews, that might have different lengths, to be centered. I tried this in a table layout, for obvious reasons but I feel like this is not the way to do it because it doesn't have much control where I put everything once it is in a row. Should I be using a different combinations of layouts or is there something I overlooked.
View 2 Replies
View Related