-
Notifications
You must be signed in to change notification settings - Fork 8
Android 1.x
- Start Android Studio
- Open an existing project
- Select the
anglers-log/android/
directory - Let Gradle sync
- Build
-
New private instance variables and mutators
-
For complex subclasses, override and/or update the
-
getContentValues()
method to include the new properties -
toJson()
method to include the new properties -
toKeywordsString()
method to include the new properties
-
-
Make sure JSON importing and exporting work by adding new assertions to
JsonTest.java
-
Add new properties to the cloning constructor
Note that if a property is a subclass of
UserDefineObject
, theClassName(ClassName obj, keepId)
must be called withkeepId = true
in the object's cloning constructor -
If some data is of type
UserDefineObject
and linked to a separate database table, create manipulation methods for that data rather than create a new instance variable -
The cloning constructor and
getContentValues()
should manipulate the same number of properties -
Be sure to include all constructor variations from
UserDefineObject.java
- Add the
UserDefineObject(JSONObject jsonObject)
constructor for importing - Add required code to
JsonImporter.java
to create the new objects from aJSONObject
- Add required code to
JsonExporter.java
- Create new tests if needed
- Update backup tests for new properties added
- Create or update a
Cursor
subclass for the newUserDefineObject
subclasses -
LogbookSchema
requires a new table scheme -
LogbookHelper
requires new or updated table creation - Add manipulation methods to
Logbook
(seeCatch
methods as an example) - If there is a one-to-many relationship (see below), add a
removeDatabaseProperties()
(seeCatch.removeDatabaseProperties()
), and call this method in theLogbook.remove*()
method - If the new object has an associated photo(s),
- Add it to
QueryHelper.queryPhotos()
. - Add it to
PhotoUtils.convertAllPngToJpg()
. This probably isn't necessary, but should be done for completeness.
- Add it to
SQLite doesn't directly support storing an array in a single column. For UserDefineObject
subclasses that require a collection of some sort (i.e. Catch
requires a collection of images and a collection of FishingMethod
objects), a new table should be created and accessed by the UserDefineObject
Example
The Catch
class does not have an instance variable for its fishing methods. Instead, its getFishingMethods()
and setFishingMethods()
methods interact directly with the SQLite database. It reads from a table with catchId-fishingMethodId
pairs to get all the fishing methods associated with a given catch.
This is the preferred method over concatenating FishingMethod
id's in a String
.
- Download icons from Google Icons and copy to the corresponding
res/
directory - If there are no suitable icon on Google, use Icons8 and the
action_bar_maker.sh
intools/
to create the correct icon sizes
- Add the new item to the correct group
- Add
LAYOUT_
constant - Add
case
for the new constant tolayoutSpec(Context, int)
- Add the
get
method for the new layout. Follow patterns from similar layouts
- Create a master fragment for the new layout (at minimum)
- Create a detail fragment for the new layout (optional)