Last active
August 29, 2015 14:07
-
-
Save ziedrebhi/0f570719ad21556f5e95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Tuto SQLite Android | |
* @author Zied Rebhi | |
* http://www.tutozone.info | |
*/ | |
public class MainActivity extends Activity { | |
SQLiteDatabaseHandler db; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
db = new SQLiteDatabaseHandler(this); | |
Food food1 = new Food(1, "Pizza", (float) 2500, 50); | |
Food food2 = new Food(2, "Cake", (float) 500, 20); | |
db.addOne(food1); | |
db.addOne(food2); | |
db.showAll(); | |
db.deleteOne(food1); | |
db.showAll(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment