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);


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

Id      Name        Price
C01     xxx         3


Recommended Answers

All 4 Replies

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

Yes I mean database table, exactly.

what do you mean by hibernate and jpa..?? i really need help here.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.