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
@BindContentProviderPath(path = "albums") | |
@BindDao(Album.class) | |
public interface AlbumDao extends BaseDao<Album> { | |
@BindContentProviderEntry(path = ":{id}") | |
@BindSqlSelect(where = "id=:{id}") | |
List<Album> select(long id); | |
} |
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
@BindDao(Person.class) | |
public interface DaoPerson { | |
@BindSqlSelect(where="name=${name}") | |
List<Person> select1(String name); | |
@BindSqlSelect(where="name=:{name}") | |
List<Person> select2(String name); | |
@BindSqlSelect(where="name=:name") | |
List<Person> select3(String name); |
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
/** | |
* In the user device was already installed the app with version 1 of the datasource so an upgrade is needed. | |
* | |
* @throws Exception | |
*/ | |
@Test | |
public void testUpgrade() throws Exception { | |
// Context of the app under test. | |
Context testContext = InstrumentationRegistry.getContext(); | |
Context context = InstrumentationRegistry.getTargetContext(); |
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
/** | |
* In a user device is installed the app with the version 2 of the SQLite data source. | |
* | |
* @throws Exception | |
*/ | |
@Test | |
public void testInstallVersion2() throws Exception { | |
// Context of the app under test. | |
Context testContext = InstrumentationRegistry.getContext(); | |
Context context = InstrumentationRegistry.getTargetContext(); |
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
@BindType | |
@BindSqlType | |
public class Country { | |
@BindSqlColumn(columnType = ColumnType.PRIMARY_KEY) | |
public long id; | |
public long area; | |
@BindSqlColumn(nullable = false, columnType = ColumnType.UNIQUE) | |
public String code; |
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
CREATE TABLE country (id INTEGER PRIMARY KEY AUTOINCREMENT, area INTEGER, code TEXT UNIQUE NOT NULL, calling_code TEXT NOT NULL, region TEXT, name TEXT NOT NULL, translated_name BLOB); | |
CREATE TABLE prefix_config (id INTEGER PRIMARY KEY AUTOINCREMENT, default_country TEXT, dual_billing_prefix TEXT, enabled INTEGER, dialog_timeout INTEGER); | |
CREATE TABLE phone_number (id INTEGER PRIMARY KEY AUTOINCREMENT, action TEXT, number TEXT, country_code TEXT, contact_name TEXT, contact_id TEXT); |
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
@BindSqliteType(name = "cheeses") | |
public class Cheese { | |
public long id; | |
public String name; | |
} |
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
public class MainActivity extends AppCompatActivity { | |
private static final int LOADER_CHEESES = 1; | |
private CheeseAdapter mCheeseAdapter; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main_activity); |
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
05-15 00:01:56.956 createHelper (line 437): Database file /data/user/0/com.abubusoft.kripton.examples.rssreader/databases/rss.db | |
05-15 00:01:56.984 onCreate (line 253): Create database 'rss.db' version 1 | |
05-15 00:01:56.984 onCreate (line 259): DDL: CREATE TABLE rss_feed (id INTEGER PRIMARY KEY AUTOINCREMENT, uid TEXT UNIQUE, version TEXT); | |
05-15 00:01:56.986 onCreate (line 265): DDL: CREATE TABLE channels (id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, link TEXT UNIQUE, description TEXT, language TEXT, copyright TEXT, pub_date TEXT, last_build_date TEXT, image BLOB, rss_feed_id INTEGER, FOREIGN KEY(rss_feed_id) REFERENCES rss_feed(id)); | |
05-15 00:01:56.987 onCreate (line 271): DDL: CREATE TABLE articles (id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, description TEXT, link TEXT, author TEXT, guid TEXT UNIQUE NOT NULL, comments TEXT, channel_id INTEGER, thumbnail BLOB, read INTEGER, FOREIGN KEY(channel_id) REFERENCES channels(id)); | |
05-15 00:01:56.992 I/AbstractDataSource, openWritableDatabase (line 618): |
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
public class MainActivity extends AppCompatActivity { | |
private RecyclerView recyclerView; | |
private ArticlesAdapter adapter; | |
RssViewModel viewModel; | |
private String[] filterValues; | |
@Override |