Re: [android-developers] Re: database query
Actually if you navigate to the SQLite page on Android Developers (by simply using the search bar and the SQL keyword), the Notepad tutorial is mentioned there, so it is nowhere hidden, you just need to use the search and reading skills. 2011/7/15 Indicator Veritatis mej1...@yahoo.com Obviously. But without being a little more specific, he will think you are just being rudely flippant. Especially since the title of the tutorial best for learning how to use the SQL database in Android does not even suggest that it covers SQL! I have in mind, of course, the tutorial he should start with (assuming he has completed the really basic ones), http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html On Jul 14, 2:49 pm, Filip Havlicek havlicek.fi...@gmail.com wrote: I suggest you read the tutorials on the Android Developers site. 2011/7/14 kirti waykole kirti.carr...@gmail.com hello all, I am new in android . I want to use database for storing my application data.Plz tell me how to use database in android application Thanks in advance -- 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 -- 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 -- 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
[android-developers] Re: database query
Obviously. But without being a little more specific, he will think you are just being rudely flippant. Especially since the title of the tutorial best for learning how to use the SQL database in Android does not even suggest that it covers SQL! I have in mind, of course, the tutorial he should start with (assuming he has completed the really basic ones), http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html On Jul 14, 2:49 pm, Filip Havlicek havlicek.fi...@gmail.com wrote: I suggest you read the tutorials on the Android Developers site. 2011/7/14 kirti waykole kirti.carr...@gmail.com hello all, I am new in android . I want to use database for storing my application data.Plz tell me how to use database in android application Thanks in advance -- 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 -- 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
[android-developers] Re: database query
http://lmgtfy.com/?q=android+application+database That should help you. -- 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
Re: [android-developers] Re: database query
thank you so much for your valuable reply...it works On Fri, Jul 15, 2011 at 8:09 AM, Chris crehb...@gmail.com wrote: http://lmgtfy.com/?q=android+application+database That should help you. -- 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 -- 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
[android-developers] Re: Database query NULL exception
I am afraid I don't how to use Log to print the values. Please advice. Thanks On Apr 8, 6:37 am, Dan U. [EMAIL PROTECTED] wrote: Have you tried using Log to print out the values you are using in your SQL queries? I bet something there is null. Do you have the stack trace to tell you what line in the code is causing the problem? On Apr 7, 6:24 pm, Sawan007 [EMAIL PROTECTED] wrote: Could you please advise what is wrong with this piece of code. After clikcing on button Change Password (confirmButton). I get the Application error An error has occurred in ... near null:syntax error. Please help. public class password extends Activity { private SQLiteDatabase db; private EditText pwd1; private EditText pwd2; private int passset = 1; /** Called when the activity is first created. */ class Row extends Object { public String password; public long rowId; } public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.pass_change); if(passset == 1){ // ask for pass Intent i = new Intent(this, passverify.class); startSubActivity(i, 0); pwd1 = (EditText) findViewById(R.id.pass1); pwd2 = (EditText) findViewById(R.id.pass2); Button confirmButton = (Button) findViewById(R.id.pass_change); Button cancelButton = (Button) findViewById(R.id.cancel); // populateFields(); confirmButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { String password1 = pwd1.getText().toString(); String password2 = pwd2.getText().toString(); if (password1.equals(password2)){ try { db = openDatabase(sms, null); } catch (FileNotFoundException e1) { db = null; } db.execSQL(create table password (rowid integer primary key autoincrement, + password text not null); Row row = new Row(); Cursor c = db.query(true, password, new String[] { rowid, password}, null, null, null, null, null); if (c.count() 0) { c.first(); row.rowId = c.getLong(0); row.password = c.getString(1); c.close(); ContentValues args = new ContentValues(); args.put(password, password1); db.update(password, args, rowid= + row.rowId, null); } else { //row.rowId = -1; //row.password = null; c.close(); /*ContentValues initialValues = new ContentValues(); initialValues.put(password, password1); db.insert(password, null, initialValues); */ db.execSQL(insert into password values('+password1+')); } } //db.close(); setResult(RESULT_OK); finish(); } } ); cancelButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { setResult(RESULT_OK); finish(); } } ); } } --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Database query NULL exception
Use: log.e(TAG, Some error message); On Apr 8, 12:23 pm, Sawan007 [EMAIL PROTECTED] wrote: I am afraid I don't how to use Log to print the values. Please advice. Thanks On Apr 8, 6:37 am, Dan U. [EMAIL PROTECTED] wrote: Have you tried using Log to print out the values you are using in your SQL queries? I bet something there is null. Do you have the stack trace to tell you what line in the code is causing the problem? On Apr 7, 6:24 pm, Sawan007 [EMAIL PROTECTED] wrote: Could you please advise what is wrong with this piece of code. After clikcing on button Change Password (confirmButton). I get the Application error An error has occurred in ... near null:syntax error. Please help. public class password extends Activity { private SQLiteDatabase db; private EditText pwd1; private EditText pwd2; private int passset = 1; /** Called when the activity is first created. */ class Row extends Object { public String password; public long rowId; } public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.pass_change); if(passset == 1){ // ask for pass Intent i = new Intent(this, passverify.class); startSubActivity(i, 0); pwd1 = (EditText) findViewById(R.id.pass1); pwd2 = (EditText) findViewById(R.id.pass2); Button confirmButton = (Button) findViewById(R.id.pass_change); Button cancelButton = (Button) findViewById(R.id.cancel); // populateFields(); confirmButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { String password1 = pwd1.getText().toString(); String password2 = pwd2.getText().toString(); if (password1.equals(password2)){ try { db = openDatabase(sms, null); } catch (FileNotFoundException e1) { db = null; } db.execSQL(create table password (rowid integer primary key autoincrement, + password text not null); Row row = new Row(); Cursor c = db.query(true, password, new String[] { rowid, password}, null, null, null, null, null); if (c.count() 0) { c.first(); row.rowId = c.getLong(0); row.password = c.getString(1); c.close(); ContentValues args = new ContentValues(); args.put(password, password1); db.update(password, args, rowid= + row.rowId, null); } else { //row.rowId = -1; //row.password = null; c.close(); /*ContentValues initialValues = new ContentValues(); initialValues.put(password, password1); db.insert(password, null, initialValues); */ db.execSQL(insert into password values('+password1+')); } } //db.close(); setResult(RESULT_OK); finish(); } } ); cancelButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { setResult(RESULT_OK); finish(); } } ); } }- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Database query NULL exception
Have you tried using Log to print out the values you are using in your SQL queries? I bet something there is null. Do you have the stack trace to tell you what line in the code is causing the problem? On Apr 7, 6:24 pm, Sawan007 [EMAIL PROTECTED] wrote: Could you please advise what is wrong with this piece of code. After clikcing on button Change Password (confirmButton). I get the Application error An error has occurred in ... near null:syntax error. Please help. public class password extends Activity { private SQLiteDatabase db; private EditText pwd1; private EditText pwd2; private int passset = 1; /** Called when the activity is first created. */ class Row extends Object { public String password; public long rowId; } public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.pass_change); if(passset == 1){ // ask for pass Intent i = new Intent(this, passverify.class); startSubActivity(i, 0); pwd1 = (EditText) findViewById(R.id.pass1); pwd2 = (EditText) findViewById(R.id.pass2); Button confirmButton = (Button) findViewById(R.id.pass_change); Button cancelButton = (Button) findViewById(R.id.cancel); // populateFields(); confirmButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { String password1 = pwd1.getText().toString(); String password2 = pwd2.getText().toString(); if (password1.equals(password2)){ try { db = openDatabase(sms, null); } catch (FileNotFoundException e1) { db = null; } db.execSQL(create table password (rowid integer primary key autoincrement, + password text not null); Row row = new Row(); Cursor c = db.query(true, password, new String[] { rowid, password}, null, null, null, null, null); if (c.count() 0) { c.first(); row.rowId = c.getLong(0); row.password = c.getString(1); c.close(); ContentValues args = new ContentValues(); args.put(password, password1); db.update(password, args, rowid= + row.rowId, null); } else { //row.rowId = -1; //row.password = null; c.close(); /*ContentValues initialValues = new ContentValues(); initialValues.put(password, password1); db.insert(password, null, initialValues); */ db.execSQL(insert into password values('+password1+')); } } //db.close(); setResult(RESULT_OK); finish(); } } ); cancelButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { setResult(RESULT_OK); finish(); } } ); } } --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---