Merged files and fixes

master
Evan Leybourn 2011-01-23 15:08:30 +11:00
parent e70cb93340
commit 209e483dd6
10 changed files with 91 additions and 80 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.eleybourn.bookcatalogue"
android:versionName="3.2" android:versionCode="42">
android:versionName="3.3" android:versionCode="46">
<application android:label="@string/app_name" android:icon="@drawable/logo_bc">
<activity android:name=".BookCatalogue"
android:label="@string/app_name">

View File

@ -116,10 +116,13 @@
<string name="anthology_add">Add</string>
<string name="menu_add_thumb_photo">Add Thumbnail from Camera</string>
<string name="thumbnail">Cover Thumbnail</string>
<string name="menu_rotate_thumb">Rotate Thumbnail...</string><string name="menu_rotate_thumb_cw">Rotate Clockwise</string><string name="menu_rotate_thumb_ccw">Rotate Anti-Clockwise</string><string name="menu_rotate_thumb_180">Rotate 180 deg</string><string name="menu_zoom_thumb">Zoom Thumbnail</string>
<string name="menu_rotate_thumb">Rotate Thumbnail...</string>
<string name="menu_rotate_thumb_cw">Rotate Clockwise</string>
<string name="menu_rotate_thumb_ccw">Rotate Anti-Clockwise</string>
<string name="menu_rotate_thumb_180">Rotate 180 deg</string>
<string name="menu_zoom_thumb">Zoom Thumbnail</string>
<string name="help_title_nutshell">In a Nutshell</string>
<string name="signed">Has this book been signed</string>
<string name="audiobook">Audiobook</string>
<string name="read_start">Date started reading</string>
<string name="read_end">Date finished reading</string>
<string name="location">Location of the book</string>
@ -133,10 +136,11 @@
<string name="bookshelf_title">Select bookshelves for this book</string>
<string name="bookshelves">Select Bookshelves</string>
<string name="format">Format</string>
<string name="paperback">Paperback</string>
<string name="hardcover">Hard Cover</string>
<string name="ebook">eBook</string>
<string name="guide">Guide / Companion</string>
<string name="format1">Paperback</string>
<string name="format2">Hard Cover</string>
<string name="format3">eBook</string>
<string name="format4">Audiobook</string>
<string name="format5">Guide / Companion</string>
<string name="description">Description</string>
<string name="genre">Genre</string>
<string name="auto_update">Would you like to automatically update the following fields now \n* Genre \n* Description \n* Thumbnails\n\n If you select Cancel you can always run this again from the Administration page</string>
@ -144,8 +148,4 @@
<string name="menu_search">Search Books</string>
<string name="menu_insert_name">Add by Name</string>
<string name="isbn_name_search_help">Adding books by ISBN is much more accurate than adding by author and title and is generally preferred. Please remember you can sometimes find the correct barcode on the inside front cover. \n\n</string>
</resources>

View File

