sql - Android Adapter for 2 Database Sources -
In my app I have 2 Android databases For example, say database # 1 is called Jobs and in it The following columns are: "Jobs Primary Key" - "Job Title" - "Job Display"
Database # 2 is called People and the following columns are: "People Primary Key" - "First name" - "Last name" - "Jobs ID key"
(Yes I know that these are the databases I do not have to design larger designs, this is just to help in painting a picture for my question.)
Within a list view, I want to display the "first name" column - " Last name "-" Job title "(1 column from database # 1, 2 columns from database # 2). Using SimpleCursorAdapter, is it possible to complete anyway?
If I do not use a simple Finder adapter, then the only way I can think of it to complete is to use an ArrayAdapter, where I use StringBuilder together at 3 columns By adding, and listing the list, I am thinking that this is a better way to complete.
Yes, this is possible & mdash; Suppose you say two tables in two databases instead of two separate databases.
You have to ask your database for information from two tables together. For example, some completely untested) like this:
string [] column = {"first_name", "last_name", "title"};
SQLiteDatabase db = .getReadableDatabase ();
Cursor c = db ("Individuals join the work on the upper job. Job_id = job.", Column, blank, empty, blank, empty, blank);
Then you can normally pass cursor
to adapter
.
Comments
Post a Comment