0

I'm new to java and I'm working on a small android project using eclipse. I created a table and I want to populate it with data from a file. I have done this using EditText control shown below.

public void AddRowItemTable(View view)
{
    EditText itemid_Text= (EditText) findViewById(R.id.itemid); 
    EditText itemname_Text=(EditText) findViewById(R.id.itemname);
    EditText itemprice_Text=(EditText) findViewById(R.id.itemprice);

    String itemid=itemid_Text.getText().toString();
    String itemname=itemname_Text.getText().toString();
    String itemprice=itemprice_Text.getText().toString();

    int id_item=Integer.parseInt(itemid);
    double price=Double.parseDouble(itemprice);
    MainActivity.myDB.AddItem(id_item, itemname, price);
    Intent newintent=new Intent(this, MainActivity.class);
    startActivity(newintent);


}

How can I do the same but this time using data from a file such as shown below:

Id      Name        Price
C01     xxx         3

Help..!!

2
Contributors
4
Replies
30
Views
3 Years
Discussion Span
Last Post by stultuske
0

what is a "sql table" ? I assume you mean a database table?
well, hibernate or jpa can help you out, no doubt.

0

hibernate and jpa are persistence frameworks, they facilitate the communication between Java code and the database

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.