@ -62,7 +62,7 @@ public class AdministrationFunctions extends Activity {
private CatalogueDBAdapter mDbHelper;
private int importUpdated = 0;
private int importCreated = 0;
public static String filePath = Environment.getExternalStorageDirectory() + "/" + CatalogueDBAdapter.LOCATION;
public static String filePath = Environment.getExternalStorageDirectory() + "/" + BookCatalogue.LOCATION;
public static String fileName = filePath + "/export.csv";
public static String UTF8 = "utf8";
public static int BUFFER_SIZE = 8192;

View File

@ -38,7 +38,6 @@ import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
@ -67,7 +66,18 @@ import android.widget.Toast;
* A book catalogue application that integrates with Google Books.
*/
public class BookCatalogue extends ExpandableListActivity {
/*
public static final String APP_NAME = "DVD Catalogue";
public static final String LOCATION = "dvdCatalogue";
public static final String DATABASE_NAME = "dvd_catalogue";
public static final String APP_NAME = "CD Catalogue";
public static final String LOCATION = "cdCatalogue";
public static final String DATABASE_NAME = "cd_catalogue";
*/
public static final String APP_NAME = "Book Catalogue";
public static final String LOCATION = "bookCatalogue";
public static final String DATABASE_NAME = "book_catalogue";
// Target size of a thumbnail in a list (bbox dim)
private static final int LIST_THUMBNAIL_SIZE=60;
@ -129,8 +139,6 @@ public class BookCatalogue extends ExpandableListActivity {
public void onCreate(Bundle savedInstanceState) {
//check which strings.xml file is currently active
if (!getString(R.string.app_name).equals(APP_NAME)) {
Log.e("BC", getString(R.string.app_name));
Log.e("BC", APP_NAME);
throw new NullPointerException();
}

View File

@ -286,11 +286,11 @@ public class BookEditFields extends Activity {
spinnerAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item);
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mFormatText.setAdapter(spinnerAdapter);
formats.add(getString(R.string.paperback));
formats.add(getString(R.string.hardcover));
formats.add(getString(R.string.ebook));
formats.add(getString(R.string.audiobook));
formats.add(getString(R.string.guide));
formats.add(getString(R.string.format1));
formats.add(getString(R.string.format2));
formats.add(getString(R.string.format3));
formats.add(getString(R.string.format4));
formats.add(getString(R.string.format5));
for (int i=0; i<formats.size(); i++) {
spinnerAdapter.add(formats.get(i));
}

View File

@ -84,6 +84,10 @@ public class BookISBNSearch extends Activity {
if (isbn != null) {
//ISBN has been passed by another component
setContentView(R.layout.isbn_search);
mIsbnText = (EditText) findViewById(R.id.isbn);
mIsbnStatus = (TextView) findViewById(R.id.isbn_search_status);
mConfirmButton = (Button) findViewById(R.id.search);
mIsbnText.setText(isbn);
go(isbn, "", "");
} else if (by.equals("isbn")) {

View File

@ -40,8 +40,7 @@ import android.widget.ImageView;
* ability to list all books as well as retrieve or modify a specific book.
*/
public class CatalogueDBAdapter {
public static final String LOCATION = "bookCatalogue";
/* This is the list of all column names as static variables for reference */
public static final String KEY_AUTHOR = "author";
public static final String KEY_TITLE = "title";
@ -80,7 +79,6 @@ public class CatalogueDBAdapter {
private SQLiteDatabase mDb;
/* private database variables as static reference */
private static final String DATABASE_NAME = "book_catalogue";
private static final String DB_TB_BOOKS = "books";
private static final String DB_TB_AUTHORS = "authors";
private static final String DB_TB_BOOKSHELF = "bookshelf";
@ -216,7 +214,7 @@ public class CatalogueDBAdapter {
*/
private static class DatabaseHelper extends SQLiteOpenHelper {
DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
super(context, BookCatalogue.DATABASE_NAME, null, DATABASE_VERSION);
}
/**
@ -234,9 +232,9 @@ public class CatalogueDBAdapter {
db.execSQL(DATABASE_CREATE_ANTHOLOGY);
db.execSQL(DATABASE_CREATE_BOOK_BOOKSHELF_WEAK);
db.execSQL(DATABASE_CREATE_INDICES);
new File(Environment.getExternalStorageDirectory() + "/" + LOCATION + "/").mkdirs();
new File(Environment.getExternalStorageDirectory() + "/" + BookCatalogue.LOCATION + "/").mkdirs();
try {
new File(Environment.getExternalStorageDirectory() + "/" + LOCATION + "/.nomedia").createNewFile();
new File(Environment.getExternalStorageDirectory() + "/" + BookCatalogue.LOCATION + "/.nomedia").createNewFile();
} catch (IOException e) {
//error
}
@ -478,7 +476,7 @@ public class CatalogueDBAdapter {
if (curVersion == 39) {
curVersion++;
try {
new File(Environment.getExternalStorageDirectory() + "/" + LOCATION + "/.nomedia").createNewFile();
new File(Environment.getExternalStorageDirectory() + "/" + BookCatalogue.LOCATION + "/.nomedia").createNewFile();
} catch (Exception e) {
//error
}
@ -680,7 +678,7 @@ public class CatalogueDBAdapter {
*/
public CatalogueDBAdapter open() throws SQLException {
/* Create the bookCatalogue directory if it does not exist */
new File(Environment.getExternalStorageDirectory() + "/" + LOCATION + "/").mkdirs();
new File(Environment.getExternalStorageDirectory() + "/" + BookCatalogue.LOCATION + "/").mkdirs();
mDbHelper = new DatabaseHelper(mCtx);
mDb = mDbHelper.getWritableDatabase();
return this;
@ -707,13 +705,13 @@ public class CatalogueDBAdapter {
String filename = "";
File file = null;
if (id == 0) {
filename = Environment.getExternalStorageDirectory() + "/" + CatalogueDBAdapter.LOCATION + "/tmp.png";
filename = Environment.getExternalStorageDirectory() + "/" + BookCatalogue.LOCATION + "/tmp.png";
file = new File(filename);
} else {
filename = Environment.getExternalStorageDirectory() + "/" + CatalogueDBAdapter.LOCATION + "/" + id + ".jpg";
filename = Environment.getExternalStorageDirectory() + "/" + BookCatalogue.LOCATION + "/" + id + ".jpg";
file = new File(filename);
if (!file.exists()) {
filename = Environment.getExternalStorageDirectory() + "/" + CatalogueDBAdapter.LOCATION + "/" + id + ".png";
filename = Environment.getExternalStorageDirectory() + "/" + BookCatalogue.LOCATION + "/" + id + ".png";
file = new File(filename);
}
}

View File

@ -120,7 +120,6 @@
<string name="menu_rotate_thumb_ccw">Rotate Anti-Clockwise</string>
<string name="help_title_nutshell">In a Nutshell</string>
<string name="signed">Has this book been signed</string>
<string name="audiobook">Audiobook</string>
<string name="read_start">Date started reading</string>
<string name="read_end">Date finished reading</string>
<string name="location">Location of the book</string>
@ -134,10 +133,11 @@
<string name="bookshelf_title">Select bookshelves for this book</string>
<string name="bookshelves">Select Bookshelves</string>
<string name="format">Format</string>
<string name="paperback">Paperback</string>
<string name="hardcover">Hard Cover</string>
<string name="ebook">eBook</string>
<string name="guide">Guide / Companion</string>
<string name="format1">Paperback</string>
<string name="format2">Hard Cover</string>
<string name="format3">eBook</string>
<string name="format4">Audiobook</string>
<string name="format5">Guide / Companion</string>
<string name="description">Description</string>
<string name="genre">Genre</string>
<string name="auto_update">Would you like to automatically update the following fields now \n* Genre \n* Description \n* Thumbnails\n\n If you select Cancel you can always run this again from the Administration page</string>

View File

@ -7,15 +7,15 @@
<string name="author">Artist</string>
<string name="title">Title</string>
<string name="isbn">UPC</string>
<string name="publisher">???Publisher</string>
<string name="publisher">Publisher</string>
<string name="date_published">Date Produced</string>
<string name="rating">Rating</string>
<string name="bookshelf">Bookshelf</string>
<string name="bookshelf">Shelf</string>
<string name="read">Have you heard this album?</string>
<string name="series">Series</string>
<string name="pages">Length</string>
<string name="confirm_add">Add CD</string>
<string name="nobooks">There are no CD's in this Bookshelf. Please add some using the menu at the bottom of this screen.</string>
<string name="nobooks">There are no CDs in this Shelf. Please add some using the menu at the bottom of this screen.</string>
<string name="menu_sort_by_author_expanded">Expand All</string>
<string name="menu_sort_by">Sort By</string>
<string name="menu_sort_by_author_collapsed">Collapse All</string>
@ -26,26 +26,26 @@
<string name="search">Search</string>
<string name="cancel">Cancel</string>
<string name="confirm_save">Save CD</string>
<string name="nobookshelves">You have not created any bookshelves yet. Please add some using the menu at the bottom of this screen.</string>
<string name="menu_insert_bs">Create Bookshelf</string>
<string name="confirm_add_bs">Add Bookshelf</string>
<string name="menu_bookshelf">Manage Bookshelves</string>
<string name="confirm_save_bs">Save Bookshelf</string>
<string name="menu_delete_bs">Delete Bookshelf</string>
<string name="delete_1st_bs">Cannot Delete the 1st Bookshelf</string>
<string name="bookshelf_label">Bookshelf: </string>
<string name="all_books">All CD's</string>
<string name="nobookshelves">You have not created any shelves yet. Please add some using the menu at the bottom of this screen.</string>
<string name="menu_insert_bs">Create Shelf</string>
<string name="confirm_add_bs">Add Shelf</string>
<string name="menu_bookshelf">Manage Shelves</string>
<string name="confirm_save_bs">Save Shelf</string>
<string name="menu_delete_bs">Delete Shelf</string>
<string name="delete_1st_bs">Cannot Delete the 1st Shelf</string>
<string name="bookshelf_label">Shelf: </string>
<string name="all_books">All CDs</string>
<string name="isbn_found">UPC Scanned. Searching Internet.</string>
<string name="title_isbn_search">CD Catalogue: ISBN Search</string>
<string name="title_manage_bs">CD Catalogue: Manage Bookshelves</string>
<string name="title_edit_bs">CD Catalogue: Edit Bookshelf</string>
<string name="title_manage_bs">CD Catalogue: Manage Shelves</string>
<string name="title_edit_bs">CD Catalogue: Edit Shelf</string>
<string name="book_exists">The CD you are trying to add already exists. Skipping.</string>
<string name="search_label">Search for CD's</string>
<string name="search_label">Search for CDs</string>
<string name="search_hint">Search Artist or Title</string>
<string name="book_not_found">The scanned CD was not found. Please enter the details manually.</string>
<string name="series_num">#</string>
<string name="unable_to_connect_google">Unable to Connect to Google Books</string>
<string name="export_data">Export CD's</string>
<string name="export_data">Export CDs</string>
<string name="export_complete">Export (to SDCard) of data complete. </string>
<string name="import_data">Import Books</string>
<string name="import_alert">Warning. Importing data may update existing CD records with new information if the id in the import file is the same as an existing id. This is usually fine if you changed a field in an exported file. If you created a new CD record, ensure the id field is blank.</string>
@ -56,7 +56,7 @@
<string name="administration_label">Administration</string>
<string name="administration_title">CD Catalogue: Administration</string>
<string name="menu_administration">Admin</string>
<string name="install_scan">To scan your CD's via the ISBN barcode, you must install the zxing barcode scanner application. Press OK to install, or Cancel to skip.</string>
<string name="install_scan">To scan your CDs via the ISBN barcode, you must install the zxing barcode scanner application. Press OK to install, or Cancel to skip.</string>
<string name="install_scan_title">Install Barcode Scanner</string>
<string name="version_number">Version Number</string>
<string name="donate">If you would like to support the development of this application, please donate using a my Amazon Wishlist or the paypal button below. Being in Australia means I cannot publish a &quot;paid&quot; version. :-) </string>
@ -129,8 +129,8 @@
<string name="backup_title">Backup?</string>
<string name="searching_google_books">Searching Google Books</string>
<string name="searching_amazon_books">Searching Amazon</string>
<string name="bookshelf_title">Select bookshelves for this CD</string>
<string name="bookshelves">Select Bookshelves</string>
<string name="bookshelf_title">Select shelves for this CD</string>
<string name="bookshelves">Select shelves</string>
<string name="format">Format</string>
<string name="format1">CD</string>
<string name="format2">MP3</string>
@ -140,7 +140,7 @@
<string name="genre">Genre</string>
<string name="auto_update">Would you like to automatically update the following fields now \n* Genre \n* Description \n* Thumbnails\n\n If you select Cancel you can always run this again from the Administration page</string>
<string name="notset">Not Set</string>
<string name="menu_search">Search CD's</string>
<string name="menu_search">Search CDs</string>
<string name="menu_insert_name">Add by Name</string>
<string name="isbn_name_search_help">Adding CD's by UPC is much more accurate than adding by artist and title and is generally preferred. \n\n</string>
<string name="isbn_name_search_help">Adding CDs by UPC is much more accurate than adding by artist and title and is generally preferred. \n\n</string>
</resources>

View File

@ -7,15 +7,15 @@
<string name="author">Director</string>
<string name="title">Title</string>
<string name="isbn">UPC</string>
<string name="publisher">???Publisher</string>
<string name="publisher">Publisher</string>
<string name="date_published">Date Published</string>
<string name="rating">Rating</string>
<string name="bookshelf">Bookshelf</string>
<string name="bookshelf">Shelf</string>
<string name="read">Have you watched this DVD?</string>
<string name="series">Series</string>
<string name="pages">Length</string>
<string name="confirm_add">Add DVD</string>
<string name="nobooks">There are no DVD's in this Bookshelf. Please add some using the menu at the bottom of this screen.</string>
<string name="nobooks">There are no DVDs in this shelf. Please add some using the menu at the bottom of this screen.</string>
<string name="menu_sort_by_author_expanded">Expand All</string>
<string name="menu_sort_by">Sort By</string>
<string name="menu_sort_by_author_collapsed">Collapse All</string>
@ -26,28 +26,28 @@
<string name="search">Search</string>
<string name="cancel">Cancel</string>
<string name="confirm_save">Save DVD</string>
<string name="nobookshelves">You have not created any bookshelves yet. Please add some using the menu at the bottom of this screen.</string>
<string name="menu_insert_bs">Create Bookshelf</string>
<string name="confirm_add_bs">Add Bookshelf</string>
<string name="menu_bookshelf">Manage Bookshelves</string>
<string name="confirm_save_bs">Save Bookshelf</string>
<string name="menu_delete_bs">Delete Bookshelf</string>
<string name="delete_1st_bs">Cannot Delete the 1st Bookshelf</string>
<string name="bookshelf_label">Bookshelf: </string>
<string name="all_books">All DVD's</string>
<string name="nobookshelves">You have not created any shelves yet. Please add some using the menu at the bottom of this screen.</string>
<string name="menu_insert_bs">Create Shelf</string>
<string name="confirm_add_bs">Add Shelf</string>
<string name="menu_bookshelf">Manage Shelves</string>
<string name="confirm_save_bs">Save Shelf</string>
<string name="menu_delete_bs">Delete Shelf</string>
<string name="delete_1st_bs">Cannot Delete the 1st Shelf</string>
<string name="bookshelf_label">Shelf: </string>
<string name="all_books">All DVDs</string>
<string name="isbn_found">UPC Scanned. Searching Internet.</string>
<string name="title_isbn_search">DVD Catalogue: ISBN Search</string>
<string name="title_manage_bs">DVD Catalogue: Manage Bookshelves</string>
<string name="title_edit_bs">DVD Catalogue: Edit Bookshelf</string>
<string name="title_manage_bs">DVD Catalogue: Manage Shelves</string>
<string name="title_edit_bs">DVD Catalogue: Edit Shelf</string>
<string name="book_exists">The DVD you are trying to add already exists. Skipping.</string>
<string name="search_label">Search for DVD's</string>
<string name="search_label">Search for DVDs</string>
<string name="search_hint">Search Director or Title</string>
<string name="book_not_found">The scanned DVD was not found. Please enter the details manually.</string>
<string name="series_num">#</string>
<string name="unable_to_connect_google">Unable to Connect to Google Books</string>
<string name="export_data">Export DVD's</string>
<string name="export_data">Export DVDs</string>
<string name="export_complete">Export (to SDCard) of data complete. </string>
<string name="import_data">Import DVD's</string>
<string name="import_data">Import DVDs</string>
<string name="import_alert">Warning. Importing data may update existing DVD records with new information if the id in the import file is the same as an existing id. This is usually fine if you changed a field in an exported file. If you created a new DVD record, ensure the id field is blank.</string>
<string name="export_failed">ERROR: Export (to SDCard) of data failed. </string>
<string name="import_failed">ERROR: Import of data (from SDCard) failed. Is the file in the correct place?</string>
@ -56,7 +56,7 @@
<string name="administration_label">Administration</string>
<string name="administration_title">DVD Catalogue: Administration</string>
<string name="menu_administration">Admin</string>
<string name="install_scan">To scan your DVD's via the UPC barcode, you must install the zxing barcode scanner application. Press OK to install, or Cancel to skip.</string>
<string name="install_scan">To scan your DVDs via the UPC barcode, you must install the zxing barcode scanner application. Press OK to install, or Cancel to skip.</string>
<string name="install_scan_title">Install Barcode Scanner</string>
<string name="version_number">Version Number</string>
<string name="donate">If you would like to support the development of this application, please donate using a my Amazon Wishlist or the paypal button below. Being in Australia means I cannot publish a &quot;paid&quot; version. :-) </string>
@ -129,18 +129,19 @@
<string name="backup_title">Backup?</string>
<string name="searching_google_books">Searching Google Books</string>
<string name="searching_amazon_books">Searching Amazon</string>
<string name="bookshelf_title">Select bookshelves for this DVD</string>
<string name="bookshelves">Select Bookshelves</string>
<string name="bookshelf_title">Select shelves for this DVD</string>
<string name="bookshelves">Select shelves</string>
<string name="format">Format</string>
<string name="format1">DVD</string>
<string name="format2">BluRay</string>
<string name="format3">HD DVD</string>
<string name="format4">AVI/MPG/Online</string>
<string name="format4">VCD</string>
<string name="format5">AVI/MPG/Online</string>
<string name="description">Description</string>
<string name="genre">Genre</string>
<string name="auto_update">Would you like to automatically update the following fields now \n* Genre \n* Description \n* Thumbnails\n\n If you select Cancel you can always run this again from the Administration page</string>
<string name="notset">Not Set</string>
<string name="menu_search">Search Books</string>
<string name="menu_search">Search DVDs</string>
<string name="menu_insert_name">Add by Name</string>
<string name="isbn_name_search_help">Adding DVD's by UPC is much more accurate than adding by director and title and is generally preferred. \n\n</string>
<string name="isbn_name_search_help">Adding DVDs by UPC is much more accurate than adding by director and title and is generally preferred. \n\n</string>
</resources>