master bd43dad2b9cf cached
181 files
717.9 KB
163.2k tokens
968 symbols
1 requests
Download .txt
Showing preview only (777K chars total). Download the full file or copy to clipboard to get everything.
Repository: StephenBlackWasAlreadyTaken/xDrip
Branch: master
Commit: bd43dad2b9cf
Files: 181
Total size: 717.9 KB

Directory structure:
gitextract_6jrc5dih/

├── .gitignore
├── DexDrip.iml
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── app.iml
│   ├── build.gradle
│   ├── libs/
│   │   ├── ActiveAndroid.jar
│   │   ├── android-support-v4.jar
│   │   ├── hellocharts-library-1.1.jar
│   │   └── usb-serial-for-android-v010.jar
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── eveningoutpost/
│       │               └── dexdrip/
│       │                   └── ApplicationTest.java
│       └── main/
│           ├── AndroidManifest.xml
│           ├── assets/
│           │   └── migrations/
│           │       ├── 10.sql
│           │       ├── 16.sql
│           │       ├── 17.sql
│           │       ├── 18.sql
│           │       ├── 19.sql
│           │       ├── 20.sql
│           │       ├── 21.sql
│           │       ├── 23.sql
│           │       ├── 24.sql
│           │       ├── 25.sql
│           │       └── 26.sql
│           ├── java/
│           │   └── com/
│           │       └── eveningoutpost/
│           │           └── dexdrip/
│           │               ├── AddCalibration.java
│           │               ├── AutoStart.java
│           │               ├── BluetoothScan.java
│           │               ├── CalibrationCheckInActivity.java
│           │               ├── CalibrationGraph.java
│           │               ├── CalibrationOverride.java
│           │               ├── DoubleCalibrationActivity.java
│           │               ├── FakeNumbers.java
│           │               ├── Home.java
│           │               ├── ImportedLibraries/
│           │               │   ├── dexcom/
│           │               │   │   ├── CRC16.java
│           │               │   │   ├── CRCFailRuntimeException.java
│           │               │   │   ├── Constants.java
│           │               │   │   ├── PacketBuilder.java
│           │               │   │   ├── ReadData.java
│           │               │   │   ├── ReadDataShare.java
│           │               │   │   ├── ReadPacket.java
│           │               │   │   ├── SyncingService.java
│           │               │   │   ├── Utils.java
│           │               │   │   └── records/
│           │               │   │       ├── CalRecord.java
│           │               │   │       ├── CalSubrecord.java
│           │               │   │       ├── EGVRecord.java
│           │               │   │       ├── GenericTimestampRecord.java
│           │               │   │       ├── GenericXMLRecord.java
│           │               │   │       ├── GlucoseDataSet.java
│           │               │   │       ├── MeterRecord.java
│           │               │   │       ├── PageHeader.java
│           │               │   │       └── SensorRecord.java
│           │               │   └── usbserial/
│           │               │       ├── BuildInfo.java
│           │               │       ├── driver/
│           │               │       │   ├── CdcAcmSerialDriver.java
│           │               │       │   ├── CommonUsbSerialPort.java
│           │               │       │   ├── Cp21xxSerialDriver.java
│           │               │       │   ├── FtdiSerialDriver.java
│           │               │       │   ├── ProbeTable.java
│           │               │       │   ├── ProlificSerialDriver.java
│           │               │       │   ├── UsbId.java
│           │               │       │   ├── UsbSerialDriver.java
│           │               │       │   ├── UsbSerialPort.java
│           │               │       │   ├── UsbSerialProber.java
│           │               │       │   └── UsbSerialRuntimeException.java
│           │               │       └── util/
│           │               │           ├── HexDump.java
│           │               │           └── SerialInputOutputManager.java
│           │               ├── Interfaces/
│           │               │   ├── BgReadingInterface.java
│           │               │   ├── CalibrationInterface.java
│           │               │   ├── SensorInterface.java
│           │               │   └── UserInterface.java
│           │               ├── LicenseAgreementActivity.java
│           │               ├── Models/
│           │               │   ├── ActiveBluetoothDevice.java
│           │               │   ├── BgReading.java
│           │               │   ├── Calibration.java
│           │               │   ├── CalibrationRequest.java
│           │               │   ├── TransmitterData.java
│           │               │   ├── User.java
│           │               │   └── UserNotification.java
│           │               ├── NavDrawerBuilder.java
│           │               ├── NavigationDrawerFragment.java
│           │               ├── Sensor.java
│           │               ├── Services/
│           │               │   ├── ComunicationHeader.java
│           │               │   ├── DexCollectionService.java
│           │               │   ├── DexShareCollectionService.java
│           │               │   ├── MongoWrapper.java
│           │               │   ├── SyncService.java
│           │               │   ├── TransmitterRawData.java
│           │               │   └── WixelReader.java
│           │               ├── SettingsActivity.java
│           │               ├── ShareModels/
│           │               │   ├── DexcomShareInterface.java
│           │               │   ├── Egv.java
│           │               │   ├── ShareAuthenticationBody.java
│           │               │   ├── ShareGlucose.java
│           │               │   ├── ShareRest.java
│           │               │   └── ShareUploadPayload.java
│           │               ├── ShareTest.java
│           │               ├── StartNewSensor.java
│           │               ├── StopSensor.java
│           │               ├── SystemStatus.java
│           │               ├── Tables/
│           │               │   ├── BgReadingTable.java
│           │               │   ├── CalibrationDataTable.java
│           │               │   └── SensorDataTable.java
│           │               ├── UsbConnectedActivity.java
│           │               ├── UtilityModels/
│           │               │   ├── BgGraphBuilder.java
│           │               │   ├── BgSendQueue.java
│           │               │   ├── CalibrationSendQueue.java
│           │               │   ├── CollectionServiceStarter.java
│           │               │   ├── Constants.java
│           │               │   ├── DexShareAttributes.java
│           │               │   ├── ForegroundServiceStarter.java
│           │               │   ├── HM10Attributes.java
│           │               │   ├── Intents.java
│           │               │   ├── MongoSendTask.java
│           │               │   ├── NightscoutUploader.java
│           │               │   ├── Notifications.java
│           │               │   ├── PebbleSync.java
│           │               │   ├── RedBearLabAttributes.java
│           │               │   ├── RestCalls.java
│           │               │   └── SensorSendQueue.java
│           │               ├── utils/
│           │               │   ├── DatabaseUtil.java
│           │               │   ├── FileUtils.java
│           │               │   ├── Preferences.java
│           │               │   └── ShareNotification.java
│           │               ├── widgetUpdateService.java
│           │               ├── xDripWidget.java
│           │               └── xdrip.java
│           └── res/
│               ├── layout/
│               │   ├── activity_add_calibration.xml
│               │   ├── activity_add_comparison.xml
│               │   ├── activity_bluetooth_scan.xml
│               │   ├── activity_calibration_check_in.xml
│               │   ├── activity_calibration_graph.xml
│               │   ├── activity_calibration_override.xml
│               │   ├── activity_double_calibration.xml
│               │   ├── activity_fake_numbers.xml
│               │   ├── activity_home.xml
│               │   ├── activity_license_agreement.xml
│               │   ├── activity_raw_data_table.xml
│               │   ├── activity_share_test.xml
│               │   ├── activity_start_new_sensor.xml
│               │   ├── activity_stop_sensor.xml
│               │   ├── activity_system_status.xml
│               │   ├── activity_usb_connected.xml
│               │   ├── fragment_navigation_drawer.xml
│               │   ├── listitem_device.xml
│               │   ├── raw_data_list.xml
│               │   ├── raw_data_list_item.xml
│               │   └── x_drip_widget.xml
│               ├── layout-xlarge/
│               │   └── activity_home.xml
│               ├── menu/
│               │   ├── global.xml
│               │   ├── menu_bluetooth_scan.xml
│               │   ├── menu_home.xml
│               │   ├── menu_share_test.xml
│               │   └── menu_system_status.xml
│               ├── values/
│               │   ├── arrays.xml
│               │   ├── dimens.xml
│               │   ├── strings.xml
│               │   ├── strings_activity_preferences.xml
│               │   └── styles.xml
│               ├── values-v14/
│               │   └── dimens.xml
│               ├── values-v21/
│               │   └── styles.xml
│               ├── values-w820dp/
│               │   └── dimens.xml
│               └── xml/
│                   ├── device_filter.xml
│                   ├── pref_advanced_settings.xml
│                   ├── pref_data_source.xml
│                   ├── pref_data_sync.xml
│                   ├── pref_general.xml
│                   ├── pref_headers.xml
│                   ├── pref_license.xml
│                   ├── pref_notifications.xml
│                   └── x_drip_widget_info.xml
├── battle_of_the_dexes.md
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── hardware_setup.md
├── settings.gradle
├── xDrip-Experimental.iml
└── xDrip.iml

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

#local
/local.properties
.idea/
/.idea/*
.idea/misc.xml
.idea/vcs.xml
*.idea*
*manifest-merger-debug-report.txt
*manifest-merger-release-report.txt
*.ds_store
*.DS_Store
*.swp


================================================
FILE: DexDrip.iml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="java-gradle" name="Java-Gradle">
      <configuration>
        <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" inherit-compiler-output="false">
    <output url="file://$MODULE_DIR$/build/classes/main" />
    <output-test url="file://$MODULE_DIR$/build/classes/test" />
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
      <excludeFolder url="file://$MODULE_DIR$/.gradle" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>



================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: README.md
================================================
xDrip
=======
##### ** Please note this is __NOT__ a product created by or backed by Dexcom, you can check them out [here](http://dexcom.com/) **

#### Wirelessly with a Dexcom Share Receiver -- or -- Wireless xDrip bridge (No receiver!)

#### Click here for the [Main Project Page](http://stephenblackwasalreadytaken.github.io/xDrip/)


#### Access your Glucose levels from anywhere!
xDrip is ready to upload your glucose data to any [Nightscout](http://nightscout.github.io/) server for remote monitoring on just about any internet connected device!!


#### Want to learn more?? 
Jump on over to the [Wiki](https://github.com/StephenBlackWasAlreadyTaken/xDrip/wiki) for instructions and downloads!!


#### Stay Up to Date!
Follow me on twitter `@StephenIsTaken`, I will let everyone know when updates happen that you should definitely download! Updates will be rolling out fairly frequently as there is lots to do!!!


#### Want to help out?
AWESOME, let me know, put up some PRS, lets make it awesome!


#### Awesome Contributors:
(in no particular order, because they are all awesome)
* [@tzachi-dar](https://github.com/tzachi-dar) 
* [@jstevensog](https://github.com/jstevensog) 
* [@bhandfast](https://github.com/bhandfast) 
* [@LorelaiL](https://github.com/LorelaiL)
* [@syntaxerr66](https://github.com/syntaxerr66)
* [@saercnap](https://github.com/saercnap) 
* [@ktind](https://github.com/ktind)
* [Ly](http://youtu.be/YuxCUeJ9xAU)
* [Kev](http://circles-of-blue.winchcombe.org/)
* [NightScout](https://github.com/nightscout)
* Whoever else is supporting this and helping people out!!

***

<a href="http://i.imgur.com/7b18gLs.jpg"><img src="http://i.imgur.com/7b18gLs.jpg" align="center" width="600" ></a>

<a href="http://imgur.com/lFwKzRr.jpg"><img src="http://imgur.com/lFwKzRr.jpg" align="center" width="600" ></a>

***


================================================
FILE: app/.gitignore
================================================
/build


================================================
FILE: app/app.iml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="xDrip-Experimental" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="android-gradle" name="Android-Gradle">
      <configuration>
        <option name="GRADLE_PROJECT_PATH" value=":app" />
      </configuration>
    </facet>
    <facet type="android" name="Android">
      <configuration>
        <option name="SELECTED_BUILD_VARIANT" value="debug" />
        <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
        <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
        <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
        <option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
        <option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
        <option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
        <option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugAndroidTestSources" />
        <option name="ALLOW_USER_CONFIGURATION" value="false" />
        <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
        <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
        <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
        <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" inherit-compiler-output="false">
    <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
    <output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
      <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
      <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
    </content>
    <orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" exported="" name="android-support-v4" level="project" />
    <orderEntry type="library" exported="" name="ActiveAndroid" level="project" />
    <orderEntry type="library" exported="" name="okio-1.2.0" level="project" />
    <orderEntry type="library" exported="" name="okhttp-2.2.0" level="project" />
    <orderEntry type="library" exported="" name="crashlytics-2.2.3" level="project" />
    <orderEntry type="library" exported="" name="answers-1.1.2" level="project" />
    <orderEntry type="library" exported="" name="rxjava-1.0.0" level="project" />
    <orderEntry type="library" exported="" name="retrofit-1.9.0" level="project" />
    <orderEntry type="library" exported="" name="acra-4.5.0" level="project" />
    <orderEntry type="library" exported="" name="beta-1.1.2" level="project" />
    <orderEntry type="library" exported="" name="gson-2.3.1" level="project" />
    <orderEntry type="library" exported="" name="mongo-java-driver-2.10.1" level="project" />
    <orderEntry type="library" exported="" name="usb-serial-for-android-v010" level="project" />
    <orderEntry type="library" exported="" name="pebblekit-2.6.0" level="project" />
    <orderEntry type="library" exported="" name="fabric-1.3.0" level="project" />
    <orderEntry type="library" exported="" name="hellocharts-library-1.1" level="project" />
  </component>
</module>

================================================
FILE: app/build.gradle
================================================
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 21
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.eveningoutpost.dexdrip"
        minSdkVersion 19
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'com.squareup.okhttp:mockwebserver:2.2.0'
    compile 'com.squareup.okhttp:okhttp:2.2.0'
    compile 'com.google.code.gson:gson:2.3'
    compile 'org.mongodb:mongo-java-driver:2.10.1'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.getpebble:pebblekit:2.6.0@aar'
    compile 'io.reactivex:rxjava:1.0.0'
    compile 'ch.acra:acra:4.5.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.2.3@aar') {
        transitive = true;
    }
}


================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/stephenblack/adt-bundle-mac-x86_64-20140702 2/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}


================================================
FILE: app/src/androidTest/java/com/eveningoutpost/dexdrip/ApplicationTest.java
================================================
package com.eveningoutpost.dexdrip;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.eveningoutpost.dexdrip" >

    <permission android:name="com.eveningoutpost.dexdrip.permissions.RECEIVE_BG_ESTIMATE" />

    <uses-feature
        android:name="android.hardware.bluetooth_le"
        android:required="true" />
    <uses-feature android:name="android.hardware.usb.host" />

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.BATTERY_STATS" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission." />

    <application
        android:name=".xdrip"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@style/AppTheme" >
        <meta-data
            android:name="AA_DB_NAME"
            android:value="DexDrip.db" />
        <meta-data
            android:name="AA_DB_VERSION"
            android:value="27" />

        <provider
            android:name="com.activeandroid.content.ContentProvider"
            android:authorities="com.example"
            android:exported="false" />

        <activity
            android:name=".Home"
            android:label="@string/app_name"
            android:launchMode="singleInstance" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".BluetoothScan"
            android:label="@string/title_activity_bluetooth_scan" >
        </activity>

        <service
            android:name=".Services.DexCollectionService"
            android:enabled="true"
            android:exported="true" >
        </service>

        <activity
            android:name=".Tables.BgReadingTable"
            android:label="Bg Readings Table" >
        </activity>
        <activity
            android:name=".Tables.SensorDataTable"
            android:label="Sensor Table" >
        </activity>
        <activity
            android:name=".AddCalibration"
            android:label="@string/title_activity_add_calibration" >
        </activity>
        <activity
            android:name=".StartNewSensor"
            android:label="@string/title_activity_start_new_sensor" >
        </activity>
        <activity
            android:name=".StopSensor"
            android:label="@string/title_activity_stop_sensor" >
        </activity>

        <receiver android:name=".AutoStart" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".Tables.CalibrationDataTable"
            android:label="@string/title_activity_calibration_data_table" >
        </activity>

        <service
            android:name=".Services.SyncService"
            android:enabled="true"
            android:exported="true" >
        </service>
        <service
            android:name=".ImportedLibraries.dexcom.SyncingService"
            android:enabled="true"
            android:exported="true" >
        </service>

        <activity
            android:name=".FakeNumbers"
            android:label="@string/title_activity_fake_numbers" >
        </activity>
        <activity
            android:name=".DoubleCalibrationActivity"
            android:label="@string/title_activity_double_calibration" >
        </activity>
        <activity
            android:name=".CalibrationOverride"
            android:label="@string/title_activity_calibration_override" >
        </activity>
        <activity
            android:name=".CalibrationGraph"
            android:label="@string/title_activity_calibration_graph" >
        </activity>
        <activity
            android:name=".SettingsActivity"
            android:label="Settings" >
        </activity>
        <activity
            android:name=".LicenseAgreementActivity"
            android:label="@string/title_activity_license_agreement" >
        </activity>
        <activity
            android:name=".CalibrationCheckInActivity"
            android:label="@string/title_activity_calibration_check_in" >
        </activity>
        <activity
            android:name=".UsbConnectedActivity"
            android:label="@string/title_activity_usb_connected" >
            <intent-filter>
                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
            </intent-filter>

            <meta-data
                android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
                android:resource="@xml/device_filter" />
        </activity>

        <service
            android:name=".Services.DexShareCollectionService"
            android:enabled="true"
            android:exported="true" >
        </service>

        <activity
            android:name=".ShareTest"
            android:label="@string/title_activity_share_test" >
        </activity>
        <activity
            android:name=".SystemStatus"
            android:label="@string/title_activity_system_status" >
        </activity>
        <activity
            android:name=".utils.Preferences"
            android:label="@string/title_activity_preferences" >
        </activity>

        <receiver android:name=".xDripWidget" >
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/x_drip_widget_info" />
        </receiver>

        <service
            android:name=".widgetUpdateService"
            android:enabled="true"
            android:exported="true" >
        </service>
        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="193dbc121e25e5f3e71bb98164ec074378e339df" />
    </application>

</manifest>


================================================
FILE: app/src/main/assets/migrations/10.sql
================================================
ALTER TABLE Notifications ADD COLUMN calibration_alert BOOLEAN;
ALTER TABLE Notifications ADD COLUMN double_calibration_alert BOOLEAN;
ALTER TABLE Notifications ADD COLUMN extra_calibration_alert BOOLEAN;

================================================
FILE: app/src/main/assets/migrations/16.sql
================================================
ALTER TABLE CalibrationSendQueue ADD COLUMN mongo_success BOOLEAN;
ALTER TABLE BgSendQueue ADD COLUMN mongo_success BOOLEAN;


================================================
FILE: app/src/main/assets/migrations/17.sql
================================================
ALTER TABLE Calibration ADD COLUMN possible_bad BOOLEAN;


================================================
FILE: app/src/main/assets/migrations/18.sql
================================================
ALTER TABLE Calibration ADD COLUMN first_decay REAL;
ALTER TABLE Calibration ADD COLUMN second_decay REAL;
ALTER TABLE Calibration ADD COLUMN first_slope REAL;
ALTER TABLE Calibration ADD COLUMN second_slope REAL;


================================================
FILE: app/src/main/assets/migrations/19.sql
================================================
ALTER TABLE Calibration ADD COLUMN first_intercept REAL;
ALTER TABLE Calibration ADD COLUMN second_intercept REAL;
ALTER TABLE Calibration ADD COLUMN first_scale REAL;
ALTER TABLE Calibration ADD COLUMN second_scale REAL;



================================================
FILE: app/src/main/assets/migrations/20.sql
================================================
ALTER TABLE Calibration ADD COLUMN check_in BOOLEAN;


================================================
FILE: app/src/main/assets/migrations/21.sql
================================================
ALTER TABLE ActiveBluetoothDevice ADD COLUMN connected BOOLEAN;


================================================
FILE: app/src/main/assets/migrations/23.sql
================================================
ALTER TABLE BgReadings ADD COLUMN raw_calculated REAL;


================================================
FILE: app/src/main/assets/migrations/24.sql
================================================
ALTER TABLE BgReadings ADD COLUMN hide_slope BOOLEAN;


================================================
FILE: app/src/main/assets/migrations/25.sql
================================================
ALTER TABLE BgReadings ADD COLUMN noise TEXT;


================================================
FILE: app/src/main/assets/migrations/26.sql
================================================
ALTER TABLE BgReadings ADD COLUMN filtered_data REAL DEFAULT 0;


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/AddCalibration.java
================================================
package com.eveningoutpost.dexdrip;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.eveningoutpost.dexdrip.Models.Calibration;
import com.eveningoutpost.dexdrip.UtilityModels.CollectionServiceStarter;


public class AddCalibration extends Activity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
    Button button;
    private String menu_name = "Add Calibration";
    private NavigationDrawerFragment mNavigationDrawerFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if(CollectionServiceStarter.isBTShare(getApplicationContext())) {
            Intent intent = new Intent(this, Home.class);
            startActivity(intent);
            finish();
        }
        setContentView(R.layout.activity_add_calibration);
        addListenerOnButton();
    }

    protected void onResume(){
        super.onResume();
        mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
        mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);
    }
    @Override
    public void onNavigationDrawerItemSelected(int position) {
        mNavigationDrawerFragment.swapContext(position);
    }

    public void addListenerOnButton() {

        button = (Button) findViewById(R.id.save_calibration_button);

        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

                if (Sensor.isActive()) {
                    EditText value = (EditText) findViewById(R.id.bg_value);
                    String string_value = value.getText().toString();
                    if (!TextUtils.isEmpty(string_value)){
                        double calValue = Double.parseDouble(string_value);


                        Calibration calibration = Calibration.create(calValue, getApplicationContext());

                        Intent tableIntent = new Intent(v.getContext(), Home.class);
                        startActivity(tableIntent);
                        finish();
                    } else {
                        value.setError("Calibration Can Not be blank");
                    }
                } else {
                    Log.w("CALERROR", "ERROR");
                }
            }
        });

    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/AutoStart.java
================================================
package com.eveningoutpost.dexdrip;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.eveningoutpost.dexdrip.UtilityModels.CollectionServiceStarter;

/**
 * Created by stephenblack on 11/3/14.
 */
public class AutoStart extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.w("DexDrip", "Service auto starter, starting!");
        CollectionServiceStarter.newStart(context);
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/BluetoothScan.java
================================================
package com.eveningoutpost.dexdrip;

import android.annotation.TargetApi;
import android.app.ListActivity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.widget.DrawerLayout;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.activeandroid.query.Select;
import com.eveningoutpost.dexdrip.Models.ActiveBluetoothDevice;
import com.eveningoutpost.dexdrip.Services.DexCollectionService;
import com.eveningoutpost.dexdrip.UtilityModels.CollectionServiceStarter;

import java.util.ArrayList;

@TargetApi(android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)
public class BluetoothScan extends ListActivity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
    private String menu_name = "Scan for BT";
    private NavigationDrawerFragment mNavigationDrawerFragment;

    private final static String TAG = BluetoothScan.class.getSimpleName();
    private static final long SCAN_PERIOD = 10000;
    private boolean is_scanning;
    private boolean has_bluetooth;

    private Handler mHandler;
    private LeDeviceListAdapter mLeDeviceListAdapter;

    private ArrayList<BluetoothDevice> found_devices;
    private BluetoothAdapter bluetooth_adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bluetooth_scan);

        ListView lv = (ListView)findViewById(android.R.id.list);

        final BluetoothManager bluetooth_manager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);

        bluetooth_adapter = bluetooth_manager.getAdapter();
        mHandler = new Handler();

        if (bluetooth_adapter == null) {
            Toast.makeText(this, R.string.error_bluetooth_not_supported, Toast.LENGTH_LONG).show();
            has_bluetooth = false;
            finish();
            return;
        } else {
            has_bluetooth = true;
        }
        if(bluetooth_manager == null) {
            Toast.makeText(this, "This device does not seem to support bluetooth", Toast.LENGTH_LONG).show();
        } else {
            if(!bluetooth_manager.getAdapter().isEnabled()) {
                Toast.makeText(this, "Bluetooth is turned off on this device currently", Toast.LENGTH_LONG).show();
            } else {
                if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2){
                    Toast.makeText(this, "The android version of this device is not compatible with Bluetooth Low Energy", Toast.LENGTH_LONG).show();
                }
            }
        }
        mLeDeviceListAdapter = new LeDeviceListAdapter();
        setListAdapter(mLeDeviceListAdapter);

    }

    @Override
    protected void onPause() {
        super.onPause();
        scanLeDevice(false);
        mLeDeviceListAdapter.clear();
    }

    @Override
    protected void onResume(){
        super.onResume();
        mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
        mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);
    }
    @Override
    public void onNavigationDrawerItemSelected(int position) {
        mNavigationDrawerFragment.swapContext(position);
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_bluetooth_scan, menu);
        if (!is_scanning) {
            menu.findItem(R.id.menu_stop).setVisible(false);
            menu.findItem(R.id.menu_scan).setVisible(true);
        } else {
            menu.findItem(R.id.menu_stop).setVisible(true);
            menu.findItem(R.id.menu_scan).setVisible(false);
        }
        return true;
    }
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.menu_scan:
                scanLeDevice(true);
                BluetoothManager bluetooth_manager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
                Toast.makeText(this, "Scanning", Toast.LENGTH_LONG).show();
                if(bluetooth_manager == null) {
                    Toast.makeText(this, "This device does not seem to support bluetooth", Toast.LENGTH_LONG).show();
                } else {
                    if(!bluetooth_manager.getAdapter().isEnabled()) {
                        Toast.makeText(this, "Bluetooth is turned off on this device currently", Toast.LENGTH_LONG).show();
                    } else {
                        if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2){
                            Toast.makeText(this, "The android version of this device is not compatible with Bluetooth Low Energy", Toast.LENGTH_LONG).show();
                        }
                    }
                }
                return true;
//            case R.id.menu_stop:
//                Intent tableIntent = new Intent(this, RawDataTable.class);
//                startActivity(tableIntent);
//                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    private void scanLeDevice(final boolean enable) {
        if (enable) {
            // Stops scanning after a pre-defined scan period.
            mHandler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    is_scanning = false;
                    bluetooth_adapter.stopLeScan(mLeScanCallback);
                    invalidateOptionsMenu();
                }
            }, SCAN_PERIOD);

            is_scanning = true;
            bluetooth_adapter.startLeScan(mLeScanCallback);
        } else {
            is_scanning = false;
            bluetooth_adapter.stopLeScan(mLeScanCallback);
        }
        invalidateOptionsMenu();
    }

    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        Log.d(TAG, "Item Clicked");
        final BluetoothDevice device = mLeDeviceListAdapter.getDevice(position);
        if (device == null) return;
        Toast.makeText(this, R.string.connecting_to_device, Toast.LENGTH_LONG).show();

        ActiveBluetoothDevice btDevice = new Select().from(ActiveBluetoothDevice.class)
                .orderBy("_ID desc")
                .executeSingle();
        if (btDevice == null) {
            ActiveBluetoothDevice newBtDevice = new ActiveBluetoothDevice();
            newBtDevice.name = device.getName();
            newBtDevice.address = device.getAddress();
            newBtDevice.save();
        } else {
            btDevice.name = device.getName();
            btDevice.address = device.getAddress();
            btDevice.save();
        }

        if (is_scanning) {
            bluetooth_adapter.stopLeScan(mLeScanCallback);
            is_scanning = false;
        }
        Intent intent = new Intent(this, Home.class);
        CollectionServiceStarter.newStart(getApplicationContext());
        startActivity(intent);
        finish();
    }

    private class LeDeviceListAdapter extends BaseAdapter {
        private ArrayList<BluetoothDevice> mLeDevices;
        private LayoutInflater mInflator;

        public LeDeviceListAdapter() {
            super();
            mLeDevices = new ArrayList<BluetoothDevice>();
            mInflator = BluetoothScan.this.getLayoutInflater();
        }

        public void addDevice(BluetoothDevice device) {
            if(!mLeDevices.contains(device)) {
                mLeDevices.add(device);
            }
        }

        public BluetoothDevice getDevice(int position) {
            return mLeDevices.get(position);
        }

        public void clear() {
            mLeDevices.clear();
        }

        @Override
        public int getCount() {
            return mLeDevices.size();
        }

        @Override
        public Object getItem(int i) {
            return mLeDevices.get(i);
        }

        @Override
        public long getItemId(int i) {
            return i;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            ViewHolder viewHolder;
            // General ListView optimization code.
            if (view == null) {
                view = mInflator.inflate(R.layout.listitem_device, null);
                viewHolder = new ViewHolder();
                viewHolder.deviceAddress = (TextView) view.findViewById(R.id.device_address);
                viewHolder.deviceName = (TextView) view.findViewById(R.id.device_name);
                view.setTag(viewHolder);
            } else {
                viewHolder = (ViewHolder) view.getTag();
            }

            BluetoothDevice device = mLeDevices.get(i);
            final String deviceName = device.getName();
            if (deviceName != null && deviceName.length() > 0)
                viewHolder.deviceName.setText(deviceName);
            else
                viewHolder.deviceName.setText(R.string.unknown_device);
            viewHolder.deviceAddress.setText(device.getAddress());

            return view;
        }
    }



    private BluetoothAdapter.LeScanCallback mLeScanCallback =
            new BluetoothAdapter.LeScanCallback() {

                @Override
                public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) {
                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            mLeDeviceListAdapter.addDevice(device);
                            mLeDeviceListAdapter.notifyDataSetChanged();
                        }
                    });
                }
            };

    static class ViewHolder {
        TextView deviceName;
        TextView deviceAddress;
    }

}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/CalibrationCheckInActivity.java
================================================
package com.eveningoutpost.dexdrip;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.eveningoutpost.dexdrip.Home;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.SyncingService;
import com.eveningoutpost.dexdrip.R;
import com.eveningoutpost.dexdrip.Sensor;

public class CalibrationCheckInActivity extends Activity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
    private String menu_name = "Check in calibration";
    private NavigationDrawerFragment mNavigationDrawerFragment;
    Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_calibration_check_in);
        addListenerOnButton();
    }
    protected void onResume(){
        super.onResume();
        mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
        mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);
    }

    @Override
    public void onNavigationDrawerItemSelected(int position) {
        mNavigationDrawerFragment.swapContext(position);
    }

    public void addListenerOnButton() {

        button = (Button) findViewById(R.id.check_in_calibrations);

        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

                if (Sensor.isActive()) {
                    SyncingService.startActionCalibrationCheckin(getApplicationContext());
                    Toast.makeText(getApplicationContext(), "Checked in all calibrations", Toast.LENGTH_LONG).show();
                    Intent tableIntent = new Intent(v.getContext(), Home.class);
                    startActivity(tableIntent);
                    finish();
                } else {
                    Log.w("CANNOT CALIBRATE WITHOUT CURRENT SENSOR", "ERROR");
                }
            }
        });

    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/CalibrationGraph.java
================================================
package com.eveningoutpost.dexdrip;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.view.Menu;
import android.view.MenuItem;

import com.eveningoutpost.dexdrip.Models.Calibration;

import java.util.ArrayList;
import java.util.List;

import lecho.lib.hellocharts.model.Axis;
import lecho.lib.hellocharts.model.Line;
import lecho.lib.hellocharts.model.LineChartData;
import lecho.lib.hellocharts.model.PointValue;
import lecho.lib.hellocharts.util.Utils;
import lecho.lib.hellocharts.view.LineChartView;


public class CalibrationGraph extends Activity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
    private String menu_name = "Calibration Graph";
    private NavigationDrawerFragment mNavigationDrawerFragment;
    private LineChartView chart;
    private LineChartData data;
    public double  start_x = 50;
    public double  end_x = 300;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_calibration_graph);
    }
    @Override
    protected void onResume(){
        super.onResume();

        mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
        mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);

        setupCharts();
    }

    @Override
    public void onNavigationDrawerItemSelected(int position) {
        mNavigationDrawerFragment.swapContext(position);
    }


    public void setupCharts() {
        chart = (LineChartView) findViewById(R.id.chart);
        List<Calibration> calibrations = Calibration.allForSensor();
        List<PointValue> values = new ArrayList<PointValue>();
        for (Calibration calibration : calibrations) {
            values.add(new PointValue((float)calibration.estimate_raw_at_time_of_calibration, (float)calibration.bg));
        }

        Line line = new Line(values);
        line.setColor(Utils.COLOR_BLUE);
        line.setHasLines(false);
        line.setPointRadius(2);
        line.setHasPoints(true);

        Calibration calibration = Calibration.last();
        List<PointValue> lineValues = new ArrayList<PointValue>();
        if(calibration != null) {
            lineValues.add(new PointValue((float) start_x, (float) (start_x * calibration.slope + calibration.intercept)));
            lineValues.add(new PointValue((float) end_x, (float) (end_x * calibration.slope + calibration.intercept)));
        }
        Line calibrationLine = new Line(lineValues);
        calibrationLine.setColor(Utils.COLOR_RED);
        calibrationLine.setHasLines(true);
        calibrationLine.setHasPoints(false);
        Axis axisX = new Axis();
        Axis axisY = new Axis().setHasLines(true);
        axisX.setName("Raw Value");
        axisY.setName("BG");

         List<Line> lines = new ArrayList<Line>();
        lines.add(line);
        lines.add(calibrationLine);

        data = new LineChartData(lines);
        data.setAxisXBottom(axisX);
        data.setAxisYLeft(axisY);
        chart.setLineChartData(data);

    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/CalibrationOverride.java
================================================
package com.eveningoutpost.dexdrip;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.eveningoutpost.dexdrip.Models.Calibration;
import com.eveningoutpost.dexdrip.UtilityModels.CollectionServiceStarter;


public class CalibrationOverride extends Activity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
        Button button;
    private String menu_name = "Override Calibration";
    private NavigationDrawerFragment mNavigationDrawerFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if(CollectionServiceStarter.isBTShare(getApplicationContext())) {
            Intent intent = new Intent(this, Home.class);
            startActivity(intent);
            finish();
        }
        setContentView(R.layout.activity_calibration_override);
        addListenerOnButton();
    }

    @Override
    protected void onResume(){
                super.onResume();
        mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
        mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);
            }

    @Override
    public void onNavigationDrawerItemSelected(int position) {
        mNavigationDrawerFragment.swapContext(position);
    }

    public void addListenerOnButton() {
            button = (Button) findViewById(R.id.save_calibration_button);

            button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                if (Sensor.isActive()) {
                    EditText value = (EditText) findViewById(R.id.bg_value);
                    String string_value = value.getText().toString();
                    if (!TextUtils.isEmpty(string_value)){
                        double calValue = Double.parseDouble(string_value);

                        Calibration last_calibration = Calibration.last();
                        last_calibration.sensor_confidence = 0;
                        last_calibration.slope_confidence = 0;
                        last_calibration.save();
                        Calibration.create(calValue, getApplicationContext());

                         Intent tableIntent = new Intent(v.getContext(), Home.class);
                         startActivity(tableIntent);
                         finish();
                    } else {
                        value.setError("Calibration Can Not be blank");
                    }
                } else {
                    Log.w("CANNOT CALIBRATE WITHOUT CURRENT SENSOR", "ERROR");
                }
            }
        });

    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/DoubleCalibrationActivity.java
================================================
package com.eveningoutpost.dexdrip;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.eveningoutpost.dexdrip.Models.Calibration;
import com.eveningoutpost.dexdrip.UtilityModels.CollectionServiceStarter;


public class DoubleCalibrationActivity  extends Activity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
    Button button;
    private String menu_name = "Add Double Calibration";
    private NavigationDrawerFragment mNavigationDrawerFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if(CollectionServiceStarter.isBTShare(getApplicationContext())) {
            Intent intent = new Intent(this, Home.class);
            startActivity(intent);
            finish();
        }
        setContentView(R.layout.activity_double_calibration);
        addListenerOnButton();
    }

    @Override
    protected void onResume(){
        super.onResume();
        mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
        mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);
    }

    @Override
    public void onNavigationDrawerItemSelected(int position) {
        mNavigationDrawerFragment.swapContext(position);
    }

    public void addListenerOnButton() {

        button = (Button) findViewById(R.id.save_calibration_button);

        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

                if (Sensor.isActive()) {
                    EditText value_1 = (EditText) findViewById(R.id.bg_value_1);
                    EditText value_2 = (EditText) findViewById(R.id.bg_value_2);
                    String string_value_1 = value_1.getText().toString();
                    String string_value_2 = value_2.getText().toString();

                    if (!TextUtils.isEmpty(string_value_1)){
                        if(!TextUtils.isEmpty(string_value_2)) {
                            double calValue_1 = Double.parseDouble(string_value_1);
                            double calValue_2 = Double.parseDouble(string_value_2);
                            Calibration.initialCalibration(calValue_1, calValue_2, getApplicationContext());
                            Intent tableIntent = new Intent(v.getContext(), Home.class);
                            startActivity(tableIntent);
                            finish();
                        } else {
                            value_2.setError("Calibration Can Not be blank");
                        }
                    } else {
                        value_1.setError("Calibration Can Not be blank");
                    }
                } else {
                    Log.w("DoubleCalibration", "ERROR");
                }
            }
        });

    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/FakeNumbers.java
================================================
package com.eveningoutpost.dexdrip;

import java.util.Date;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TimePicker;

import com.eveningoutpost.dexdrip.Models.BgReading;


public class FakeNumbers extends Activity {
    public Button button;
    public DatePicker dp;
    public TimePicker tp;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fake_numbers);

        button = (Button)findViewById(R.id.log);
        addListenerOnButton();

    }

    public void addListenerOnButton() {

        button = (Button)findViewById(R.id.log);

        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                EditText value = (EditText) findViewById(R.id.bg_value);
                int intValue = Integer.parseInt(value.getText().toString());

                BgReading bgReading = BgReading.create(intValue * 1000, getApplicationContext(), new Date().getTime());
                Intent intent = new Intent(getApplicationContext(), Home.class);
                startActivity(intent);
                finish();
            }

        });
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/Home.java
================================================
package com.eveningoutpost.dexdrip;

import android.app.Activity;
import android.app.NotificationManager;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.Paint;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.support.v4.widget.DrawerLayout;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;

import com.eveningoutpost.dexdrip.Models.ActiveBluetoothDevice;
import com.eveningoutpost.dexdrip.Models.BgReading;
import com.eveningoutpost.dexdrip.Models.Calibration;
import com.eveningoutpost.dexdrip.Services.WixelReader;
import com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder;
import com.eveningoutpost.dexdrip.UtilityModels.CollectionServiceStarter;
import com.eveningoutpost.dexdrip.UtilityModels.Intents;
import com.eveningoutpost.dexdrip.UtilityModels.Notifications;
import com.eveningoutpost.dexdrip.utils.DatabaseUtil;
import com.eveningoutpost.dexdrip.utils.ShareNotification;


import java.io.File;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;

import lecho.lib.hellocharts.ViewportChangeListener;
import lecho.lib.hellocharts.gesture.ZoomType;
import lecho.lib.hellocharts.model.Viewport;
import lecho.lib.hellocharts.view.LineChartView;
import lecho.lib.hellocharts.view.PreviewLineChartView;


public class Home extends Activity implements NavigationDrawerFragment.NavigationDrawerCallbacks {
    private String menu_name = "xDrip";
    private NavigationDrawerFragment mNavigationDrawerFragment;
    private LineChartView chart;
    private PreviewLineChartView previewChart;
    SharedPreferences prefs;
    Viewport tempViewport = new Viewport();
    Viewport holdViewport = new Viewport();
    public float left;
    public float right;
    public float top;
    public float bottom;
    public boolean updateStuff;
    public boolean updatingPreviewViewport = false;
    public boolean updatingChartViewport = false;
    boolean isBTWixel;
    boolean isBTShare;
    boolean isWifiWixel;

    public BgGraphBuilder bgGraphBuilder;
    BroadcastReceiver _broadcastReceiver;
    BroadcastReceiver newDataReceiver;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        CollectionServiceStarter collectionServiceStarter = new CollectionServiceStarter(getApplicationContext());
        collectionServiceStarter.start(getApplicationContext());
        PreferenceManager.setDefaultValues(this, R.xml.pref_notifications, false);
        PreferenceManager.setDefaultValues(this, R.xml.pref_data_source, false);
        prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        checkEula();
        setContentView(R.layout.activity_home);
    }

    public void checkEula() {
        boolean IUnderstand = prefs.getBoolean("I_understand", false);
        if (!IUnderstand) {
            Intent intent = new Intent(getApplicationContext(), LicenseAgreementActivity.class);
            startActivity(intent);
            finish();
        }
    }

    @Override
    protected void onResume(){
        super.onResume();
        checkEula();
        _broadcastReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context ctx, Intent intent) {
                if (intent.getAction().compareTo(Intent.ACTION_TIME_TICK) == 0) {
                    updateCurrentBgInfo();
                }
            }
        };
        newDataReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context ctx, Intent intent) {
                holdViewport.set(0, 0, 0, 0);
                setupCharts();
                updateCurrentBgInfo();
            }
        };
        registerReceiver(_broadcastReceiver, new IntentFilter(Intent.ACTION_TIME_TICK));
        registerReceiver(newDataReceiver, new IntentFilter(Intents.ACTION_NEW_BG_ESTIMATE_NO_DATA));
        mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
        mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);
        holdViewport.set(0, 0, 0, 0);
        setupCharts();
        updateCurrentBgInfo();
    }

    public void setupCharts() {
        bgGraphBuilder = new BgGraphBuilder(this);
        updateStuff = false;
        chart = (LineChartView) findViewById(R.id.chart);
        chart.setZoomType(ZoomType.HORIZONTAL);

        previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
        previewChart.setZoomType(ZoomType.HORIZONTAL);

        chart.setLineChartData(bgGraphBuilder.lineData());
        previewChart.setLineChartData(bgGraphBuilder.previewLineData());
        updateStuff = true;

        previewChart.setViewportCalculationEnabled(true);
        chart.setViewportCalculationEnabled(true);
        previewChart.setViewportChangeListener(new ViewportListener());
        chart.setViewportChangeListener(new ChartViewPortListener());
        setViewport();
    }

    private class ChartViewPortListener implements ViewportChangeListener {
        @Override
        public void onViewportChanged(Viewport newViewport) {
            if (!updatingPreviewViewport) {
                updatingChartViewport = true;
                previewChart.setZoomType(ZoomType.HORIZONTAL);
                previewChart.setCurrentViewport(newViewport, false);
                updatingChartViewport = false;
            }
        }
    }

    private class ViewportListener implements ViewportChangeListener {
        @Override
        public void onViewportChanged(Viewport newViewport) {
            if (!updatingChartViewport) {
                updatingPreviewViewport = true;
                chart.setZoomType(ZoomType.HORIZONTAL);
                chart.setCurrentViewport(newViewport, false);
                tempViewport = newViewport;
                updatingPreviewViewport = false;
            }
            if (updateStuff == true) {
                holdViewport.set(newViewport.left, newViewport.top, newViewport.right, newViewport.bottom);
            }
        }

    }

    @Override
    public void onNavigationDrawerItemSelected(int position) {
        mNavigationDrawerFragment.swapContext(position);
    }

    public void setViewport() {
        if (tempViewport.left == 0.0 || holdViewport.left == 0.0 || holdViewport.right  >= (new Date().getTime())) {
            previewChart.setCurrentViewport(bgGraphBuilder.advanceViewport(chart, previewChart), false);
        } else {
            previewChart.setCurrentViewport(holdViewport, false);
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        if (_broadcastReceiver != null) {
            unregisterReceiver(_broadcastReceiver);
        }
        if(newDataReceiver != null) {
            unregisterReceiver(newDataReceiver);
        }
    }

    public void updateCurrentBgInfo() {
        final TextView currentBgValueText = (TextView) findViewById(R.id.currentBgValueRealTime);
        final TextView notificationText = (TextView)findViewById(R.id.notices);
        notificationText.setText("");
        isBTWixel = CollectionServiceStarter.isBTWixel(getApplicationContext());
        isBTShare = CollectionServiceStarter.isBTShare(getApplicationContext());
        isWifiWixel = CollectionServiceStarter.isWifiWixel(getApplicationContext());
        if(isBTShare) {
            if((android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)) {
                notificationText.setText("Unfortunately your android version does not support Bluetooth Low Energy");
            } else {
                String receiverSn = prefs.getString("share_key", "SM00000000").toUpperCase();
                if (receiverSn.compareTo("SM00000000") == 0 || receiverSn.length() == 0) {
                    notificationText.setText("Please set your Dex Receiver Serial Number in App Settings");
                } else {
                    if (receiverSn.length() < 10) {
                        notificationText.setText("Double Check Dex Receiver Serial Number, should be 10 characters, don't forget the letters");
                    } else {
                        if (ActiveBluetoothDevice.first() == null) {
                            notificationText.setText("Now pair with your Dexcom Share");
                        } else {
                            if (!Sensor.isActive()) {
                                notificationText.setText("Now choose start your sensor in your settings");
                            } else {
                                displayCurrentInfo();
                            }
                        }
                    }
                }
            }
        }
        if(isBTWixel) {
            if ((android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)) {
                notificationText.setText("Unfortunately your android version does not support Bluetooth Low Energy");
            } else {
                if (ActiveBluetoothDevice.first() == null) {
                    notificationText.setText("First pair with your BT device!");
                } else {
                    if (Sensor.isActive() && (Sensor.currentSensor().started_at + (60000 * 60 * 2)) < new Date().getTime()) {
                        if (BgReading.latest(2).size() > 1) {
                            List<Calibration> calibrations = Calibration.latest(2);
                            if (calibrations.size() > 1) {
                                if (calibrations.get(0).possible_bad != null && calibrations.get(0).possible_bad == true && calibrations.get(1).possible_bad != null && calibrations.get(1).possible_bad != true) {
                                    notificationText.setText("Possible bad calibration slope, please have a glass of water, wash hands, then recalibrate in a few!");
                                }
                                displayCurrentInfo();
                            } else {
                                notificationText.setText("Please enter two calibrations to get started!");
                            }
                        } else {
                            if(BgReading.latestUnCalculated(2).size() < 2) {
                                notificationText.setText("Please wait, need 2 readings from transmitter first.");
                            } else {
                                List<Calibration> calibrations = Calibration.latest(2);
                                if (calibrations.size() < 2) {
                                    notificationText.setText("Please enter two calibrations to get started!");
                                }
                            }
                        }
                    } else if (Sensor.isActive() && ((Sensor.currentSensor().started_at + (60000 * 60 * 2))) >= new Date().getTime()) {
                        double waitTime = ((Sensor.currentSensor().started_at + (60000 * 60 * 2)) - (new Date().getTime())) / (60000);
                        notificationText.setText("Please wait while sensor warms up! (" + String.format("%.2f", waitTime) + " minutes)");
                    } else {
                        notificationText.setText("Now start your sensor");
                    }
                }
            }
        }
        if(isWifiWixel) {
            if (!WixelReader.IsConfigured(getApplicationContext())) {
                notificationText.setText("First configure your wifi wixel reader ip addresses");
            } else {
                if (Sensor.isActive() && (Sensor.currentSensor().started_at + (60000 * 60 * 2)) < new Date().getTime()) {
                    if (BgReading.latest(2).size() > 1) {
                        List<Calibration> calibrations = Calibration.latest(2);
                        if (calibrations.size() > 1) {
                            if (calibrations.get(0).possible_bad != null && calibrations.get(0).possible_bad == true && calibrations.get(1).possible_bad != null && calibrations.get(1).possible_bad != true) {
                                notificationText.setText("Possible bad calibration slope, please have a glass of water, wash hands, then recalibrate in a few!");
                            }
                            displayCurrentInfo();
                        } else {
                            notificationText.setText("Please enter two calibrations to get started!");
                        }
                    } else {
                        notificationText.setText("Please wait, need 2 readings from transmitter first.");
                    }
                } else if (Sensor.isActive() && ((Sensor.currentSensor().started_at + (60000 * 60 * 2))) >= new Date().getTime()) {
                    double waitTime = ((Sensor.currentSensor().started_at + (60000 * 60 * 2)) - (new Date().getTime())) / (60000);
                    notificationText.setText("Please wait while sensor warms up! (" + String.format("%.2f", waitTime) + " minutes)");
                } else {
                    notificationText.setText("Now start your sensor");
                }
            }
        }
        mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
        mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);
    }

    public void displayCurrentInfo() {
        DecimalFormat df = new DecimalFormat("#");
        df.setMaximumFractionDigits(0);

        final TextView currentBgValueText = (TextView)findViewById(R.id.currentBgValueRealTime);
        final TextView notificationText = (TextView)findViewById(R.id.notices);
        if ((currentBgValueText.getPaintFlags() & Paint.STRIKE_THRU_TEXT_FLAG) > 0) {
            currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG));
        }
        BgReading lastBgreading = BgReading.lastNoSenssor();
        boolean predictive = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean("predictive_bg", false);
        if(isBTShare) { predictive = false; }
        if (lastBgreading != null) {
            double estimate = 0;
            if ((new Date().getTime()) - (60000 * 11) - lastBgreading.timestamp > 0) {
                notificationText.setText("Signal Missed");
                if(!predictive){
                    estimate=lastBgreading.calculated_value;
                } else {
                    estimate = BgReading.estimated_bg(lastBgreading.timestamp + (6000 * 7));
                }
                currentBgValueText.setText(bgGraphBuilder.unitized_string(estimate));
                currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
            } else {
                if(!predictive){
                    estimate=lastBgreading.calculated_value;
                    String stringEstimate = bgGraphBuilder.unitized_string(estimate);
                    String slope_arrow = BgReading.slopeArrow((lastBgreading.calculated_value_slope * 60000));
                    if(lastBgreading.hide_slope) {
                        slope_arrow = "";
                    }
                    currentBgValueText.setText( stringEstimate + " " + slope_arrow);
                } else {
                    estimate = BgReading.activePrediction();
                    String stringEstimate = bgGraphBuilder.unitized_string(estimate);
                    currentBgValueText.setText( stringEstimate + " " + BgReading.slopeArrow());
                }
            }
            if(bgGraphBuilder.unitized(estimate) <= bgGraphBuilder.lowMark) {
                currentBgValueText.setTextColor(Color.parseColor("#C30909"));
            } else if(bgGraphBuilder.unitized(estimate) >= bgGraphBuilder.highMark) {
                currentBgValueText.setTextColor(Color.parseColor("#FFBB33"));
            } else {
                currentBgValueText.setTextColor(Color.WHITE);
            }
        }
    setupCharts();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_home, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == R.id.action_export_database) {
            new AsyncTask<Void, Void, String>() {
                @Override
                protected String doInBackground(Void... params) {
                    return DatabaseUtil.saveSql(getBaseContext());
                }

                @Override
                protected void onPostExecute(String filename) {
                    super.onPostExecute(filename);

                    final Context ctx = getApplicationContext();

                    Toast.makeText(ctx, "Export stored at " + filename, Toast.LENGTH_SHORT).show();

                    final NotificationCompat.Builder n = new NotificationCompat.Builder(ctx);
                    n.setContentTitle("Export complete");
                    n.setContentText("Ready to be sent.");
                    n.setAutoCancel(true);
                    n.setSmallIcon(R.drawable.ic_action_communication_invert_colors_on);
                    ShareNotification.viewOrShare("application/octet-stream", Uri.fromFile(new File(filename)), n, ctx);

                    final NotificationManager manager = (NotificationManager) ctx.getSystemService(Service.NOTIFICATION_SERVICE);
                    manager.notify(Notifications.exportCompleteNotificationId, n.build());
                }
            }.execute();

            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/CRC16.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class CRC16 {
    public static byte[] calculate(byte[] buff, int start, int end) {
        int crcShort = 0;
        for (int i = start; i < end; i++) {
            crcShort = ((crcShort  >>> 8) | (crcShort  << 8) )& 0xffff;
            crcShort ^= (buff[i] & 0xff);
            crcShort ^= ((crcShort & 0xff) >> 4);
            crcShort ^= (crcShort << 12) & 0xffff;
            crcShort ^= ((crcShort & 0xFF) << 5) & 0xffff;
        }
        crcShort &= 0xffff;
        return new byte[] {(byte) (crcShort & 0xff), (byte) ((crcShort >> 8) & 0xff)};
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/CRCFailRuntimeException.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class CRCFailRuntimeException extends RuntimeException {
    public CRCFailRuntimeException(String message){
        super(message);
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/Constants.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class Constants {

    public final static int NULL = 0;
    public final static int ACK = 1;
    public final static int NAK = 2;
    public final static int INVALID_COMMAND = 3;
    public final static int INVALID_PARAM = 4;
    public final static int INCOMPLETE_PACKET_RECEIVED = 5;
    public final static int RECEIVER_ERROR = 6;
    public final static int INVALID_MODE = 7;
    public final static int PING = 10;
    public final static int READ_FIRMWARE_HEADER = 11;
    public final static int READ_DATABASE_PARTITION_INFO = 15;
    public final static int READ_DATABASE_PAGE_RANGE = 16;
    public final static int READ_DATABASE_PAGES = 17;
    public final static int READ_DATABASE_PAGE_HEADER = 18;
    public final static int READ_TRANSMITTER_ID = 25;
    public final static int WRITE_TRANSMITTER_ID = 26;
    public final static int READ_LANGUAGE = 27;
    public final static int WRITE_LANGUAGE = 28;
    public final static int READ_DISPLAY_TIME_OFFSET = 29;
    public final static int WRITE_DISPLAY_TIME_OFFSET = 30;
    public final static int READ_RTC = 31;
    public final static int RESET_RECEIVER = 32;
    public final static int READ_BATTERY_LEVEL = 33;
    public final static int READ_SYSTEM_TIME = 34;
    public final static int READ_SYSTEM_TIME_OFFSET = 35;
    public final static int WRITE_SYSTEM_TIME = 36;
    public final static int READ_GLUCOSE_UNIT = 37;
    public final static int WRITE_GLUCOSE_UNIT = 38;
    public final static int READ_BLINDED_MODE = 39;
    public final static int WRITE_BLINDED_MODE = 40;
    public final static int READ_CLOCK_MODE = 41;
    public final static int WRITE_CLOCK_MODE = 42;
    public final static int READ_DEVICE_MODE = 43;
    public final static int ERASE_DATABASE = 45;
    public final static int SHUTDOWN_RECEIVER = 46;
    public final static int WRITE_PC_PARAMETERS = 47;
    public final static int READ_BATTERY_STATE = 48;
    public final static int READ_HARDWARE_BOARD_ID = 49;
    public final static int READ_FIRMWARE_SETTINGS = 54;
    public final static int READ_ENABLE_SETUP_WIZARD_FLAG = 55;
    public final static int READ_SETUP_WIZARD_STATE = 57;
    public final static int MAX_COMMAND = 59;
    public final static int MAX_POSSIBLE_COMMAND = 255;
    public final static int EGV_VALUE_MASK = 1023;
    public final static int EGV_DISPLAY_ONLY_MASK = 32768;
    public final static int EGV_TREND_ARROW_MASK = 15;
    public final static int EGV_NOISE_MASK = 112;
    public final static float MG_DL_TO_MMOL_L = 0.05556f;
    public final static int CRC_LEN = 2;

    public enum BATTERY_STATES {
        NONE,
        CHARGING,
        NOT_CHARGING,
        NTC_FAULT,
        BAD_BATTERY
    }

    public enum RECORD_TYPES {
        MANUFACTURING_DATA,
        FIRMWARE_PARAMETER_DATA,
        PC_SOFTWARE_PARAMETER,
        SENSOR_DATA,
        EGV_DATA,
        CAL_SET,
        DEVIATION,
        INSERTION_TIME,
        RECEIVER_LOG_DATA,
        RECEIVER_ERROR_DATA,
        METER_DATA,
        USER_EVENT_DATA,
        USER_SETTING_DATA,
        MAX_VALUE
    }

    public enum TREND_ARROW_VALUES {
        NONE(0),
        DOUBLE_UP(1,"\u21C8", "DoubleUp"),
        SINGLE_UP(2,"\u2191", "SingleUp"),
        UP_45(3,"\u2197", "FortyFiveUp"),
        FLAT(4,"\u2192", "Flat"),
        DOWN_45(5,"\u2198", "FortyFiveDown"),
        SINGLE_DOWN(6,"\u2193", "SingleDown"),
        DOUBLE_DOWN(7,"\u21CA", "DoubleDown"),
        NOT_COMPUTABLE(8, "", "NOT_COMPUTABLE"),
        OUT_OF_RANGE(9, "", "OUT_OF_RANGE");

        private String arrowSymbol;
        private String trendName;
        private int myID;

        TREND_ARROW_VALUES(int id, String a, String t) {
            myID=id;
            arrowSymbol = a;
            trendName = t;
        }

        TREND_ARROW_VALUES(int id) {
            this(id,null, null);
        }

        public String Symbol() {
            if (arrowSymbol == null) {
                return "\u2194";
            } else {
                return arrowSymbol;
            }
        }

        public String friendlyTrendName() {
            if (trendName == null) {
                return this.name().replace("_", " ");
            } else {
                return this.trendName;
            }
        }

        public int getID(){
            return myID;
        }

    }

    public enum SPECIALBGVALUES_MGDL {
        NONE("??0", 0),
        SENSORNOTACTIVE("?SN", 1),
        MINIMALLYEGVAB("??2", 2),
        NOANTENNA("?NA", 3),
        SENSOROUTOFCAL("?NC", 5),
        COUNTSAB("?CD", 6),
        ABSOLUTEAB("?AD", 9),
        POWERAB("???", 10),
        RFBADSTATUS("?RF", 12);


        private String name;
        private int val;
        private SPECIALBGVALUES_MGDL(String s, int i){
            name=s;
            val=i;
        }

        public int getValue(){
            return val;
        }

        public String toString(){
            return name;
        }

        public static SPECIALBGVALUES_MGDL getEGVSpecialValue(int val){
            for (SPECIALBGVALUES_MGDL e: values()){
                if (e.getValue()==val)
                    return e;
            }
            return null;
        }

        public static boolean isSpecialValue(int val){
            for (SPECIALBGVALUES_MGDL e: values()){
                if (e.getValue()==val)
                    return true;
            }
            return false;
        }

    }

    public enum InsertionState {
        NONE,
        REMOVED,
        EXPIRED,
        RESIDUAL_DEVIATION,
        COUNTS_DEVIATION,
        SECOND_SESSION,
        OFF_TIME_LOSS,
        STARTED,
        BAD_TRANSMITTER,
        MANUFACTURING_MODE,
        MAX_VALUE
    }

    public enum NOISE {
        NOISE_NONE(0),
        CLEAN(1),
        LIGHT(2),
        MEDIUM(3),
        HEAVY(4),
        NOT_COMPUTED(5),
        MAX(6);

        private final int value;

        private NOISE(int value) {
            this.value = value;
        }

    }

}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/PacketBuilder.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;

import android.util.Log;

import java.util.ArrayList;
import java.util.List;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class PacketBuilder {
    public static final int MAX_PAYLOAD = 1584;
    public static final int MIN_LEN = 6;
    public static final int MAX_LEN = MAX_PAYLOAD + MIN_LEN;
    public static final byte SOF = 0x01;
    public static final int OFFSET_SOF = 0;
    public static final int OFFSET_LENGTH = 1;
    public static final int OFFSET_NULL = 2;
    public static final byte NULL = 0x00;
    public static final int OFFSET_CMD = 3;
    public static final int OFFSET_PAYLOAD = 4;
    public static final int CRC_LEN = 2;
    public static final int HEADER_LEN = 4;
    public ArrayList<Byte> packet;
    public int command;
    public ArrayList<Byte> payload;

    public PacketBuilder(int command) {
        this.command = command;
    }

    public PacketBuilder(int command, ArrayList<Byte> payload) {
        this.command = command;
        this.payload = payload;
    }

    public byte[] compose() {
        packet = new ArrayList<Byte>();
        packet.add(OFFSET_SOF, SOF);
        packet.add(OFFSET_LENGTH, getLength());
        packet.add(OFFSET_NULL, NULL);
        packet.add(OFFSET_CMD, (byte) command);
        if (this.payload != null) { this.packet.addAll(OFFSET_PAYLOAD, this.payload); }
        byte[] crc16 = CRC16.calculate(toBytes(), 0, this.packet.size());
        this.packet.add(crc16[0]);
        this.packet.add(crc16[1]);
        Log.d("ShareTest", "About to start adding to Byte, size: " + this.packet.size());
        return this.toBytes();
    }

    public List<byte[]> composeList() {
        packet = new ArrayList<Byte>();
        packet.add(OFFSET_SOF, SOF);
        packet.add(OFFSET_LENGTH, getLength());
        packet.add(OFFSET_NULL, NULL);
        packet.add(OFFSET_CMD, (byte) command);
        if (this.payload != null) { this.packet.addAll(OFFSET_PAYLOAD, this.payload); }
        byte[] crc16 = CRC16.calculate(toBytes(), 0, this.packet.size());
        this.packet.add(crc16[0]);
        this.packet.add(crc16[1]);
        Log.d("ShareTest", "About to start adding to ByteList, size: " + this.packet.size());
        return this.toBytesList();
    }

    private byte getLength() {
        int packetSize = payload == null ? MIN_LEN : payload.size() + CRC_LEN + HEADER_LEN;

        if (packetSize > MAX_LEN) {
            throw new IndexOutOfBoundsException(packetSize + " bytes, but packet must between "
                    + MIN_LEN + " and " + MAX_LEN + " bytes.");
        }

        return (byte) packetSize;
    }

    public byte[] toBytes() {
        byte[] b = new byte[this.packet.size()];
        for (int i = 0; i < this.packet.size(); i++) {
            b[i] = this.packet.get(i).byteValue();
        }
        return b;
    }

    public List<byte[]> toBytesList() {
        List<byte[]> byteMessages = new ArrayList<byte[]>();
        double totalPacketSize = packet.size();
        int messages =(int) Math.ceil(totalPacketSize/18);
        for(int m = 0; m < messages; m++) {
            int thisPacketSize;
            if (m == messages - 1) {
                thisPacketSize = ((this.packet.size()+2) % 18);
            } else {
                thisPacketSize = (20);
            }
            int offset = m * 18;
            Log.d("ShareTest", "This packet size: " + thisPacketSize);
            byte[] b = new byte[thisPacketSize];
            b[0] = (byte) (m + 1);
            b[1] = (byte) (messages);
            for (int i = 2; i < thisPacketSize; i++) {
                b[i] = packet.get(offset + i - 2).byteValue();
            }
            byteMessages.add(b);
        }
        return byteMessages;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/ReadData.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;

import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbEndpoint;
import android.hardware.usb.UsbInterface;
import android.util.Log;

import com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.driver.CdcAcmSerialDriver;
import com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.driver.UsbSerialDriver;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.CalRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.EGVRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.GenericXMLRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.MeterRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.PageHeader;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.SensorRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.driver.UsbSerialPort;

import org.w3c.dom.Element;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

public class ReadData {

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

    private static final String TAG = ReadData.class.getSimpleName();
    private static final int IO_TIMEOUT = 3000;
    private static final int MIN_LEN = 256;
    private UsbSerialDriver mSerialDevice;
    protected final Object mReadBufferLock = new Object();
    private UsbDeviceConnection mConnection;
    private UsbDevice mDevice;

    public ReadData(){}
    public ReadData(UsbSerialDriver device) {
        mSerialDevice = device;
    }
    public ReadData(UsbSerialDriver device, UsbDeviceConnection connection, UsbDevice usbDevice) {
        mSerialDevice = device;
        mConnection = connection;
        mDevice = usbDevice;
        try {
      mSerialDevice.getPorts().get(0).open(connection);
        } catch(IOException e) {
            Log.w("FAILED WHILE", "trying to open");
        }
//        }
    }

    public EGVRecord[] getRecentEGVs() {
        int recordType = Constants.RECORD_TYPES.EGV_DATA.ordinal();
        int endPage = readDataBasePageRange(recordType);
        return readDataBasePage(recordType, endPage);
    }

    public EGVRecord[] getRecentEGVsPages(int numOfRecentPages) {
        if (numOfRecentPages < 1) {
            throw new IllegalArgumentException("Number of pages must be greater than 1.");
        }
        Log.d(TAG, "Reading EGV page range...");
        int recordType = Constants.RECORD_TYPES.EGV_DATA.ordinal();
        int endPage = readDataBasePageRange(recordType);
        Log.d(TAG, "Reading " + numOfRecentPages + " EGV page(s)...");
        numOfRecentPages = numOfRecentPages - 1;
        EGVRecord[] allPages = new EGVRecord[0];
        for (int i = Math.min(numOfRecentPages,endPage); i >= 0; i--) {
            int nextPage = endPage - i;
            Log.d(TAG, "Reading #" + i + " EGV pages (page number " + nextPage + ")");
            EGVRecord[] ithEGVRecordPage = readDataBasePage(recordType, nextPage);
            EGVRecord[] result = Arrays.copyOf(allPages, allPages.length + ithEGVRecordPage.length);
            System.arraycopy(ithEGVRecordPage, 0, result, allPages.length, ithEGVRecordPage.length);
            allPages = result;
        }
        Log.d(TAG, "Read complete of EGV pages.");
        return allPages;
    }

    public long getTimeSinceEGVRecord(EGVRecord egvRecord) {
        return readSystemTime() - egvRecord.getSystemTimeSeconds();
    }

    public MeterRecord[] getRecentMeterRecords() {
        Log.d(TAG, "Reading Meter page...");
        int recordType = Constants.RECORD_TYPES.METER_DATA.ordinal();
        int endPage = readDataBasePageRange(recordType);
        return readDataBasePage(recordType, endPage);
    }

    public SensorRecord[] getRecentSensorRecords(int numOfRecentPages) {
        if (numOfRecentPages < 1) {
            throw new IllegalArgumentException("Number of pages must be greater than 1.");
        }
        Log.d(TAG, "Reading Sensor page range...");
        int recordType = Constants.RECORD_TYPES.SENSOR_DATA.ordinal();
        int endPage = readDataBasePageRange(recordType);
        Log.d(TAG, "Reading " + numOfRecentPages + " Sensor page(s)...");
        numOfRecentPages = numOfRecentPages - 1;
        SensorRecord[] allPages = new SensorRecord[0];
        for (int i = Math.min(numOfRecentPages,endPage); i >= 0; i--) {
            int nextPage = endPage - i;
            Log.d(TAG, "Reading #" + i + " Sensor pages (page number " + nextPage + ")");
            SensorRecord[] ithSensorRecordPage = readDataBasePage(recordType, nextPage);
            SensorRecord[] result = Arrays.copyOf(allPages, allPages.length + ithSensorRecordPage.length);
            System.arraycopy(ithSensorRecordPage, 0, result, allPages.length, ithSensorRecordPage.length);
            allPages = result;
        }
        Log.d(TAG, "Read complete of Sensor pages.");
        return allPages;
    }

    public CalRecord[] getRecentCalRecords() {
        Log.d(TAG, "Reading Cal Records page range...");
        int recordType = Constants.RECORD_TYPES.CAL_SET.ordinal();
        int endPage = readDataBasePageRange(recordType);
        Log.d(TAG, "Reading Cal Records page...");
        return readDataBasePage(recordType, endPage);
    }
    public byte[] getRecentCalRecordsTest() {
        Log.d(TAG, "Reading Cal Records page range...");
        int recordType = Constants.RECORD_TYPES.CAL_SET.ordinal();
        int endPage = readDataBasePageRange(recordType);
        Log.d(TAG, "Reading Cal Records page...");
        return readDataBasePageTest(recordType, endPage);
    }

    public boolean ping() {
        writeCommand(Constants.PING);
        return read(MIN_LEN).getCommand() == Constants.ACK;
    }

    public int readBatteryLevel() {
        Log.d(TAG, "Reading battery level...");
        writeCommand(Constants.READ_BATTERY_LEVEL);
        byte[] readData = read(MIN_LEN).getData();
        return ByteBuffer.wrap(readData).order(ByteOrder.LITTLE_ENDIAN).getInt();
    }

    public String readSerialNumber() {
        int PAGE_OFFSET = 0;
        byte[] readData = readDataBasePage(Constants.RECORD_TYPES.MANUFACTURING_DATA.ordinal(), PAGE_OFFSET);
        Element md = ParsePage(readData, Constants.RECORD_TYPES.MANUFACTURING_DATA.ordinal());
        return md.getAttribute("SerialNumber");
    }

    public Date readDisplayTime() {
        return Utils.receiverTimeToDate(readSystemTime() + readDisplayTimeOffset());
    }

    public long readSystemTime() {
        Log.d(TAG, "Reading system time...");
        writeCommand(Constants.READ_SYSTEM_TIME);
        byte[] readData = read(MIN_LEN).getData();
        return ByteBuffer.wrap(readData).order(ByteOrder.LITTLE_ENDIAN).getInt() & 0xffffffff;
    }

    public int readDisplayTimeOffset() {
        Log.d(TAG, "Reading display time offset...");
        writeCommand(Constants.READ_DISPLAY_TIME_OFFSET);
        byte[] readData = read(MIN_LEN).getData();
        return ByteBuffer.wrap(readData).order(ByteOrder.LITTLE_ENDIAN).getInt() & 0xffffffff;
    }

    private int readDataBasePageRange(int recordType) {
        ArrayList<Byte> payload = new ArrayList<Byte>();
        Log.d(TAG, "adding Payload");
        payload.add((byte) recordType);
        Log.d(TAG, "Sending write command");
        writeCommand(Constants.READ_DATABASE_PAGE_RANGE, payload);
        Log.d(TAG, "About to call getdata");
        byte[] readData = read(MIN_LEN).getData();
        Log.d(TAG, "Going to return");
        return ByteBuffer.wrap(readData).order(ByteOrder.LITTLE_ENDIAN).getInt(4);
    }

    private <T> T readDataBasePage(int recordType, int page) {
        byte numOfPages = 1;
        if (page < 0){
            throw new IllegalArgumentException("Invalid page requested:" + page);
        }
        ArrayList<Byte> payload = new ArrayList<Byte>();
        payload.add((byte) recordType);
        byte[] pageInt = ByteBuffer.allocate(4).putInt(page).array();
        payload.add(pageInt[3]);
        payload.add(pageInt[2]);
        payload.add(pageInt[1]);
        payload.add(pageInt[0]);
        payload.add(numOfPages);
        writeCommand(Constants.READ_DATABASE_PAGES, payload);
        byte[] readData = read(2122).getData();
        return ParsePage(readData, recordType);
    }
    private byte[] readDataBasePageTest(int recordType, int page) {
        byte numOfPages = 1;
        if (page < 0){
            throw new IllegalArgumentException("Invalid page requested:" + page);
        }
        ArrayList<Byte> payload = new ArrayList<Byte>();
        payload.add((byte) recordType);
        byte[] pageInt = ByteBuffer.allocate(4).putInt(page).array();
        payload.add(pageInt[3]);
        payload.add(pageInt[2]);
        payload.add(pageInt[1]);
        payload.add(pageInt[0]);
        payload.add(numOfPages);
        return writeCommandTest(Constants.READ_DATABASE_PAGES, payload);
    }

    private void writeCommand(int command, ArrayList<Byte> payload) {
        byte[] packet = new PacketBuilder(command, payload).compose();
        if (mSerialDevice != null) {
            try {
//                UsbInterface mDataInterface = mDevice.getInterface(1);
//                UsbEndpoint mWriteEndpoint = mDataInterface.getEndpoint(0);
//                mConnection.bulkTransfer(mWriteEndpoint, packet, packet.length, IO_TIMEOUT);
                  mSerialDevice.getPorts().get(0).write(packet, IO_TIMEOUT);
            } catch (Exception e) {
                Log.e(TAG, "Unable to write to serial device.", e);
            }
        }
    }
    private byte[] writeCommandTest(int command, ArrayList<Byte> payload) {
        byte[] packet = new PacketBuilder(command, payload).compose();
        return packet;
    }
    private void writeCommand(int command) {
        byte[] packet = new PacketBuilder(command).compose();
        if (mSerialDevice != null) {
            try {
//                UsbInterface mDataInterface = mDevice.getInterface(1);
//                UsbEndpoint mWriteEndpoint = mDataInterface.getEndpoint(0);
//                mConnection.bulkTransfer(mWriteEndpoint, packet, packet.length, IO_TIMEOUT);
                mSerialDevice.getPorts().get(0).write(packet, IO_TIMEOUT);
            } catch (Exception e) {
                Log.e(TAG, "Unable to write to serial device.", e);
            }
        }
    }

    private ReadPacket read(int numOfBytes) {
        byte[] readData = new byte[numOfBytes];
        int len = 0;
        try {
//            UsbInterface mDataInterface = mDevice.getInterface(1);
//            UsbEndpoint mReadEndpoint = mDataInterface.getEndpoint(1);
//            byte[] mReadBuffer;
//            mReadBuffer = new byte[16 * 1024];
//
//            int readAmt = Math.min(readData.length, mReadBuffer.length);
//            synchronized (mReadBufferLock) {
//
//
//                Log.d(TAG, "Read about to call bulk transfer.");
//                if (len < 0) {
//                    // This sucks: we get -1 on timeout, not 0 as preferred.
//                    // We *should* use UsbRequest, except it has a bug/api oversight
//                    // where there is no way to determine the number of bytes read
//                    // in response :\ -- http://b.android.com/28023
//                    if (IO_TIMEOUT == Integer.MAX_VALUE) {
//                        // Hack: Special case "~infinite timeout" as an error.
//                        len = -1;
//                    }
//                    len = 0;
//                }
//
////              System.arraycopy(mReadBuffer, 0, readData, 0, readAmt);
//            }
//            len = mConnection.bulkTransfer(mReadEndpoint, readData, readAmt, IO_TIMEOUT);

            len = mSerialDevice.getPorts().get(0).read(readData, IO_TIMEOUT);

            Log.d(TAG, "Read " + len + " byte(s) complete.");

            // Add a 100ms delay for when multiple write/reads are occurring in series
            Thread.sleep(100);

            // TODO: this debug code to print data of the read, should be removed after
            // finding the source of the reading issue
            String bytes = "";
            int readAmount = len;
            for (int i = 0; i < readAmount; i++) bytes += String.format("%02x", readData[i]) + " ";
            Log.d(TAG, "Read data: " + bytes);
            ////////////////////////////////////////////////////////////////////////////////////////

        } catch (Exception e) {
            Log.e(TAG, "Unable to read from serial device.", e);
        }
        byte[] data = Arrays.copyOfRange(readData, 0, len);
        return new ReadPacket(data);
    }

    private <T> T ParsePage(byte[] data, int recordType) {
        int HEADER_LEN = 28;
        PageHeader pageHeader=new PageHeader(data);
        int NUM_REC_OFFSET = 4;
        int numRec = data[NUM_REC_OFFSET];
        int rec_len;

        switch (Constants.RECORD_TYPES.values()[recordType]) {
            case MANUFACTURING_DATA:
                GenericXMLRecord xmlRecord = new GenericXMLRecord(Arrays.copyOfRange(data, HEADER_LEN, data.length - 1));
                return (T) xmlRecord;
            case SENSOR_DATA:
                rec_len = 20;
                SensorRecord[] sensorRecords = new SensorRecord[numRec];
                for (int i = 0; i < numRec; i++) {
                    int startIdx = HEADER_LEN + rec_len * i;
                    sensorRecords[i] = new SensorRecord(Arrays.copyOfRange(data, startIdx, startIdx + rec_len - 1));
                }
                return (T) sensorRecords;
            case EGV_DATA:
                rec_len = 13;
                EGVRecord[] egvRecords = new EGVRecord[numRec];
                for (int i = 0; i < numRec; i++) {
                    int startIdx = HEADER_LEN + rec_len * i;
                    egvRecords[i] = new EGVRecord(Arrays.copyOfRange(data, startIdx, startIdx + rec_len - 1));
                }
                return (T) egvRecords;
            case METER_DATA:
                rec_len = 16;
                MeterRecord[] meterRecords = new MeterRecord[numRec];
                for (int i = 0; i < numRec; i++) {
                    int startIdx = HEADER_LEN + rec_len * i;
                    meterRecords[i] = new MeterRecord(Arrays.copyOfRange(data, startIdx, startIdx + rec_len - 1));
                }
                return (T) meterRecords;
            case CAL_SET:
                rec_len = 249;
                if (pageHeader.getRevision()<=2) {
                    rec_len = 148;
                }
                CalRecord[] calRecords = new CalRecord[numRec];
                for (int i = 0; i < numRec; i++) {
                    int startIdx = HEADER_LEN + rec_len * i;
                    calRecords[i] = new CalRecord(Arrays.copyOfRange(data, startIdx, startIdx + rec_len - 1));
                }
                return (T) calRecords;
            default:
                // Throw error "Database record not supported"
                break;
        }

        return (T) null;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/ReadDataShare.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;

import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattService;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.util.Log;

import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.CalRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.EGVRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.GenericXMLRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.MeterRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.PageHeader;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.SensorRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.driver.UsbSerialDriver;
import com.eveningoutpost.dexdrip.Services.DexCollectionService;
import com.eveningoutpost.dexdrip.Services.DexShareCollectionService;
import com.eveningoutpost.dexdrip.ShareTest;

import org.w3c.dom.Element;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import rx.Observable;
import rx.functions.Action1;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class ReadDataShare {
    byte[] accumulatedResponse;
    private ShareTest mShareTest;
    private DexShareCollectionService mCollectionService;

    public ReadDataShare(ShareTest aShareTest){
        mShareTest = aShareTest;
    }
    public ReadDataShare(DexShareCollectionService collectionService){
        mCollectionService = collectionService;
    }

    public void getRecentEGVs(final Action1<EGVRecord[]> recordListener) {
        final int recordType = Constants.RECORD_TYPES.EGV_DATA.ordinal();
        final Action1<byte[]> fullPageListener = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) { ParsePage(read(0,s).getData(), recordType, recordListener); }
        };
        Action1<Integer> databasePageRangeCaller = new Action1<Integer>() {
            @Override
            public void call(Integer s) { readDataBasePage(recordType, s, fullPageListener); }
        };
        readDataBasePageRange(recordType, databasePageRangeCaller);
    }

    public void getRecentMeterRecords(final Action1<MeterRecord[]> recordListener) {
        final int recordType = Constants.RECORD_TYPES.METER_DATA.ordinal();
        final Action1<byte[]> fullPageListener = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) { ParsePage(read(0,s).getData(), recordType, recordListener); }
        };
        Action1<Integer> databasePageRangeCaller = new Action1<Integer>() {
            @Override
            public void call(Integer s) { readDataBasePage(recordType, s, fullPageListener); }
        };
        readDataBasePageRange(recordType, databasePageRangeCaller);
    }

    public void getRecentCalRecords(final Action1<CalRecord[]> recordListener) {
        final int recordType = Constants.RECORD_TYPES.CAL_SET.ordinal();
        final Action1<byte[]> fullPageListener = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) { ParsePage(read(0,s).getData(), recordType, recordListener); }
        };
        Action1<Integer> databasePageRangeCaller = new Action1<Integer>() {
            @Override
            public void call(Integer s) { readDataBasePage(recordType, s, fullPageListener); }
        };
        readDataBasePageRange(recordType, databasePageRangeCaller);
    }


    public void getRecentSensorRecords(final Action1<SensorRecord[]> recordListener) {
        final int recordType = Constants.RECORD_TYPES.SENSOR_DATA.ordinal();
        final Action1<byte[]> fullPageListener = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) { ParsePage(read(0,s).getData(), recordType, recordListener); }
        };
        Action1<Integer> databasePageRangeCaller = new Action1<Integer>() {
            @Override
            public void call(Integer s) { readDataBasePage(recordType, s, fullPageListener); }
        };
        readDataBasePageRange(recordType, databasePageRangeCaller);
    }

    public void getTimeSinceEGVRecord(final EGVRecord egvRecord, final Action1<Long> timeSinceEgvRecord) {
        Action1<Long> tempSystemTimeListener = new Action1<Long>() {
            @Override
            public void call(Long s) { Observable.just(s - egvRecord.getSystemTimeSeconds()).subscribe(timeSinceEgvRecord); }
        };
        readSystemTime(tempSystemTimeListener);
    }

    public void ping(final Action1<Boolean> pingListener) {
        Action1<byte[]> pingReader = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) { Observable.just(read(0, s).getCommand() == Constants.ACK).subscribe(pingListener); }
        };
        writeCommand(Constants.PING, pingReader);
    }

    public void readBatteryLevel(final Action1<Integer> batteryLevelListener) {
        Action1<byte[]> batteryLevelReader = new Action1<byte[]>() {
            @Override //TODO: find out if this should be wrapped in read(s).getData();
            public void call(byte[] s) { Observable.just(ByteBuffer.wrap(s).order(ByteOrder.LITTLE_ENDIAN).getInt()).subscribe(batteryLevelListener); }
        };
        writeCommand(Constants.READ_BATTERY_LEVEL, batteryLevelReader);
    }

    public void readSerialNumber(final Action1<String> serialNumberListener) {
        final Action1<byte[]> manufacturingDataListener = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) {
                Element el = ParsePage(s, Constants.RECORD_TYPES.MANUFACTURING_DATA.ordinal());
                Observable.just(el.getAttribute("SerialNumber")).subscribe(serialNumberListener);
            }
        };
        readDataBasePage(Constants.RECORD_TYPES.MANUFACTURING_DATA.ordinal(), 0, manufacturingDataListener);
    }

    public void readDisplayTime(final Action1<Date> displayTimeListener) {
        Action1<Long> tempSystemTimeListener = new Action1<Long>() {
            @Override
            public void call(Long s) {
                final long systemTime = s;
                Action1<Long> tempSystemTimeListener = new Action1<Long>() {
                    @Override
                    public void call(Long s) {
                        Date dateDisplayTime = Utils.receiverTimeToDate(systemTime + s);
                        Observable.just(dateDisplayTime).subscribe(displayTimeListener); }
                };
                readDisplayTimeOffset(tempSystemTimeListener);
            }
        };
        readSystemTime(tempSystemTimeListener);
    }

    public void readSystemTime(final Action1<Long> systemTimeListener) {
        Action1<byte[]> systemTimeReader = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) {
                Observable.just(Utils.receiverTimeToDate(ByteBuffer.wrap(read(0,s).getData()).order(ByteOrder.LITTLE_ENDIAN).getInt()).getTime()).subscribe(systemTimeListener);
            }
        };
        writeCommand(Constants.READ_SYSTEM_TIME, systemTimeReader);
    }

    public void readDisplayTimeOffset(final Action1<Long> displayTimeOffsetListener) {
        Action1<byte[]> displayTimeOffsetReader = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) { Observable.just((long) ByteBuffer.wrap(read(0,s).getData()).order(ByteOrder.LITTLE_ENDIAN).getInt()).subscribe(displayTimeOffsetListener); }
        };
        writeCommand(Constants.READ_DISPLAY_TIME_OFFSET, displayTimeOffsetReader);
    }

    private void readDataBasePageRange(int recordType, final Action1<Integer> databasePageRangeCaller) {
        ArrayList<Byte> payload = new ArrayList<Byte>();
        payload.add((byte) recordType);
        final Action1<byte[]> databasePageRangeListener = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) {
                Observable.just(ByteBuffer.wrap(new ReadPacket(s).getData()).order(ByteOrder.LITTLE_ENDIAN).getInt(4)).subscribe(databasePageRangeCaller);
            }
        };
        writeCommand(Constants.READ_DATABASE_PAGE_RANGE, payload, databasePageRangeListener);
    }

    private <T> T readDataBasePage(final int recordType, int page, final Action1<byte[]> fullPageListener) {
        byte numOfPages = 1;
        if (page < 0){ throw new IllegalArgumentException("Invalid page requested:" + page); }
        ArrayList<Byte> payload = new ArrayList<Byte>();
        payload.add((byte) recordType);
        byte[] pageInt = ByteBuffer.allocate(4).putInt(page).array();
        payload.add(pageInt[3]);
        payload.add(pageInt[2]);
        payload.add(pageInt[1]);
        payload.add(pageInt[0]);
        payload.add(numOfPages);
        accumulatedResponse = null;
        final Action1<byte[]> databasePageReader = new Action1<byte[]>() {
            @Override
            public void call(byte[] s) {
                Log.d("ShareTest", "Database Page Reader received SIZE: " + s.length);
                byte[] temp = s;
                if (accumulatedResponse == null) {
                    accumulatedResponse = s;
                } else {
                    try {
                        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                        outputStream.write(accumulatedResponse);
                        outputStream.write(temp);
                        accumulatedResponse = outputStream.toByteArray();
                        Log.d("ShareTest", "Combined Response length: " + accumulatedResponse.length);
                    } catch (Exception e) { e.printStackTrace(); }
                }
                if (temp.length < 20) { Observable.just(accumulatedResponse).subscribe(fullPageListener).unsubscribe(); }
            }
        };
        writeCommand(Constants.READ_DATABASE_PAGES, payload, databasePageReader);
        return null;
    }

    private void writeCommand(int command, ArrayList<Byte> payload, Action1<byte[]> responseListener) {
        List<byte[]> packets = new PacketBuilder(command, payload).composeList();
        if(mShareTest != null) { mShareTest.writeCommand(packets, 0, responseListener); }
        else if (mCollectionService != null) { mCollectionService.writeCommand(packets, 0, responseListener); }
    }

    private void writeCommand(int command, Action1<byte[]> responseListener) {
        List<byte[]> packets = new PacketBuilder(command).composeList();
        if(mShareTest != null) { mShareTest.writeCommand(packets, 0, responseListener); }
        else if (mCollectionService != null) { mCollectionService.writeCommand(packets, 0, responseListener); }
    }

    private ReadPacket read(int numOfBytes, byte[] readPacket) {
        return new ReadPacket(Arrays.copyOfRange(readPacket, 0, readPacket.length));
    }

    private <T> T ParsePage(byte[] data, int recordType) { return ParsePage(data, recordType, null); }
    private <T> T ParsePage(byte[] data, int recordType, Action1<T> parsedPageReceiver) {
        int HEADER_LEN = 28;
        PageHeader pageHeader=new PageHeader(data);
        int NUM_REC_OFFSET = 4;
        int numRec = data[NUM_REC_OFFSET];
        int rec_len;

        switch (Constants.RECORD_TYPES.values()[recordType]) {
            case MANUFACTURING_DATA:
                GenericXMLRecord xmlRecord = new GenericXMLRecord(Arrays.copyOfRange(data, HEADER_LEN, data.length - 1));
                if(parsedPageReceiver != null) {
                    Observable.just((T) xmlRecord).subscribe(parsedPageReceiver);
                } else {
                    return (T) xmlRecord;
                }
                break;
            case SENSOR_DATA:
                rec_len = 20;
                SensorRecord[] sensorRecords = new SensorRecord[numRec];
                for (int i = 0; i < numRec; i++) {
                    int startIdx = HEADER_LEN + rec_len * i;
                    sensorRecords[i] = new SensorRecord(Arrays.copyOfRange(data, startIdx, startIdx + rec_len - 1));
                }
                if(parsedPageReceiver != null) {
                    Observable.just((T) sensorRecords).subscribe(parsedPageReceiver);
                } else {
                    return (T) sensorRecords;
                }
                break;
            case EGV_DATA:
                rec_len = 13;
                EGVRecord[] egvRecords = new EGVRecord[numRec];
                for (int i = 0; i < numRec; i++) {
                    int startIdx = HEADER_LEN + rec_len * i;
                    egvRecords[i] = new EGVRecord(Arrays.copyOfRange(data, startIdx, startIdx + rec_len - 1));
                }
                if(parsedPageReceiver != null) {
                    Observable.just((T) egvRecords).subscribe(parsedPageReceiver);
                } else {
                    return (T) egvRecords;
                }
                break;
            case METER_DATA:
                rec_len = 16;
                MeterRecord[] meterRecords = new MeterRecord[numRec];
                for (int i = 0; i < numRec; i++) {
                    int startIdx = HEADER_LEN + rec_len * i;
                    meterRecords[i] = new MeterRecord(Arrays.copyOfRange(data, startIdx, startIdx + rec_len - 1));
                }
                if(parsedPageReceiver != null) {
                    Observable.just((T) meterRecords).subscribe(parsedPageReceiver);
                } else {
                    return (T) meterRecords;
                }
                break;
            case CAL_SET:
                rec_len = 249;
                if (pageHeader.getRevision()<=2) { rec_len = 148; }
                CalRecord[] calRecords = new CalRecord[numRec];
                for (int i = 0; i < numRec; i++) {
                    int startIdx = HEADER_LEN + rec_len * i;
                    calRecords[i] = new CalRecord(Arrays.copyOfRange(data, startIdx, startIdx + rec_len - 1));
                }
                if(parsedPageReceiver != null) {
                    Observable.just((T) calRecords).subscribe(parsedPageReceiver);
                } else {
                    return (T) calRecords;
                }
                break;
            default:
                break;
        }
        Observable.just((T) null).subscribe(parsedPageReceiver);
        return (T) null;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/ReadPacket.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;

import java.util.Arrays;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project


public class ReadPacket {
    private int command;
    private byte[] data;
    private byte[] crc_calc;
    private byte[] crc;
    private int OFFSET_CMD = 3;
    private int OFFSET_DATA = 4;
    private int CRC_LEN = 2;

    public ReadPacket(byte[] readPacket) {
        this.command = readPacket[OFFSET_CMD];
        this.data = Arrays.copyOfRange(readPacket, OFFSET_DATA, readPacket.length - CRC_LEN);
        this.crc = Arrays.copyOfRange(readPacket, readPacket.length - CRC_LEN, readPacket.length);
        this.crc_calc=CRC16.calculate(readPacket, 0, readPacket.length - 2);
        if (!Arrays.equals(this.crc, this.crc_calc)) {
            throw new CRCFailRuntimeException("CRC check failed: " + Utils.bytesToHex(this.crc) + " vs " + Utils.bytesToHex(this.crc_calc));
        }
    }

    public int getCommand() {
        return command;
    }

    public byte[] getData() {
        return data;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/SyncingService.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;

import android.app.IntentService;
import android.bluetooth.BluetoothClass;
import android.content.Intent;
import android.content.Context;
import android.content.SharedPreferences;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbManager;
import android.os.PowerManager;
import android.preference.PreferenceManager;
import android.util.Log;
import android.widget.Toast;

import com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.driver.CdcAcmSerialDriver;
import com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.driver.ProbeTable;
import com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.driver.UsbSerialDriver;
import com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.driver.UsbSerialProber;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.CalRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.EGVRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.GlucoseDataSet;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.MeterRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.SensorRecord;
import com.eveningoutpost.dexdrip.Models.Calibration;

import org.json.JSONArray;

import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project


/**
 * An {@link IntentService} subclass for handling asynchronous CGM Receiver downloads and cloud uploads
 * requests in a service on a separate handler thread.
 */
public class SyncingService extends IntentService {

    // Action for intent
    private static final String ACTION_SYNC = "com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.action.SYNC";
    private static final String ACTION_CALIBRATION_CHECKIN = "com.eveningoutpost.dexdrip.CalibrationCheckInActivity";

    // Parameters for intent
    private static final String SYNC_PERIOD = "com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.extra.SYNC_PERIOD";

    // Response to broadcast to activity
    public static final String RESPONSE_SGV = "mySGV";
    public static final String RESPONSE_TREND = "myTrend";
    public static final String RESPONSE_TIMESTAMP = "myTimestamp";
    public static final String RESPONSE_NEXT_UPLOAD_TIME = "myUploadTime";
    public static final String RESPONSE_UPLOAD_STATUS = "myUploadStatus";
    public static final String RESPONSE_DISPLAY_TIME = "myDisplayTime";
    public static final String RESPONSE_JSON = "myJSON";
    public static final String RESPONSE_BAT = "myBatLvl";

    private final String TAG = SyncingService.class.getSimpleName();
    private Context mContext;
    private UsbManager mUsbManager;
    private UsbSerialDriver mSerialDevice;
    private UsbDevice dexcom;
    private UsbDeviceConnection mConnection;

    // Constants
    private final int TIME_SYNC_OFFSET = 10000;
    public static final int MIN_SYNC_PAGES = 2;
    public static final int GAP_SYNC_PAGES = 20;


    /**
     * Starts this service to perform action Single Sync with the given parameters. If
     * the service is already performing a task this action will be queued.
     *
     * @see IntentService
     */
    public static void startActionSingleSync(Context context, int numOfPages) {
        Intent intent = new Intent(context, SyncingService.class);
        intent.setAction(ACTION_SYNC);
        intent.putExtra(SYNC_PERIOD, numOfPages);
        context.startService(intent);
    }
    public static void startActionCalibrationCheckin(Context context) {
        Intent intent = new Intent(context, SyncingService.class);
        intent.setAction(ACTION_CALIBRATION_CHECKIN);
        context.startService(intent);
    }
    public SyncingService() {
        super("SyncingService");
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        mContext = getApplicationContext();
        if (intent != null) {
            final String action = intent.getAction();
            if (ACTION_SYNC.equals(action)) {
                final int param1 = intent.getIntExtra(SYNC_PERIOD, 1);
                handleActionSync(param1);
            } else if (ACTION_CALIBRATION_CHECKIN.equals(action)) {
                Log.w("CALIBRATION-CHECK-IN: ", "Beginning check in process");
                performCalibrationCheckin();
            }
        }
    }

    /**
     * Handle action Sync in the provided background thread with the provided
     * parameters.
     */
    private void performCalibrationCheckin(){
        PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
        PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "NSDownload");
        wl.acquire();
        Log.w("CALIBRATION-CHECK-IN: ", "Wake Lock Acquired");
        if (acquireSerialDevice()) {
            try {
                ReadData readData = new ReadData(mSerialDevice, mConnection, dexcom);

//                ReadData readData = new ReadData(mSerialDevice);
                CalRecord[] calRecords = readData.getRecentCalRecords();
                Log.w("CALIBRATION-CHECK-IN: ", "Found "+ calRecords.length + " Records!");
                save_most_recent_cal_record(calRecords);

            } catch (Exception e) {
                Log.wtf("Unhandled exception caught", e);
            } finally {
                // Close serial
                try {
                    mSerialDevice.getPorts().get(0).close();
                } catch (IOException e) {
                    Log.e(TAG, "Unable to close", e);
                }

            }
        } else {
            Log.w("CALIBRATION-CHECK-IN: ", "Failed to acquire serial device");
        }
    }

    private void handleActionSync(int numOfPages) {
        boolean broadcastSent = false;

        PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
        PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "NSDownload");
        wl.acquire();

        if (acquireSerialDevice()) {
            try {

                ReadData readData = new ReadData(mSerialDevice);
                // TODO: need to check if numOfPages if valid on ReadData side
                EGVRecord[] recentRecords = readData.getRecentEGVsPages(numOfPages);
                MeterRecord[] meterRecords = readData.getRecentMeterRecords();
                // TODO: need to check if numOfPages if valid on ReadData side
                SensorRecord[] sensorRecords = readData.getRecentSensorRecords(numOfPages);
                GlucoseDataSet[] glucoseDataSets = Utils.mergeGlucoseDataRecords(recentRecords, sensorRecords);

                // FIXME: This is a workaround for the new Dexcom AP which seems to have a new format
                SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
                CalRecord[] calRecords = new CalRecord[1];
                if (prefs.getBoolean("cloud_cal_data", false)) {
                    calRecords = readData.getRecentCalRecords();
                }

                long timeSinceLastRecord = readData.getTimeSinceEGVRecord(recentRecords[recentRecords.length - 1]);
                // TODO: determine if the logic here is correct. I suspect it assumes the last record was less than 5
                // minutes ago. If a reading is skipped and the device is plugged in then nextUploadTime will be
                // set to a negative number. This situation will eventually correct itself.
                long nextUploadTime = (1000 * 60 * 5) - (timeSinceLastRecord * (1000));
                long displayTime = readData.readDisplayTime().getTime();
                // FIXME: Device seems to flake out on battery level reads. Removing for now.
//                int batLevel = readData.readBatteryLevel();
                int batLevel = 100;

                // convert into json for d3 plot
                JSONArray array = new JSONArray();
                for (int i = 0; i < recentRecords.length; i++) array.put(recentRecords[i].toJSON());

                EGVRecord recentEGV = recentRecords[recentRecords.length - 1];
//                broadcastSGVToUI(recentEGV, uploadStatus, nextUploadTime + TIME_SYNC_OFFSET,
//                                 displayTime, array ,batLevel);
                broadcastSent=true;
            } catch (ArrayIndexOutOfBoundsException e) {
                Log.wtf("Unable to read from the dexcom, maybe it will work next time", e);
            } catch (NegativeArraySizeException e) {
                Log.wtf("Negative array exception from receiver", e);
            } catch (IndexOutOfBoundsException e) {
                Log.wtf("IndexOutOfBounds exception from receiver", e);
            } catch (CRCFailRuntimeException e){
                // FIXME: may consider localizing this catch at a lower level (like ReadData) so that
                // if the CRC check fails on one type of record we can capture the values if it
                // doesn't fail on other types of records. This means we'd need to broadcast back
                // partial results to the UI. Adding it to a lower level could make the ReadData class
                // more difficult to maintain - needs discussion.
                Log.wtf("CRC failed", e);
            } catch (Exception e) {
                Log.wtf("Unhandled exception caught", e);
            } finally {
                // Close serial
                try {
                    mSerialDevice.getPorts().get(0).close();
                } catch (IOException e) {

                    Log.e(TAG, "Unable to close", e);
                }

            }
        }
//        if (!broadcastSent) broadcastSGVToUI();

        wl.release();
    }

    private void save_most_recent_cal_record(CalRecord[] calRecords) {
        int size = calRecords.length;
        Calibration.create(calRecords,getApplicationContext(), false, 0);
    }

    private boolean acquireSerialDevice() {
        UsbDevice found_device = findDexcom();

        if(mUsbManager == null) {
            Log.w("CALIBRATION-CHECK-IN: ", "USB manager is null");
        }


        if( mUsbManager.hasPermission(dexcom)) {                                           // the system is allowing us to poke around this device

            ProbeTable customTable = new ProbeTable();                                           // From the USB library...
            customTable.addProduct(0x22A3, 0x0047, CdcAcmSerialDriver.class);       // ...Specify the Vendor ID and Product ID

            UsbSerialProber prober = new UsbSerialProber(customTable);                      // Probe the device with the custom values
            List<UsbSerialDriver> drivers = prober.findAllDrivers(mUsbManager);            // let's go through the list
            Iterator<UsbSerialDriver> foo = drivers.iterator();                                                                                                  // Invalid Return code
            while (foo.hasNext()) {                                                         // let's loop through
                UsbSerialDriver driver = foo.next();                                        // set fooDriver to the next available driver
                if (driver != null) {
                    UsbDeviceConnection connection = mUsbManager.openDevice(driver.getDevice());
                    if (connection != null) {
                        mSerialDevice = driver;

                        mConnection = connection;
                        Log.w("CALIBRATION-CHECK-IN: ", "CONNECTEDDDD!!");
                        return true;
                    }
                } else {
                    Log.w("CALIBRATION-CHECK-IN: ", "Driver was no good");
                }
            }
            Log.w("CALIBRATION-CHECK-IN: ", "No usable drivers found");
        } else {
            Log.w("CALIBRATION-CHECK-IN: ", "You dont have permissions for that dexcom!!");
        }
        return false;
    }

    static public boolean isG4Connected(Context c){
        UsbManager manager = (UsbManager) c.getSystemService(Context.USB_SERVICE);
        HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
        Log.w("USB DEVICES = ", deviceList.toString());
        Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
        Log.w("USB DEVICES = ", String.valueOf(deviceList.size()));

        while(deviceIterator.hasNext()){
            UsbDevice device = deviceIterator.next();
            if (device.getVendorId() == 8867 && device.getProductId() == 71
                    && device.getDeviceClass() == 2 && device.getDeviceSubclass() ==0
                    && device.getDeviceProtocol() == 0){
                Log.w("CALIBRATION-CHECK-IN: ", "Dexcom Found!");
                return true;
            }
        }
        return false;
    }

    public UsbDevice findDexcom() {
        Log.w("CALIBRATION-CHECK-IN: ", "Searching for dexcom");
        mUsbManager = (UsbManager) getApplicationContext().getSystemService(Context.USB_SERVICE);
        Log.w("USB MANAGER = ", mUsbManager.toString());
        HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();
        Log.w("USB DEVICES = ", deviceList.toString());
        Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
        Log.w("USB DEVICES = ", String.valueOf(deviceList.size()));

        while(deviceIterator.hasNext()){
            UsbDevice device = deviceIterator.next();
            if (device.getVendorId() == 8867 && device.getProductId() == 71
                    && device.getDeviceClass() == 2 && device.getDeviceSubclass() ==0
                    && device.getDeviceProtocol() == 0){
                dexcom = device;
                Log.w("CALIBRATION-CHECK-IN: ", "Dexcom Found!");
                return device;
            } else {
                Log.w("CALIBRATION-CHECK-IN: ", "that was not a dexcom (I dont think)");
            }
        }
        return null;
    }

    private void broadcastSGVToUI(EGVRecord egvRecord, boolean uploadStatus,
                                  long nextUploadTime, long displayTime,
                                  JSONArray json, int batLvl) {
        Log.d(TAG, "Current EGV: " + egvRecord.getBGValue());
        Intent broadcastIntent = new Intent();
//        broadcastIntent.setAction(MainActivity.CGMStatusReceiver.PROCESS_RESPONSE);
        broadcastIntent.addCategory(Intent.CATEGORY_DEFAULT);
        broadcastIntent.putExtra(RESPONSE_SGV, egvRecord.getBGValue());
        broadcastIntent.putExtra(RESPONSE_TREND, egvRecord.getTrend().getID());
        broadcastIntent.putExtra(RESPONSE_TIMESTAMP, egvRecord.getDisplayTime().getTime());
        broadcastIntent.putExtra(RESPONSE_NEXT_UPLOAD_TIME, nextUploadTime);
        broadcastIntent.putExtra(RESPONSE_UPLOAD_STATUS, uploadStatus);
        broadcastIntent.putExtra(RESPONSE_DISPLAY_TIME, displayTime);
        if (json!=null)
            broadcastIntent.putExtra(RESPONSE_JSON, json.toString());
        broadcastIntent.putExtra(RESPONSE_BAT, batLvl);
        sendBroadcast(broadcastIntent);
    }

    private void broadcastSGVToUI() {
        EGVRecord record=new EGVRecord(-1, Constants.TREND_ARROW_VALUES.NONE,new Date(),new Date());
        broadcastSGVToUI(record,false, (long) (1000 * 60 * 5) + TIME_SYNC_OFFSET, new Date().getTime(), null, 0);
    }

}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/Utils.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;

import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.EGVRecord;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.GlucoseDataSet;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records.SensorRecord;

import java.util.Date;
import java.util.TimeZone;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class Utils {

    public static Date receiverTimeToDate(long delta) {
        int currentTZOffset = TimeZone.getDefault().getRawOffset();
        long epochMS = 1230768000000L;  // Jan 01, 2009 00:00 in UTC
        long milliseconds = epochMS - currentTZOffset;
        long timeAdd = milliseconds + (1000L * delta);
        TimeZone tz = TimeZone.getDefault();
        if (tz.inDaylightTime(new Date())) timeAdd = timeAdd - (1000 * 60 * 60);
        return new Date(timeAdd);
    }

    public static String getTimeString(long timeDeltaMS) {
        long minutes = (timeDeltaMS / 1000) / 60;
        long hours = minutes / 60;
        long days = hours / 24;
        long weeks = days / 7;
        minutes= minutes - hours * 60;
        hours = hours - days * 24;
        days= days - weeks * 7;

        String timeAgoString = "";
        if (weeks > 0) {
            timeAgoString += weeks + " weeks ";
        }
        if (days > 0) {
            timeAgoString += days + " days ";
        }
        if (hours > 0) {
            timeAgoString += hours + " hours ";
        }
        if (minutes >= 0) {
            timeAgoString += minutes + " min ";
        }

        return (timeAgoString.equals("") ? "--" : timeAgoString + "ago");
    }

    public static GlucoseDataSet[] mergeGlucoseDataRecords(EGVRecord[] egvRecords,
                                                           SensorRecord[] sensorRecords) {
        int egvLength = egvRecords.length;
        int sensorLength = sensorRecords.length;
        int smallerLength = egvLength < sensorLength ? egvLength : sensorLength;
        GlucoseDataSet[] glucoseDataSets = new GlucoseDataSet[smallerLength];
        for (int i = 1; i <= smallerLength; i++) {
            glucoseDataSets[smallerLength - i] = new GlucoseDataSet(egvRecords[egvLength - i], sensorRecords[sensorLength - i]);
        }
        return glucoseDataSets;
    }

    public static String bytesToHex(byte[] bytes) {
        char[] hexArray = "0123456789ABCDEF".toCharArray();
        char[] hexChars = new char[bytes.length * 3];
        for ( int j = 0; j < bytes.length; j++ ) {
            int v = bytes[j] & 0xFF;
            hexChars[j * 3] = hexArray[v >>> 4];
            hexChars[j * 3 + 1] = hexArray[v & 0x0F];
            hexChars[j * 3 + 2] = " ".toCharArray()[0];
        }
        return new String(hexChars);
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/CalRecord.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;

import android.util.Log;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class CalRecord extends GenericTimestampRecord {
    private static final String TAG = CalRecord.class.getSimpleName();
    private double slope;
    private double intercept;
    private double scale;
    private int[] unk = new int[3];
    private double decay;
    private int  numRecords;
    private CalSubrecord[] calSubrecords = new CalSubrecord[12];
    private int SUB_LEN = 17;

    public CalRecord(byte[] packet) {
        super(packet);
        slope = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getDouble(8);
        intercept = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getDouble(16);
        scale = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getDouble(24);
        unk[0] = packet[32];
        unk[1] = packet[33];
        unk[2] = packet[34];
        decay = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getDouble(35);
        numRecords = packet[43];
        long displayTimeOffset = (getDisplayTime().getTime() - getSystemTime().getTime()) / (1000);
        int start = 44;
        for (int i = 0; i < numRecords; i++) {
            Log.d("CalDebug","Loop #"+i);
            byte[] temp = new byte[SUB_LEN];
            System.arraycopy(packet, start, temp, 0, temp.length);
            calSubrecords[i] = new CalSubrecord(temp, displayTimeOffset);
            start += SUB_LEN;
        }

        Log.d("ShareTest", "slope: " + slope + " intercept: " + intercept);
    }

    public double getSlope() {
        return slope;
    }

    public double getIntercept() {
        return intercept;
    }

    public double getScale() {
        return scale;
    }

    public int[] getUnk() {
        return unk;
    }

    public double getDecay() {
        return decay;
    }

    public int getNumRecords() {
        return numRecords;
    }

    public CalSubrecord[] getCalSubrecords() {
        return calSubrecords;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/CalSubrecord.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;

import android.util.Log;

import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.Utils;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Date;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class CalSubrecord {
    private static final String TAG = CalSubrecord.class.getSimpleName();
    private Date dateEntered;
    private int calBGL;
    private int calRaw;
    private Date dateApplied;
    private byte unk;

    public CalSubrecord(byte[] packet, long displayTimeOffset) {
        int delta = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt();
        dateEntered = Utils.receiverTimeToDate(delta + displayTimeOffset);
        calBGL = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(4);
        calRaw = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(8);
        delta = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(12);
        dateApplied = Utils.receiverTimeToDate(delta + displayTimeOffset);
        unk = packet[16];
    }

    public Date getDateEntered() {
        return dateEntered;
    }

    public int getCalBGL() {
        return calBGL;
    }

    public int getCalRaw() {
        return calRaw;
    }

    public Date getDateApplied() {
        return dateApplied;
    }

    public byte getUnk() {
        return unk;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/EGVRecord.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;

import android.util.Log;

import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.Constants;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;
import java.util.Date;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class EGVRecord extends GenericTimestampRecord {

    private int bGValue;
    private int noise;
    private Constants.TREND_ARROW_VALUES trend;

    public EGVRecord(byte[] packet) {
        // system_time (UInt), display_time (UInt), glucose (UShort), trend_arrow (Byte), crc (UShort))
        super(packet);
        bGValue = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getShort(8) & Constants.EGV_VALUE_MASK;
        byte trendAndNoise = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).get(10);
        int trendValue = trendAndNoise & Constants.EGV_TREND_ARROW_MASK;
        byte noiseValue = (byte) ((trendAndNoise & Constants.EGV_NOISE_MASK) >> 4);
        trend = Constants.TREND_ARROW_VALUES.values()[trendValue];
        noise = noiseValue;
    }

    public EGVRecord(int bGValue,Constants.TREND_ARROW_VALUES trend,Date displayTime, Date systemTime){
        super(displayTime, systemTime);
        this.bGValue=bGValue;
        this.trend=trend;
    }

    public String noiseValue() { return String.valueOf(noise); }
    public int getBGValue() {
        return bGValue;
    }

    public Constants.TREND_ARROW_VALUES getTrend() {
        return trend;
    }

    public JSONObject toJSON() {
        JSONObject obj = new JSONObject();
        try {
            obj.put("sgv", getBGValue());
            obj.put("date", getDisplayTimeSeconds());
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return obj;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/GenericTimestampRecord.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;

import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.Utils;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Date;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class GenericTimestampRecord {

    protected final int OFFSET_SYS_TIME = 0;
    protected final int OFFSET_DISPLAY_TIME = 4;
    protected Date systemTime;
    protected int systemTimeSeconds;
    protected Date displayTime;

    public GenericTimestampRecord(byte[] packet) {
        systemTimeSeconds = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(OFFSET_SYS_TIME);
        systemTime = Utils.receiverTimeToDate(systemTimeSeconds);
        int dt = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(OFFSET_DISPLAY_TIME);
        displayTime = Utils.receiverTimeToDate(dt);
    }

    public GenericTimestampRecord(Date displayTime, Date systemTime){
        this.displayTime=displayTime;
        this.systemTime=systemTime;
    }

    public Date getSystemTime() {
        return systemTime;
    }

    public int getSystemTimeSeconds() {
        return systemTimeSeconds;
    }

    public Date getDisplayTime() {
        return displayTime;
    }
    public long getDisplayTimeSeconds() {
        return displayTime.getTime();
    }

}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/GenericXMLRecord.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;

import android.util.Log;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.Serializable;
import java.io.StringReader;
import java.util.Arrays;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class GenericXMLRecord extends GenericTimestampRecord {
    int XML_START = 8;
    int XML_END = 241;

    private final String TAG = GenericXMLRecord.class.getSimpleName();

    private Element xmlElement;

    public GenericXMLRecord(byte[] packet) {
        super(packet);
        Document document;
        // TODO: it would be best if we could just remove /x00 characters and read till end
        String xml = new String(Arrays.copyOfRange(packet, XML_START, XML_END));
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder;
        try
        {
            builder = factory.newDocumentBuilder();
            document = builder.parse(new InputSource(new StringReader(xml)));
            xmlElement = document.getDocumentElement();
        } catch (Exception e) {
            Log.e(TAG, "Unable to build xml element", e);
        }
    }

    // example: String sn = getXmlElement().getAttribute("SerialNumber");
    public Element getXmlElement() {
        return xmlElement;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/GlucoseDataSet.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;

import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.Constants;

import java.util.Date;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class GlucoseDataSet {

    private Date systemTime;
    private Date displayTime;
    private int bGValue;
    private Constants.TREND_ARROW_VALUES trend;
    private long unfiltered;
    private long filtered;
    private int rssi;

    public GlucoseDataSet(EGVRecord egvRecord, SensorRecord sensorRecord) {
        // TODO check times match between record
        systemTime = egvRecord.getSystemTime();
        displayTime = egvRecord.getDisplayTime();
        bGValue = egvRecord.getBGValue();
        trend = egvRecord.getTrend();
        unfiltered = sensorRecord.getUnfiltered();
        filtered = sensorRecord.getFiltered();
        rssi = sensorRecord.getRSSI();
    }

    public Date getSystemTime() {
        return systemTime;
    }

    public Date getDisplayTime() {
        return displayTime;
    }

    public int getBGValue() {
        return bGValue;
    }

    public Constants.TREND_ARROW_VALUES getTrend() {
        return trend;
    }

    public String getTrendSymbol() {
        return trend.Symbol();
    }

    public long getUnfiltered() {
        return unfiltered;
    }

    public long getFiltered() {
        return filtered;
    }

    public int getRssi() {
        return rssi;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/MeterRecord.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class MeterRecord extends GenericTimestampRecord {

    private int meterBG;
    private int meterTime;

    public MeterRecord(byte[] packet) {
        super(packet);
        meterBG = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getShort(8);
        meterTime = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(10);
    }

    public int getMeterBG() {
        return meterBG;
    }

    public int getMeterTime() {
        return meterTime;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/PageHeader.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;

import android.util.Log;

import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.CRC16;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.CRCFailRuntimeException;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.Constants;
import com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.Utils;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class PageHeader {
    protected final int HEADER_SIZE=28;
    protected final int FIRSTRECORDINDEX_OFFSET=0;
    protected final int NUMRECS_OFFSET=4;
    protected final int RECTYPE_OFFSET=8;
    protected final int REV_OFFSET=9;
    protected final int PAGENUMBER_OFFSET=10;
    protected final int RESERVED2_OFFSET=14;
    protected final int RESERVED3_OFFSET=18;
    protected final int RESERVED4_OFFSET=22;

    protected int firstRecordIndex;
    protected int numOfRecords;
    protected Constants.RECORD_TYPES recordType;
    protected byte revision;
    protected int pageNumber;
    protected int reserved2;
    protected int reserved3;
    protected int reserved4;
    protected byte[] crc=new byte[2];


    public PageHeader(byte[] packet) {
        Log.d("ShareTest", "Header Packet Data Length: " + packet.length);

        firstRecordIndex = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(FIRSTRECORDINDEX_OFFSET);
        numOfRecords = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(NUMRECS_OFFSET);
        recordType = Constants.RECORD_TYPES.values()[packet[RECTYPE_OFFSET]];
        revision = packet[REV_OFFSET];
        pageNumber = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(PAGENUMBER_OFFSET);
        reserved2 = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(RESERVED2_OFFSET);
        reserved3 = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(RESERVED3_OFFSET);
        reserved4 = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(RESERVED4_OFFSET);
        System.arraycopy(packet,HEADER_SIZE-Constants.CRC_LEN,crc,0,Constants.CRC_LEN);
        byte[] crc_calc = CRC16.calculate(packet,0,HEADER_SIZE - Constants.CRC_LEN);
        if (!Arrays.equals(this.crc, crc_calc)) {
            throw new CRCFailRuntimeException("CRC check failed: " + Utils.bytesToHex(this.crc) + " vs " + Utils.bytesToHex(crc_calc));
        }
    }

    public byte getRevision() {
        return revision;
    }

    public Constants.RECORD_TYPES getRecordType() {
        return recordType;
    }

    public int getFirstRecordIndex() {
        return firstRecordIndex;
    }

    public int getNumOfRecords() {
        return numOfRecords;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public int getReserved2() {
        return reserved2;
    }

    public int getReserved3() {
        return reserved3;
    }

    public int getReserved4() {
        return reserved4;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/SensorRecord.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;

import android.util.Log;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

// This code and this particular library are from the NightScout android uploader
// Check them out here: https://github.com/nightscout/android-uploader
// Some of this code may have been modified for use in this project

public class SensorRecord extends GenericTimestampRecord {

    private int unfiltered;
    private int filtered;
    private int rssi;
    private int OFFSET_UNFILTERED = 8;
    private int OFFSET_FILTERED = 12;
    private int OFFSET_RSSI = 16;

    public SensorRecord(byte[] packet) {
        super(packet);
        unfiltered = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(OFFSET_UNFILTERED);
        filtered = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getInt(OFFSET_FILTERED);
        rssi = ByteBuffer.wrap(packet).order(ByteOrder.LITTLE_ENDIAN).getShort(OFFSET_RSSI);
        Log.d("ShareTest", "filtered: " + filtered + " unfiltered: " + unfiltered);
    }

    public long getUnfiltered() {
        return unfiltered;
    }

    public long getFiltered() {
        return filtered;
    }

    public int getRSSI() {
        return rssi;
    }
}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/BuildInfo.java
================================================
package com.eveningoutpost.dexdrip.ImportedLibraries.usbserial;

/**
 * Static container of information about this library.
 */
public final class BuildInfo {

    /**
     * The current version of this library. Values are of the form
     * "major.minor.micro[-suffix]". A suffix of "-pre" indicates a pre-release
     * of the version preceeding it.
     */
    public static final String VERSION = "0.2.0-pre";

    private BuildInfo() {
        throw new IllegalStateException("Non-instantiable class.");
    }

}


================================================
FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/CdcAcmSerialDriver.java
================================================
/* Copyright 2011-2013 Google Inc.
 * Copyright 2013 mike wakerly <opensource@hoho.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
 * USA.
 *
 * Project home page: https://github.com/mik3y/usb-serial-for-android
 */

package com.eveningoutpost.dexdrip.ImportedLibraries.usbserial.driver;

import android.hardware.usb.UsbConstants;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbEndpoint;
import android.hardware.usb.UsbInterface;
import android.hardware.usb.UsbRequest;
import android.os.Build;
import android.util.Log;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * USB CDC/ACM serial driver implementation.
 *
 * @author mike wakerly (opensource@hoho.com)
 * @see <a
 *      href="http://www.usb.org/developers/devclass_docs/usbcdc11.pdf">Universal
 *      Serial Bus Class Definitions for Communication Devices, v1.1</a>
 */
public class CdcAcmSerialDriver implements UsbSerialDriver {

    private final String TAG = CdcAcmSerialDriver.class.getSimpleName();

    private final UsbDevice mDevice;
    private final UsbSerialPort mPort;

    public CdcAcmSerialDriver(UsbDevice device) {
        mDevice = device;
        mPort = new CdcAcmSerialPort(device, 0);
    }

    @Override
    public UsbDevice getDevice() {
        return mDevice;
    }

    @Override
    public List<UsbSerialPort> getPorts() {
        return Collections.singletonList(mPort);
    }

    class CdcAcmSerialPort extends CommonUsbSerialPort {

        private final boolean mEnableAsyncReads;
        private UsbInterface mControlInterface;
        private UsbInterface mDataInterface;

        private UsbEndpoint mControlEndpoint;
        private UsbEndpoint mReadEndpoint;
        private UsbEndpoint mWriteEndpoint;

        private boolean mRts = false;
        private boolean mDtr = false;

        private static final int USB_RECIP_INTERFACE = 0x01;
        private static final int USB_RT_ACM = UsbConstants.USB_TYPE_CLASS | USB_RECIP_INTERFACE;

        private static final int SET_LINE_CODING = 0x20;  // USB CDC 1.1 section 6.2
        private static final int GET_LINE_CODING = 0x21;
        private static final int SET_CONTROL_LINE_STATE = 0x22;
        private static final int SEND_BREAK = 0x23;

        public CdcAcmSerialPort(UsbDevice device, int portNumber) {
            super(device, portNumber);
            mEnableAsyncReads = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1);
        }

        @Override
        public UsbSerialDriver getDriver() {
            return CdcAcmSerialDriver.this;
        }

        @Override
        public void open(UsbDeviceConnection connection) throws IOException {
            if (mConnection != null && false) {
                throw new IOException("Already open");
            }

            mConnection = connection;
            boolean opened = false;
            try {
                Log.d(TAG, "claiming interfaces, count=" + mDevice.getInterfaceCount());
                mControlInterface = mDevice.getInterface(0);
                Log.d(TAG, "Control iface=" + mControlInterface);
                // class should be USB_CLASS_COMM

                if (!mConnection.claimInterface(mControlInterface, true)) {
                    throw new IOException("Could not claim control interface.");
                }
                mControlEndpoint = mControlInterface.getEndpoint(0);
                Log.d(TAG, "Control endpoint direction: " + mControlEndpoint.getDirection());

                Log.d(TAG, "Claiming data interface.");
                mDataInterface = mDevice.getInterface(1);
                Log.d(TAG, "data iface=" + mDataInterface);
                // class should be USB_CLASS_CDC_DATA

                if (!mConnection.claimInterface(mDataInterface, true)) {
                    throw new IOException("Could not claim data interface.");
                }
                mReadEndpoint = mDataInterface.getEndpoint(1);
                Log.d(TAG, "Read endpoint direction: " + mReadEndpoint.getDirection());
                mWriteEndpoint = mDataInterface.getEndpoint(0);
                Log.d(TAG, "Write endpoint direction: " + mWriteEndpoint.getDirection());
                if (mEnableAsyncReads) {
                  Log.d(TAG, "Async reads enabled");
                } else {
                  Log.d(TAG, "Async reads disabled.");
                }
                opened = true;
            } finally {
                if (!opened) {
                    mConnection = null;
                }
            }
        }

        private int sendAcmControlMessage(int request, int value, byte[] buf) {
            return mConnection.controlTransfer(
                    USB_RT_ACM, request, value, 0, buf, buf != null ? buf.length : 0, 5000);
        }

        @Override
        public void close() throws IOException {
            if (mConnection == null) {
                throw new IOException("Already closed");
            }
            mConnection.close();
            mConnection = null;
        }

        @Override
        public int read(byte[] dest, int timeoutMillis, UsbDeviceConnection connection) throws IOException {return 0;}

        @Override
        public int read(byte[] dest, int timeoutMillis) throws IOException {
            if (mEnableAsyncReads) {
              final UsbRequest request = new UsbRequest();
              try {
                request.initialize(mConnection, mReadEndpoint);
                final ByteBuffer buf = ByteBuffer.wrap(dest);
                if (!request.queue(buf, dest.length)) {
                  throw new IOException("Error queueing request.");
                }

                final UsbRequest response = mConnection.requestWait();
                if (response == null) {
                  throw new IOException("Null response");
                }

                final int nread = buf.position();
                if (nread > 0) {
                  //Log.d(TAG, HexDump.dumpHexString(dest, 0, Math.min(32, dest.length)));
                  return nread;
                } else {
                  return 0;
                }
              } finally {
                request.close();
              }
            }

            final int numBytesRead;
            synchronized (mReadBufferLock) {
                int readAmt = Math.min(dest.length, mReadBuffer.length);
                numBytesRead = mConnection.bulkTransfer(mReadEndpoint, mReadBuffer, readAmt,
                        timeoutMillis);
                if (numBytesRead < 0) {
                    // This sucks: we get -1 on timeout, not 0 as preferred.
                    // We *should* use UsbRequest, except it has a bug/api oversight
                    // where there is no way to determine the number of bytes read
                    // in response :\ -- http://b.android.com/28023
                    if (timeoutMillis == Integer.MAX_VALUE) {
                        // Hack: Special case "~infinite timeout" as an error.
                        return -1;
                    }
                    return 0;
                }
                System.arraycopy(mReadBuffer, 0, dest, 0, numBytesRead);
            }
            return numBytesRead;
        }

        @Override
        public int write(byte[] src, int timeoutMillis) throws IOException {
            // TODO(mikey): Nearly identical to FtdiSerial write. Refactor.
            int offset = 0;

            while (offset < src.length) {
                final int writeLength;
                final int amtWritten;

                synchronized (mWriteBufferLock) {
                    final byte[] writeBuffer;

                    writeLength = Math.min(src.length - offset, mWriteBuffer.length);
                    if (offset == 0) {
                        writeBuffer = src;
                    } else {
                        // bulkTransfer does not support offsets, make a copy.
                        System.arraycopy(src, offset, mWriteBuffer, 0, writeLength);
                        writeBuffer = mWriteBuffer;
                    }

                    amtWritten = mConnection.bulkTransfer(mWriteEndpoint, writeBuffer, writeLength,
                            timeoutMillis);
                }
                if (amtWritten <= 0) {
                    throw new IOException("Error writing " + writeLength
                            + " bytes at offset " + offset + " length=" + src.length);
                }

                Log.d(TAG, "Wrote amt=" + amtWritten + " attempted=" + writeLength);
                offset += amtWritten;
            }
            return offset;
        }

        @Override
        public void setParameters(int baudRate, int dataBits, int stopBits, int parity) {
            byte stopBitsByte;
            switch (stopBits) {
                case STOPBITS_1: stopBitsByte = 0; break;
                case STOPBITS_1_5: stopBitsByte = 1; break;
                case STOPBITS_2: stopBitsByte = 2; break;
                default: throw new IllegalArgumentException("Bad value for stopBits: " + stopBits);
            }

            byte parityBitesByte;
            switch (parity) {
                case PARITY_NONE: parityBitesByte = 0; break;
                case PARITY_ODD: parityBitesByte = 1; break;
                case PARITY_EVEN: parityBitesByte = 2; break;
                case PARITY_MARK: parityBitesByte = 3; break;
                case PARITY_SPACE: parityBitesByte = 4; break;
                default: throw new IllegalArgumentException("Bad value for parity: " + parity);
            }

            byte[] msg = {
                    (byte) ( baudRate & 0xff),
                    (byte) ((baudRate >> 8 ) & 0xff),
                    (byte) ((baudRate >> 16) & 0xff),
                    (byte) ((baudRate >> 24) & 0xff),
                    stopBitsByte,
                    parityBitesByte,
                    (byte) dataBits};
            sendAcmControlMessage(SET_LINE_CODING, 0, msg);
        }

        @Override
        public boolean getCD() throws IOException {
            return false;  // TODO
        }

        @Override
        public boolean getCTS() throws IOException {
            return false;  // TODO
        }

        @Override
        public boolean getDSR() throws IOException {
            return false;  // TODO
        }

        @Override
        public boolean getDTR() throws IOException {
            retur
Download .txt
gitextract_6jrc5dih/

├── .gitignore
├── DexDrip.iml
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── app.iml
│   ├── build.gradle
│   ├── libs/
│   │   ├── ActiveAndroid.jar
│   │   ├── android-support-v4.jar
│   │   ├── hellocharts-library-1.1.jar
│   │   └── usb-serial-for-android-v010.jar
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── eveningoutpost/
│       │               └── dexdrip/
│       │                   └── ApplicationTest.java
│       └── main/
│           ├── AndroidManifest.xml
│           ├── assets/
│           │   └── migrations/
│           │       ├── 10.sql
│           │       ├── 16.sql
│           │       ├── 17.sql
│           │       ├── 18.sql
│           │       ├── 19.sql
│           │       ├── 20.sql
│           │       ├── 21.sql
│           │       ├── 23.sql
│           │       ├── 24.sql
│           │       ├── 25.sql
│           │       └── 26.sql
│           ├── java/
│           │   └── com/
│           │       └── eveningoutpost/
│           │           └── dexdrip/
│           │               ├── AddCalibration.java
│           │               ├── AutoStart.java
│           │               ├── BluetoothScan.java
│           │               ├── CalibrationCheckInActivity.java
│           │               ├── CalibrationGraph.java
│           │               ├── CalibrationOverride.java
│           │               ├── DoubleCalibrationActivity.java
│           │               ├── FakeNumbers.java
│           │               ├── Home.java
│           │               ├── ImportedLibraries/
│           │               │   ├── dexcom/
│           │               │   │   ├── CRC16.java
│           │               │   │   ├── CRCFailRuntimeException.java
│           │               │   │   ├── Constants.java
│           │               │   │   ├── PacketBuilder.java
│           │               │   │   ├── ReadData.java
│           │               │   │   ├── ReadDataShare.java
│           │               │   │   ├── ReadPacket.java
│           │               │   │   ├── SyncingService.java
│           │               │   │   ├── Utils.java
│           │               │   │   └── records/
│           │               │   │       ├── CalRecord.java
│           │               │   │       ├── CalSubrecord.java
│           │               │   │       ├── EGVRecord.java
│           │               │   │       ├── GenericTimestampRecord.java
│           │               │   │       ├── GenericXMLRecord.java
│           │               │   │       ├── GlucoseDataSet.java
│           │               │   │       ├── MeterRecord.java
│           │               │   │       ├── PageHeader.java
│           │               │   │       └── SensorRecord.java
│           │               │   └── usbserial/
│           │               │       ├── BuildInfo.java
│           │               │       ├── driver/
│           │               │       │   ├── CdcAcmSerialDriver.java
│           │               │       │   ├── CommonUsbSerialPort.java
│           │               │       │   ├── Cp21xxSerialDriver.java
│           │               │       │   ├── FtdiSerialDriver.java
│           │               │       │   ├── ProbeTable.java
│           │               │       │   ├── ProlificSerialDriver.java
│           │               │       │   ├── UsbId.java
│           │               │       │   ├── UsbSerialDriver.java
│           │               │       │   ├── UsbSerialPort.java
│           │               │       │   ├── UsbSerialProber.java
│           │               │       │   └── UsbSerialRuntimeException.java
│           │               │       └── util/
│           │               │           ├── HexDump.java
│           │               │           └── SerialInputOutputManager.java
│           │               ├── Interfaces/
│           │               │   ├── BgReadingInterface.java
│           │               │   ├── CalibrationInterface.java
│           │               │   ├── SensorInterface.java
│           │               │   └── UserInterface.java
│           │               ├── LicenseAgreementActivity.java
│           │               ├── Models/
│           │               │   ├── ActiveBluetoothDevice.java
│           │               │   ├── BgReading.java
│           │               │   ├── Calibration.java
│           │               │   ├── CalibrationRequest.java
│           │               │   ├── TransmitterData.java
│           │               │   ├── User.java
│           │               │   └── UserNotification.java
│           │               ├── NavDrawerBuilder.java
│           │               ├── NavigationDrawerFragment.java
│           │               ├── Sensor.java
│           │               ├── Services/
│           │               │   ├── ComunicationHeader.java
│           │               │   ├── DexCollectionService.java
│           │               │   ├── DexShareCollectionService.java
│           │               │   ├── MongoWrapper.java
│           │               │   ├── SyncService.java
│           │               │   ├── TransmitterRawData.java
│           │               │   └── WixelReader.java
│           │               ├── SettingsActivity.java
│           │               ├── ShareModels/
│           │               │   ├── DexcomShareInterface.java
│           │               │   ├── Egv.java
│           │               │   ├── ShareAuthenticationBody.java
│           │               │   ├── ShareGlucose.java
│           │               │   ├── ShareRest.java
│           │               │   └── ShareUploadPayload.java
│           │               ├── ShareTest.java
│           │               ├── StartNewSensor.java
│           │               ├── StopSensor.java
│           │               ├── SystemStatus.java
│           │               ├── Tables/
│           │               │   ├── BgReadingTable.java
│           │               │   ├── CalibrationDataTable.java
│           │               │   └── SensorDataTable.java
│           │               ├── UsbConnectedActivity.java
│           │               ├── UtilityModels/
│           │               │   ├── BgGraphBuilder.java
│           │               │   ├── BgSendQueue.java
│           │               │   ├── CalibrationSendQueue.java
│           │               │   ├── CollectionServiceStarter.java
│           │               │   ├── Constants.java
│           │               │   ├── DexShareAttributes.java
│           │               │   ├── ForegroundServiceStarter.java
│           │               │   ├── HM10Attributes.java
│           │               │   ├── Intents.java
│           │               │   ├── MongoSendTask.java
│           │               │   ├── NightscoutUploader.java
│           │               │   ├── Notifications.java
│           │               │   ├── PebbleSync.java
│           │               │   ├── RedBearLabAttributes.java
│           │               │   ├── RestCalls.java
│           │               │   └── SensorSendQueue.java
│           │               ├── utils/
│           │               │   ├── DatabaseUtil.java
│           │               │   ├── FileUtils.java
│           │               │   ├── Preferences.java
│           │               │   └── ShareNotification.java
│           │               ├── widgetUpdateService.java
│           │               ├── xDripWidget.java
│           │               └── xdrip.java
│           └── res/
│               ├── layout/
│               │   ├── activity_add_calibration.xml
│               │   ├── activity_add_comparison.xml
│               │   ├── activity_bluetooth_scan.xml
│               │   ├── activity_calibration_check_in.xml
│               │   ├── activity_calibration_graph.xml
│               │   ├── activity_calibration_override.xml
│               │   ├── activity_double_calibration.xml
│               │   ├── activity_fake_numbers.xml
│               │   ├── activity_home.xml
│               │   ├── activity_license_agreement.xml
│               │   ├── activity_raw_data_table.xml
│               │   ├── activity_share_test.xml
│               │   ├── activity_start_new_sensor.xml
│               │   ├── activity_stop_sensor.xml
│               │   ├── activity_system_status.xml
│               │   ├── activity_usb_connected.xml
│               │   ├── fragment_navigation_drawer.xml
│               │   ├── listitem_device.xml
│               │   ├── raw_data_list.xml
│               │   ├── raw_data_list_item.xml
│               │   └── x_drip_widget.xml
│               ├── layout-xlarge/
│               │   └── activity_home.xml
│               ├── menu/
│               │   ├── global.xml
│               │   ├── menu_bluetooth_scan.xml
│               │   ├── menu_home.xml
│               │   ├── menu_share_test.xml
│               │   └── menu_system_status.xml
│               ├── values/
│               │   ├── arrays.xml
│               │   ├── dimens.xml
│               │   ├── strings.xml
│               │   ├── strings_activity_preferences.xml
│               │   └── styles.xml
│               ├── values-v14/
│               │   └── dimens.xml
│               ├── values-v21/
│               │   └── styles.xml
│               ├── values-w820dp/
│               │   └── dimens.xml
│               └── xml/
│                   ├── device_filter.xml
│                   ├── pref_advanced_settings.xml
│                   ├── pref_data_source.xml
│                   ├── pref_data_sync.xml
│                   ├── pref_general.xml
│                   ├── pref_headers.xml
│                   ├── pref_license.xml
│                   ├── pref_notifications.xml
│                   └── x_drip_widget_info.xml
├── battle_of_the_dexes.md
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── hardware_setup.md
├── settings.gradle
├── xDrip-Experimental.iml
└── xDrip.iml
Download .txt
SYMBOL INDEX (968 symbols across 102 files)

FILE: app/src/androidTest/java/com/eveningoutpost/dexdrip/ApplicationTest.java
  class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
    method ApplicationTest (line 10) | public ApplicationTest() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/AddCalibration.java
  class AddCalibration (line 17) | public class AddCalibration extends Activity implements NavigationDrawer...
    method onCreate (line 22) | @Override
    method onResume (line 34) | protected void onResume(){
    method onNavigationDrawerItemSelected (line 39) | @Override
    method addListenerOnButton (line 44) | public void addListenerOnButton() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/AutoStart.java
  class AutoStart (line 13) | public class AutoStart extends BroadcastReceiver {
    method onReceive (line 14) | @Override

FILE: app/src/main/java/com/eveningoutpost/dexdrip/BluetoothScan.java
  class BluetoothScan (line 31) | @TargetApi(android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)
    method onCreate (line 47) | @Override
    method onPause (line 83) | @Override
    method onResume (line 90) | @Override
    method onNavigationDrawerItemSelected (line 96) | @Override
    method onCreateOptionsMenu (line 100) | @Override
    method onOptionsItemSelected (line 112) | @Override
    method scanLeDevice (line 140) | private void scanLeDevice(final boolean enable) {
    method onListItemClick (line 161) | @Override
    class LeDeviceListAdapter (line 192) | private class LeDeviceListAdapter extends BaseAdapter {
      method LeDeviceListAdapter (line 196) | public LeDeviceListAdapter() {
      method addDevice (line 202) | public void addDevice(BluetoothDevice device) {
      method getDevice (line 208) | public BluetoothDevice getDevice(int position) {
      method clear (line 212) | public void clear() {
      method getCount (line 216) | @Override
      method getItem (line 221) | @Override
      method getItemId (line 226) | @Override
      method getView (line 231) | @Override
    method onLeScan (line 262) | @Override
    class ViewHolder (line 274) | static class ViewHolder {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/CalibrationCheckInActivity.java
  class CalibrationCheckInActivity (line 21) | public class CalibrationCheckInActivity extends Activity implements Navi...
    method onCreate (line 26) | @Override
    method onResume (line 32) | protected void onResume(){
    method onNavigationDrawerItemSelected (line 38) | @Override
    method addListenerOnButton (line 43) | public void addListenerOnButton() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/CalibrationGraph.java
  class CalibrationGraph (line 22) | public class CalibrationGraph extends Activity implements NavigationDraw...
    method onCreate (line 30) | @Override
    method onResume (line 35) | @Override
    method onNavigationDrawerItemSelected (line 45) | @Override
    method setupCharts (line 51) | public void setupCharts() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/CalibrationOverride.java
  class CalibrationOverride (line 20) | public class CalibrationOverride extends Activity implements NavigationD...
    method onCreate (line 25) | @Override
    method onResume (line 37) | @Override
    method onNavigationDrawerItemSelected (line 44) | @Override
    method addListenerOnButton (line 49) | public void addListenerOnButton() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/DoubleCalibrationActivity.java
  class DoubleCalibrationActivity (line 20) | public class DoubleCalibrationActivity  extends Activity implements Navi...
    method onCreate (line 25) | @Override
    method onResume (line 37) | @Override
    method onNavigationDrawerItemSelected (line 44) | @Override
    method addListenerOnButton (line 49) | public void addListenerOnButton() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/FakeNumbers.java
  class FakeNumbers (line 19) | public class FakeNumbers extends Activity {
    method onCreate (line 23) | @Override
    method addListenerOnButton (line 33) | public void addListenerOnButton() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Home.java
  class Home (line 48) | public class Home extends Activity implements NavigationDrawerFragment.N...
    method onCreate (line 71) | @Override
    method checkEula (line 83) | public void checkEula() {
    method onResume (line 92) | @Override
    method setupCharts (line 121) | public void setupCharts() {
    class ChartViewPortListener (line 141) | private class ChartViewPortListener implements ViewportChangeListener {
      method onViewportChanged (line 142) | @Override
    class ViewportListener (line 153) | private class ViewportListener implements ViewportChangeListener {
      method onViewportChanged (line 154) | @Override
    method onNavigationDrawerItemSelected (line 170) | @Override
    method setViewport (line 175) | public void setViewport() {
    method onPause (line 183) | @Override
    method updateCurrentBgInfo (line 194) | public void updateCurrentBgInfo() {
    method displayCurrentInfo (line 292) | public void displayCurrentInfo() {
    method onCreateOptionsMenu (line 341) | @Override
    method onOptionsItemSelected (line 347) | @Override

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/CRC16.java
  class CRC16 (line 7) | public class CRC16 {
    method calculate (line 8) | public static byte[] calculate(byte[] buff, int start, int end) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/CRCFailRuntimeException.java
  class CRCFailRuntimeException (line 7) | public class CRCFailRuntimeException extends RuntimeException {
    method CRCFailRuntimeException (line 8) | public CRCFailRuntimeException(String message){

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/Constants.java
  class Constants (line 7) | public class Constants {
    type BATTERY_STATES (line 59) | public enum BATTERY_STATES {
    type RECORD_TYPES (line 67) | public enum RECORD_TYPES {
    type TREND_ARROW_VALUES (line 84) | public enum TREND_ARROW_VALUES {
      method TREND_ARROW_VALUES (line 100) | TREND_ARROW_VALUES(int id, String a, String t) {
      method TREND_ARROW_VALUES (line 106) | TREND_ARROW_VALUES(int id) {
      method Symbol (line 110) | public String Symbol() {
      method friendlyTrendName (line 118) | public String friendlyTrendName() {
      method getID (line 126) | public int getID(){
    type SPECIALBGVALUES_MGDL (line 132) | public enum SPECIALBGVALUES_MGDL {
      method SPECIALBGVALUES_MGDL (line 146) | private SPECIALBGVALUES_MGDL(String s, int i){
      method getValue (line 151) | public int getValue(){
      method toString (line 155) | public String toString(){
      method getEGVSpecialValue (line 159) | public static SPECIALBGVALUES_MGDL getEGVSpecialValue(int val){
      method isSpecialValue (line 167) | public static boolean isSpecialValue(int val){
    type InsertionState (line 177) | public enum InsertionState {
    type NOISE (line 191) | public enum NOISE {
      method NOISE (line 202) | private NOISE(int value) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/PacketBuilder.java
  class PacketBuilder (line 12) | public class PacketBuilder {
    method PacketBuilder (line 29) | public PacketBuilder(int command) {
    method PacketBuilder (line 33) | public PacketBuilder(int command, ArrayList<Byte> payload) {
    method compose (line 38) | public byte[] compose() {
    method composeList (line 52) | public List<byte[]> composeList() {
    method getLength (line 66) | private byte getLength() {
    method toBytes (line 77) | public byte[] toBytes() {
    method toBytesList (line 85) | public List<byte[]> toBytesList() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/ReadData.java
  class ReadData (line 29) | public class ReadData {
    method ReadData (line 43) | public ReadData(){}
    method ReadData (line 44) | public ReadData(UsbSerialDriver device) {
    method ReadData (line 47) | public ReadData(UsbSerialDriver device, UsbDeviceConnection connection...
    method getRecentEGVs (line 59) | public EGVRecord[] getRecentEGVs() {
    method getRecentEGVsPages (line 65) | public EGVRecord[] getRecentEGVsPages(int numOfRecentPages) {
    method getTimeSinceEGVRecord (line 87) | public long getTimeSinceEGVRecord(EGVRecord egvRecord) {
    method getRecentMeterRecords (line 91) | public MeterRecord[] getRecentMeterRecords() {
    method getRecentSensorRecords (line 98) | public SensorRecord[] getRecentSensorRecords(int numOfRecentPages) {
    method getRecentCalRecords (line 120) | public CalRecord[] getRecentCalRecords() {
    method getRecentCalRecordsTest (line 127) | public byte[] getRecentCalRecordsTest() {
    method ping (line 135) | public boolean ping() {
    method readBatteryLevel (line 140) | public int readBatteryLevel() {
    method readSerialNumber (line 147) | public String readSerialNumber() {
    method readDisplayTime (line 154) | public Date readDisplayTime() {
    method readSystemTime (line 158) | public long readSystemTime() {
    method readDisplayTimeOffset (line 165) | public int readDisplayTimeOffset() {
    method readDataBasePageRange (line 172) | private int readDataBasePageRange(int recordType) {
    method readDataBasePage (line 184) | private <T> T readDataBasePage(int recordType, int page) {
    method readDataBasePageTest (line 201) | private byte[] readDataBasePageTest(int recordType, int page) {
    method writeCommand (line 217) | private void writeCommand(int command, ArrayList<Byte> payload) {
    method writeCommandTest (line 230) | private byte[] writeCommandTest(int command, ArrayList<Byte> payload) {
    method writeCommand (line 234) | private void writeCommand(int command) {
    method read (line 248) | private ReadPacket read(int numOfBytes) {
    method ParsePage (line 300) | private <T> T ParsePage(byte[] data, int recordType) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/ReadDataShare.java
  class ReadDataShare (line 40) | public class ReadDataShare {
    method ReadDataShare (line 45) | public ReadDataShare(ShareTest aShareTest){
    method ReadDataShare (line 48) | public ReadDataShare(DexShareCollectionService collectionService){
    method getRecentEGVs (line 52) | public void getRecentEGVs(final Action1<EGVRecord[]> recordListener) {
    method getRecentMeterRecords (line 65) | public void getRecentMeterRecords(final Action1<MeterRecord[]> recordL...
    method getRecentCalRecords (line 78) | public void getRecentCalRecords(final Action1<CalRecord[]> recordListe...
    method getRecentSensorRecords (line 92) | public void getRecentSensorRecords(final Action1<SensorRecord[]> recor...
    method getTimeSinceEGVRecord (line 105) | public void getTimeSinceEGVRecord(final EGVRecord egvRecord, final Act...
    method ping (line 113) | public void ping(final Action1<Boolean> pingListener) {
    method readBatteryLevel (line 121) | public void readBatteryLevel(final Action1<Integer> batteryLevelListen...
    method readSerialNumber (line 129) | public void readSerialNumber(final Action1<String> serialNumberListene...
    method readDisplayTime (line 140) | public void readDisplayTime(final Action1<Date> displayTimeListener) {
    method readSystemTime (line 157) | public void readSystemTime(final Action1<Long> systemTimeListener) {
    method readDisplayTimeOffset (line 167) | public void readDisplayTimeOffset(final Action1<Long> displayTimeOffse...
    method readDataBasePageRange (line 175) | private void readDataBasePageRange(int recordType, final Action1<Integ...
    method readDataBasePage (line 187) | private <T> T readDataBasePage(final int recordType, int page, final A...
    method writeCommand (line 222) | private void writeCommand(int command, ArrayList<Byte> payload, Action...
    method writeCommand (line 228) | private void writeCommand(int command, Action1<byte[]> responseListene...
    method read (line 234) | private ReadPacket read(int numOfBytes, byte[] readPacket) {
    method ParsePage (line 238) | private <T> T ParsePage(byte[] data, int recordType) { return ParsePag...
    method ParsePage (line 239) | private <T> T ParsePage(byte[] data, int recordType, Action1<T> parsed...

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/ReadPacket.java
  class ReadPacket (line 10) | public class ReadPacket {
    method ReadPacket (line 19) | public ReadPacket(byte[] readPacket) {
    method getCommand (line 29) | public int getCommand() {
    method getData (line 33) | public byte[] getData() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/SyncingService.java
  class SyncingService (line 44) | public class SyncingService extends IntentService {
    method startActionSingleSync (line 82) | public static void startActionSingleSync(Context context, int numOfPag...
    method startActionCalibrationCheckin (line 88) | public static void startActionCalibrationCheckin(Context context) {
    method SyncingService (line 93) | public SyncingService() {
    method onHandleIntent (line 97) | @Override
    method performCalibrationCheckin (line 116) | private void performCalibrationCheckin(){
    method handleActionSync (line 146) | private void handleActionSync(int numOfPages) {
    method save_most_recent_cal_record (line 220) | private void save_most_recent_cal_record(CalRecord[] calRecords) {
    method acquireSerialDevice (line 225) | private boolean acquireSerialDevice() {
    method isG4Connected (line 263) | static public boolean isG4Connected(Context c){
    method findDexcom (line 282) | public UsbDevice findDexcom() {
    method broadcastSGVToUI (line 306) | private void broadcastSGVToUI(EGVRecord egvRecord, boolean uploadStatus,
    method broadcastSGVToUI (line 325) | private void broadcastSGVToUI() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/Utils.java
  class Utils (line 14) | public class Utils {
    method receiverTimeToDate (line 16) | public static Date receiverTimeToDate(long delta) {
    method getTimeString (line 26) | public static String getTimeString(long timeDeltaMS) {
    method mergeGlucoseDataRecords (line 52) | public static GlucoseDataSet[] mergeGlucoseDataRecords(EGVRecord[] egv...
    method bytesToHex (line 64) | public static String bytesToHex(byte[] bytes) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/CalRecord.java
  class CalRecord (line 11) | public class CalRecord extends GenericTimestampRecord {
    method CalRecord (line 22) | public CalRecord(byte[] packet) {
    method getSlope (line 45) | public double getSlope() {
    method getIntercept (line 49) | public double getIntercept() {
    method getScale (line 53) | public double getScale() {
    method getUnk (line 57) | public int[] getUnk() {
    method getDecay (line 61) | public double getDecay() {
    method getNumRecords (line 65) | public int getNumRecords() {
    method getCalSubrecords (line 69) | public CalSubrecord[] getCalSubrecords() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/CalSubrecord.java
  class CalSubrecord (line 15) | public class CalSubrecord {
    method CalSubrecord (line 23) | public CalSubrecord(byte[] packet, long displayTimeOffset) {
    method getDateEntered (line 33) | public Date getDateEntered() {
    method getCalBGL (line 37) | public int getCalBGL() {
    method getCalRaw (line 41) | public int getCalRaw() {
    method getDateApplied (line 45) | public Date getDateApplied() {
    method getUnk (line 49) | public byte getUnk() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/EGVRecord.java
  class EGVRecord (line 20) | public class EGVRecord extends GenericTimestampRecord {
    method EGVRecord (line 26) | public EGVRecord(byte[] packet) {
    method EGVRecord (line 37) | public EGVRecord(int bGValue,Constants.TREND_ARROW_VALUES trend,Date d...
    method noiseValue (line 43) | public String noiseValue() { return String.valueOf(noise); }
    method getBGValue (line 44) | public int getBGValue() {
    method getTrend (line 48) | public Constants.TREND_ARROW_VALUES getTrend() {
    method toJSON (line 52) | public JSONObject toJSON() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/GenericTimestampRecord.java
  class GenericTimestampRecord (line 13) | public class GenericTimestampRecord {
    method GenericTimestampRecord (line 21) | public GenericTimestampRecord(byte[] packet) {
    method GenericTimestampRecord (line 28) | public GenericTimestampRecord(Date displayTime, Date systemTime){
    method getSystemTime (line 33) | public Date getSystemTime() {
    method getSystemTimeSeconds (line 37) | public int getSystemTimeSeconds() {
    method getDisplayTime (line 41) | public Date getDisplayTime() {
    method getDisplayTimeSeconds (line 44) | public long getDisplayTimeSeconds() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/GenericXMLRecord.java
  class GenericXMLRecord (line 19) | public class GenericXMLRecord extends GenericTimestampRecord {
    method GenericXMLRecord (line 27) | public GenericXMLRecord(byte[] packet) {
    method getXmlElement (line 45) | public Element getXmlElement() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/GlucoseDataSet.java
  class GlucoseDataSet (line 11) | public class GlucoseDataSet {
    method GlucoseDataSet (line 21) | public GlucoseDataSet(EGVRecord egvRecord, SensorRecord sensorRecord) {
    method getSystemTime (line 32) | public Date getSystemTime() {
    method getDisplayTime (line 36) | public Date getDisplayTime() {
    method getBGValue (line 40) | public int getBGValue() {
    method getTrend (line 44) | public Constants.TREND_ARROW_VALUES getTrend() {
    method getTrendSymbol (line 48) | public String getTrendSymbol() {
    method getUnfiltered (line 52) | public long getUnfiltered() {
    method getFiltered (line 56) | public long getFiltered() {
    method getRssi (line 60) | public int getRssi() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/MeterRecord.java
  class MeterRecord (line 10) | public class MeterRecord extends GenericTimestampRecord {
    method MeterRecord (line 15) | public MeterRecord(byte[] packet) {
    method getMeterBG (line 21) | public int getMeterBG() {
    method getMeterTime (line 25) | public int getMeterTime() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/PageHeader.java
  class PageHeader (line 18) | public class PageHeader {
    method PageHeader (line 40) | public PageHeader(byte[] packet) {
    method getRevision (line 58) | public byte getRevision() {
    method getRecordType (line 62) | public Constants.RECORD_TYPES getRecordType() {
    method getFirstRecordIndex (line 66) | public int getFirstRecordIndex() {
    method getNumOfRecords (line 70) | public int getNumOfRecords() {
    method getPageNumber (line 74) | public int getPageNumber() {
    method getReserved2 (line 78) | public int getReserved2() {
    method getReserved3 (line 82) | public int getReserved3() {
    method getReserved4 (line 86) | public int getReserved4() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/SensorRecord.java
  class SensorRecord (line 12) | public class SensorRecord extends GenericTimestampRecord {
    method SensorRecord (line 21) | public SensorRecord(byte[] packet) {
    method getUnfiltered (line 29) | public long getUnfiltered() {
    method getFiltered (line 33) | public long getFiltered() {
    method getRSSI (line 37) | public int getRSSI() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/BuildInfo.java
  class BuildInfo (line 6) | public final class BuildInfo {
    method BuildInfo (line 15) | private BuildInfo() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/CdcAcmSerialDriver.java
  class CdcAcmSerialDriver (line 48) | public class CdcAcmSerialDriver implements UsbSerialDriver {
    method CdcAcmSerialDriver (line 55) | public CdcAcmSerialDriver(UsbDevice device) {
    method getDevice (line 60) | @Override
    method getPorts (line 65) | @Override
    class CdcAcmSerialPort (line 70) | class CdcAcmSerialPort extends CommonUsbSerialPort {
      method CdcAcmSerialPort (line 91) | public CdcAcmSerialPort(UsbDevice device, int portNumber) {
      method getDriver (line 96) | @Override
      method open (line 101) | @Override
      method sendAcmControlMessage (line 146) | private int sendAcmControlMessage(int request, int value, byte[] buf) {
      method close (line 151) | @Override
      method read (line 160) | @Override
      method read (line 163) | @Override
      method write (line 212) | @Override
      method setParameters (line 247) | @Override
      method getCD (line 278) | @Override
      method getCTS (line 283) | @Override
      method getDSR (line 288) | @Override
      method getDTR (line 293) | @Override
      method setDTR (line 298) | @Override
      method getRI (line 304) | @Override
      method getRTS (line 309) | @Override
      method setRTS (line 314) | @Override
      method setDtrRts (line 320) | private void setDtrRts() {
    method getSupportedDevices (line 327) | public static Map<Integer, int[]> getSupportedDevices() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/CommonUsbSerialPort.java
  class CommonUsbSerialPort (line 34) | abstract class CommonUsbSerialPort implements UsbSerialPort {
    method CommonUsbSerialPort (line 54) | public CommonUsbSerialPort(UsbDevice device, int portNumber) {
    method toString (line 62) | @Override
    method getDevice (line 74) | public final UsbDevice getDevice() {
    method getPortNumber (line 78) | @Override
    method getSerial (line 87) | @Override
    method setReadBufferSize (line 98) | public final void setReadBufferSize(int bufferSize) {
    method setWriteBufferSize (line 113) | public final void setWriteBufferSize(int bufferSize) {
    method open (line 122) | @Override
    method close (line 125) | @Override
    method read (line 128) | @Override
    method write (line 131) | @Override
    method setParameters (line 134) | @Override
    method getCD (line 138) | @Override
    method getCTS (line 141) | @Override
    method getDSR (line 144) | @Override
    method getDTR (line 147) | @Override
    method setDTR (line 150) | @Override
    method getRI (line 153) | @Override
    method getRTS (line 156) | @Override
    method setRTS (line 159) | @Override
    method purgeHwBuffers (line 162) | @Override

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/Cp21xxSerialDriver.java
  class Cp21xxSerialDriver (line 39) | public class Cp21xxSerialDriver implements UsbSerialDriver {
    method Cp21xxSerialDriver (line 46) | public Cp21xxSerialDriver(UsbDevice device) {
    method getDevice (line 51) | @Override
    method getPorts (line 56) | @Override
    class Cp21xxSerialPort (line 61) | public class Cp21xxSerialPort extends CommonUsbSerialPort {
      method Cp21xxSerialPort (line 109) | public Cp21xxSerialPort(UsbDevice device, int portNumber) {
      method getDriver (line 113) | @Override
      method setConfigSingle (line 118) | private int setConfigSingle(int request, int value) {
      method open (line 123) | @Override
      method close (line 169) | @Override
      method read (line 182) | @Override
      method write (line 201) | @Override
      method read (line 234) | @Override
      method setBaudRate (line 282) | private void setBaudRate(int baudRate) throws IOException {
      method setParameters (line 296) | @Override
      method getCD (line 340) | @Override
      method getCTS (line 345) | @Override
      method getDSR (line 350) | @Override
      method getDTR (line 355) | @Override
      method setDTR (line 360) | @Override
      method getRI (line 364) | @Override
      method getRTS (line 369) | @Override
      method setRTS (line 374) | @Override
      method purgeHwBuffers (line 378) | @Override
    method getSupportedDevices (line 393) | public static Map<Integer, int[]> getSupportedDevices() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/FtdiSerialDriver.java
  class FtdiSerialDriver (line 95) | public class FtdiSerialDriver implements UsbSerialDriver {
    type DeviceType (line 103) | private static enum DeviceType {
    method FtdiSerialDriver (line 107) | public FtdiSerialDriver(UsbDevice device) {
    method getDevice (line 111) | @Override
    method getPorts (line 116) | @Override
    class FtdiSerialPort (line 121) | private class FtdiSerialPort extends CommonUsbSerialPort {
      method FtdiSerialPort (line 195) | public FtdiSerialPort(UsbDevice device, int portNumber) {
      method getDriver (line 199) | @Override
      method filterStatusBytes (line 212) | private final int filterStatusBytes(byte[] src, byte[] dest, int tot...
      method read (line 229) | public int read(byte[] dest, int timeoutMillis, UsbDeviceConnection ...
      method reset (line 276) | public void reset() throws IOException {
      method open (line 287) | @Override
      method close (line 313) | @Override
      method read (line 325) | @Override
      method write (line 373) | @Override
      method setBaudRate (line 409) | private int setBaudRate(int baudRate) throws IOException {
      method setParameters (line 423) | @Override
      method convertBaudrate (line 472) | private long[] convertBaudrate(int baudrate) {
      method getCD (line 558) | @Override
      method getCTS (line 563) | @Override
      method getDSR (line 568) | @Override
      method getDTR (line 573) | @Override
      method setDTR (line 578) | @Override
      method getRI (line 582) | @Override
      method getRTS (line 587) | @Override
      method setRTS (line 592) | @Override
      method purgeHwBuffers (line 596) | @Override
    method getSupportedDevices (line 617) | public static Map<Integer, int[]> getSupportedDevices() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/ProbeTable.java
  class ProbeTable (line 36) | public class ProbeTable {
    method addProduct (line 49) | public ProbeTable addProduct(int vendorId, int productId,
    method addDriver (line 62) | @SuppressWarnings("unchecked")
    method findDriver (line 103) | public Class<? extends UsbSerialDriver> findDriver(int vendorId, int p...

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/ProlificSerialDriver.java
  class ProlificSerialDriver (line 46) | public class ProlificSerialDriver implements UsbSerialDriver {
    method ProlificSerialDriver (line 53) | public ProlificSerialDriver(UsbDevice device) {
    method getPorts (line 58) | @Override
    method getDevice (line 63) | @Override
    class ProlificSerialPort (line 68) | class ProlificSerialPort extends CommonUsbSerialPort {
      method ProlificSerialPort (line 129) | public ProlificSerialPort(UsbDevice device, int portNumber) {
      method getDriver (line 133) | @Override
      method inControlTransfer (line 138) | private final byte[] inControlTransfer(int requestType, int request,
      method outControlTransfer (line 151) | private final void outControlTransfer(int requestType, int request,
      method read (line 162) | public int read(byte[] dest, int timeoutMillis, UsbDeviceConnection ...
      method vendorIn (line 209) | private final byte[] vendorIn(int value, int index, int length)
      method vendorOut (line 215) | private final void vendorOut(int value, int index, byte[] data)
      method resetDevice (line 221) | private void resetDevice() throws IOException {
      method ctrlOut (line 225) | private final void ctrlOut(int request, int value, int index, byte[]...
      method doBlackMagic (line 231) | private void doBlackMagic() throws IOException {
      method setControlLines (line 245) | private void setControlLines(int newControlLinesValue) throws IOExce...
      method readStatusThreadFunction (line 250) | private final void readStatusThreadFunction() {
      method getStatus (line 274) | private final int getStatus() throws IOException {
      method testStatusFlag (line 311) | private final boolean testStatusFlag(int flag) throws IOException {
      method open (line 315) | @Override
      method close (line 391) | @Override
      method read (line 417) | @Override
      method write (line 431) | @Override
      method setParameters (line 466) | @Override
      method getCD (line 532) | @Override
      method getCTS (line 537) | @Override
      method getDSR (line 542) | @Override
      method getDTR (line 547) | @Override
      method setDTR (line 552) | @Override
      method getRI (line 563) | @Override
      method getRTS (line 568) | @Override
      method setRTS (line 573) | @Override
      method purgeHwBuffers (line 584) | @Override
    method getSupportedDevices (line 598) | public static Map<Integer, int[]> getSupportedDevices() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbId.java
  class UsbId (line 32) | public final class UsbId {
    method UsbId (line 67) | private UsbId() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbSerialDriver.java
  type UsbSerialDriver (line 32) | public interface UsbSerialDriver {
    method getDevice (line 39) | public UsbDevice getDevice();
    method getPorts (line 47) | public List<UsbSerialPort> getPorts();

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbSerialPort.java
  type UsbSerialPort (line 34) | public interface UsbSerialPort {
    method getDriver (line 87) | public UsbSerialDriver getDriver();
    method getPortNumber (line 92) | public int getPortNumber();
    method getSerial (line 97) | public String getSerial();
    method open (line 107) | public void open(UsbDeviceConnection connection) throws IOException;
    method close (line 114) | public void close() throws IOException;
    method read (line 124) | public int read(final byte[] dest, final int timeoutMillis) throws IOE...
    method read (line 125) | public int read(final byte[] dest, final int timeoutMillis, final UsbD...
    method write (line 135) | public int write(final byte[] src, final int timeoutMillis) throws IOE...
    method setParameters (line 150) | public void setParameters(
    method getCD (line 159) | public boolean getCD() throws IOException;
    method getCTS (line 167) | public boolean getCTS() throws IOException;
    method getDSR (line 175) | public boolean getDSR() throws IOException;
    method getDTR (line 183) | public boolean getDTR() throws IOException;
    method setDTR (line 192) | public void setDTR(boolean value) throws IOException;
    method getRI (line 200) | public boolean getRI() throws IOException;
    method getRTS (line 208) | public boolean getRTS() throws IOException;
    method setRTS (line 217) | public void setRTS(boolean value) throws IOException;
    method purgeHwBuffers (line 227) | public boolean purgeHwBuffers(boolean flushRX, boolean flushTX) throws...

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbSerialProber.java
  class UsbSerialProber (line 36) | public class UsbSerialProber {
    method UsbSerialProber (line 40) | public UsbSerialProber(ProbeTable probeTable) {
    method getDefaultProber (line 44) | public static UsbSerialProber getDefaultProber() {
    method getDefaultProbeTable (line 48) | public static ProbeTable getDefaultProbeTable() {
    method findAllDrivers (line 66) | public List<UsbSerialDriver> findAllDrivers(final UsbManager usbManage...
    method probeDevice (line 85) | public UsbSerialDriver probeDevice(final UsbDevice usbDevice) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbSerialRuntimeException.java
  class UsbSerialRuntimeException (line 27) | @SuppressWarnings("serial")
    method UsbSerialRuntimeException (line 30) | public UsbSerialRuntimeException() {
    method UsbSerialRuntimeException (line 34) | public UsbSerialRuntimeException(String detailMessage, Throwable throw...
    method UsbSerialRuntimeException (line 38) | public UsbSerialRuntimeException(String detailMessage) {
    method UsbSerialRuntimeException (line 42) | public UsbSerialRuntimeException(Throwable throwable) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/util/HexDump.java
  class HexDump (line 23) | public class HexDump {
    method dumpHexString (line 28) | public static String dumpHexString(byte[] array) {
    method dumpHexString (line 32) | public static String dumpHexString(byte[] array, int offset, int lengt...
    method toHexString (line 85) | public static String toHexString(byte b) {
    method toHexString (line 89) | public static String toHexString(byte[] array) {
    method toHexString (line 93) | public static String toHexString(byte[] array, int offset, int length) {
    method toHexString (line 106) | public static String toHexString(int i) {
    method toHexString (line 110) | public static String toHexString(short i) {
    method toByteArray (line 114) | public static byte[] toByteArray(byte b) {
    method toByteArray (line 120) | public static byte[] toByteArray(int i) {
    method toByteArray (line 131) | public static byte[] toByteArray(short i) {
    method toByte (line 140) | private static int toByte(char c) {
    method hexStringToByteArray (line 151) | public static byte[] hexStringToByteArray(String hexString) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/util/SerialInputOutputManager.java
  class SerialInputOutputManager (line 38) | public class SerialInputOutputManager implements Runnable {
    type State (line 53) | private enum State {
    type Listener (line 65) | public interface Listener {
      method onNewData (line 69) | public void onNewData(byte[] data);
      method onRunError (line 75) | public void onRunError(Exception e);
    method SerialInputOutputManager (line 81) | public SerialInputOutputManager(UsbSerialPort driver) {
    method SerialInputOutputManager (line 88) | public SerialInputOutputManager(UsbSerialPort driver, Listener listene...
    method setListener (line 93) | public synchronized void setListener(Listener listener) {
    method getListener (line 97) | public synchronized Listener getListener() {
    method writeAsync (line 101) | public void writeAsync(byte[] data) {
    method stop (line 107) | public synchronized void stop() {
    method getState (line 114) | private synchronized State getState() {
    method run (line 125) | @Override
    method step (line 157) | private void step() throws IOException {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Interfaces/BgReadingInterface.java
  type BgReadingInterface (line 14) | public interface BgReadingInterface {
    method createReading (line 16) | @POST("/api/v1/users/{user_uuid}/BgReadings/new")
    method updateReading (line 19) | @PUT("/api/v1/users/{user_uuid}/BgReading/{bgReading_uuid}")

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Interfaces/CalibrationInterface.java
  type CalibrationInterface (line 13) | public interface CalibrationInterface {
    method createCalibration (line 15) | @POST("/api/v1/users/{user_uuid}/calibrations/new")

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Interfaces/SensorInterface.java
  type SensorInterface (line 13) | public interface SensorInterface {
    method createSensor (line 15) | @POST("/api/v1/users/{user_uuid}/sensors/new")

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Interfaces/UserInterface.java
  type UserInterface (line 12) | public interface UserInterface {
    method authenticate (line 14) | @POST("/api/v1/sessions/new")

FILE: app/src/main/java/com/eveningoutpost/dexdrip/LicenseAgreementActivity.java
  class LicenseAgreementActivity (line 18) | public class LicenseAgreementActivity extends Activity {
    method onCreate (line 24) | @Override
    method addListenerOnButton (line 36) | public void addListenerOnButton() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Models/ActiveBluetoothDevice.java
  class ActiveBluetoothDevice (line 13) | @Table(name = "ActiveBluetoothDevice", id = BaseColumns._ID)
    method first (line 24) | public static ActiveBluetoothDevice first() {
    method forget (line 31) | public static void forget() {
    method connected (line 38) | public static void connected() {
    method disconnected (line 46) | public static void disconnected() {
    method is_connected (line 54) | public static boolean is_connected() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Models/BgReading.java
  class BgReading (line 32) | @Table(name = "BgReadings", id = BaseColumns._ID)
    method calculated_value_mmol (line 123) | public double calculated_value_mmol() {
    method mmolConvert (line 127) | public double mmolConvert(double mgdl) {
    method displayValue (line 131) | public String displayValue(Context context) {
    method activeSlope (line 152) | public static double activeSlope() {
    method activePrediction (line 159) | public static double activePrediction() {
    method create (line 171) | public static void create(EGVRecord[] egvRecords, long addativeOffset,...
    method create (line 175) | public static void create(SensorRecord[] sensorRecords, long addativeO...
    method create (line 179) | public static void create(SensorRecord sensorRecord, long addativeOffs...
    method create (line 203) | public static void create(EGVRecord egvRecord, long addativeOffset, Co...
    method getForTimestamp (line 229) | public static BgReading getForTimestamp(double timestamp) {
    method is_new (line 249) | public static boolean is_new(SensorRecord sensorRecord, long addativeO...
    method create (line 268) | public static BgReading create(double raw_data, Context context, Long ...
    method slopeArrow (line 333) | public static String slopeArrow() {
    method slopeArrow (line 338) | public static String slopeArrow(double slope) {
    method slopeName (line 358) | public String slopeName() {
    method slopefromName (line 382) | public double slopefromName(String slope_name) {
    method last (line 404) | public static BgReading last() {
    method latest_by_size (line 417) | public static List<BgReading> latest_by_size(int number) {
    method lastNoSenssor (line 428) | public static BgReading lastNoSenssor() {
    method latest (line 437) | public static List<BgReading> latest(int number) {
    method latestUnCalculated (line 450) | public static List<BgReading> latestUnCalculated(int number) {
    method latestForGraph (line 462) | public static List<BgReading> latestForGraph(int number, double startT...
    method last30Minutes (line 475) | public static List<BgReading> last30Minutes() {
    method estimated_bg (line 486) | public static double estimated_bg(double timestamp) {
    method estimated_raw_bg (line 496) | public static double estimated_raw_bg(double timestamp) {
    method perform_calculations (line 511) | public void perform_calculations() {
    method find_slope (line 517) | public void find_slope() {
    method find_new_curve (line 539) | public void find_new_curve() {
    method calculateAgeAdjustedRawValue (line 591) | public void calculateAgeAdjustedRawValue(){
    method find_new_raw_curve (line 601) | public void find_new_raw_curve() {
    method weightedAverageRaw (line 650) | public static double weightedAverageRaw(double timeA, double timeB, do...
    method toS (line 656) | public String toS() {
    method noiseValue (line 665) | public String noiseValue() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Models/Calibration.java
  class Calibration (line 33) | @Table(name = "Calibration", id = BaseColumns._ID)
    method initialCalibration (line 144) | public static void initialCalibration(double bg1, double bg2, Context ...
    method create (line 235) | public static void create(CalRecord[] calRecords, long addativeOffset,...
    method create (line 236) | public static void create(CalRecord[] calRecords, Context context) { c...
    method create (line 237) | public static void create(CalRecord[] calRecords, Context context, boo...
    method is_new (line 299) | public static boolean is_new(CalSubrecord calSubrecord, long addativeO...
    method getForTimestamp (line 315) | public static Calibration getForTimestamp(double timestamp) {
    method create (line 327) | public static Calibration create(double bg, Context context) {
    method allForSensorInLastFiveDays (line 381) | public static List<Calibration> allForSensorInLastFiveDays() {
    method calculate_w_l_s (line 394) | public static void calculate_w_l_s() {
    method slopeOOBHandler (line 451) | private double slopeOOBHandler(int status) {
    method calibrations_for_sensor (line 480) | private static List<Calibration> calibrations_for_sensor(Sensor sensor) {
    method calculateWeight (line 490) | private double calculateWeight() {
    method adjustRecentBgReadings (line 498) | public static void adjustRecentBgReadings() {// This just adjust the l...
    method adjustRecentBgReadings (line 501) | public static void adjustRecentBgReadings(int adjustCount) {
    method rawValueOverride (line 529) | public void rawValueOverride(double rawValue, Context context) {
    method requestCalibrationIfRangeTooNarrow (line 536) | public static void requestCalibrationIfRangeTooNarrow() {
    method clear_all_existing_calibrations (line 546) | public static void clear_all_existing_calibrations() {
    method toS (line 559) | public String toS() {
    method last (line 569) | public static Calibration last() {
    method first (line 578) | public static Calibration first() {
    method max_recent (line 588) | public static double max_recent() {
    method min_recent (line 605) | public static double min_recent() {
    method latest (line 622) | public static List<Calibration> latest(int number) {
    method allForSensor (line 633) | public static List<Calibration> allForSensor() {
    method allForSensorInLastFourDays (line 645) | public static List<Calibration> allForSensorInLastFourDays() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Models/CalibrationRequest.java
  class CalibrationRequest (line 16) | @Table(name = "CalibrationRequest", id = BaseColumns._ID)
    method createRange (line 27) | public static void createRange(double low, double high) {
    method createOffset (line 33) | public static void createOffset(double center, double distance) {
    method clearAll (line 44) | public static void clearAll(){
    method shouldRequestCalibration (line 55) | public static boolean shouldRequestCalibration(BgReading bgReading){

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Models/TransmitterData.java
  class TransmitterData (line 18) | @Table(name = "TransmitterData", id = BaseColumns._ID)
    method create (line 37) | public static TransmitterData create(byte[] buffer, int len, Long time...
    method create (line 65) | public static TransmitterData create(int raw_data ,int sensor_battery_...
    method last (line 81) | public static TransmitterData last() {
    method randomDelay (line 88) | public static void randomDelay(float min, float max){

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Models/User.java
  class User (line 28) | @Table(name = "User", id = BaseColumns._ID)
    method currentUser (line 58) | public static User currentUser() {
    method authenticate (line 69) | public static void authenticate() {
    method userInterface (line 90) | public static UserInterface userInterface() {
    method adapterBuilder (line 97) | public static RestAdapter.Builder adapterBuilder() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Models/UserNotification.java
  class UserNotification (line 16) | @Table(name = "Notifications", id = BaseColumns._ID)
    method lastBgAlert (line 37) | public static UserNotification lastBgAlert() {
    method lastCalibrationAlert (line 44) | public static UserNotification lastCalibrationAlert() {
    method lastDoubleCalibrationAlert (line 51) | public static UserNotification lastDoubleCalibrationAlert() {
    method lastExtraCalibrationAlert (line 58) | public static UserNotification lastExtraCalibrationAlert() {
    method create (line 66) | public static UserNotification create(String message, String type) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java
  class NavDrawerBuilder (line 23) | public class NavDrawerBuilder {
    method NavDrawerBuilder (line 33) | public NavDrawerBuilder(Context aContext) {
    method nav_drawer_options (line 40) | private final List<String> nav_drawer_options() {
    method nav_drawer_intents (line 93) | private List<Intent> nav_drawer_intents() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/NavigationDrawerFragment.java
  class NavigationDrawerFragment (line 28) | public class NavigationDrawerFragment extends Fragment {
    method NavigationDrawerFragment (line 45) | public NavigationDrawerFragment() {
    method onCreate (line 48) | @Override
    method onActivityCreated (line 62) | @Override
    method onCreateView (line 68) | @Override
    method isDrawerOpen (line 93) | public boolean isDrawerOpen() {
    method setUp (line 97) | public void setUp(int fragmentId, DrawerLayout drawerLayout, String cu...
    method selectItem (line 185) | private void selectItem(int position) {
    method onAttach (line 198) | @Override
    method onDetach (line 208) | @Override
    method onSaveInstanceState (line 214) | @Override
    method onConfigurationChanged (line 220) | @Override
    method onCreateOptionsMenu (line 226) | @Override
    method onOptionsItemSelected (line 235) | @Override
    method showGlobalContextActionBar (line 243) | private void showGlobalContextActionBar() {
    method getActionBar (line 250) | private ActionBar getActionBar() {
    type NavigationDrawerCallbacks (line 254) | public static interface NavigationDrawerCallbacks {
      method onNavigationDrawerItemSelected (line 255) | void onNavigationDrawerItemSelected(int position);
    method swapContext (line 258) | public void swapContext(int position) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Sensor.java
  class Sensor (line 18) | @Table(name = "Sensors", id = BaseColumns._ID)
    method create (line 37) | public static Sensor create(double started_at) {
    method currentSensor (line 47) | public static Sensor currentSensor() {
    method isActive (line 58) | public static boolean isActive() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Services/ComunicationHeader.java
  class ComunicationHeader (line 12) | public class ComunicationHeader  {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Services/DexCollectionService.java
  class DexCollectionService (line 54) | @TargetApi(Build.VERSION_CODES.KITKAT)
    method onBind (line 83) | @Override
    method onCreate (line 88) | @Override
    method onStartCommand (line 98) | @Override
    method onDestroy (line 114) | @Override
    method onSharedPreferenceChanged (line 123) | public void onSharedPreferenceChanged(SharedPreferences prefs, String ...
    method listenForChangeInSettings (line 138) | public void listenForChangeInSettings() {
    method setRetryTimer (line 142) | public void setRetryTimer() {
    method setFailoverTimer (line 152) | public void setFailoverTimer() { //Sometimes it gets stuck in limbo on...
    method attemptConnection (line 166) | public void attemptConnection() {
    method onConnectionStateChange (line 201) | @Override
    method onServicesDiscovered (line 216) | @Override
    method onCharacteristicChanged (line 239) | @Override
    method connect (line 246) | public boolean connect(final String address) {
    method disconnect (line 270) | public void disconnect() {
    method close (line 275) | public void close() {
    method setSerialDataToTransmitterRawData (line 285) | public void setSerialDataToTransmitterRawData(byte[] buffer, int len) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Services/DexShareCollectionService.java
  class DexShareCollectionService (line 55) | @TargetApi(Build.VERSION_CODES.KITKAT)
    method onCreate (line 108) | @Override
    method onStartCommand (line 121) | @Override
    method onDestroy (line 142) | @Override
    method onSharedPreferenceChanged (line 153) | public void onSharedPreferenceChanged(SharedPreferences prefs, String ...
    method listenForChangeInSettings (line 168) | public void listenForChangeInSettings() {
    method setRetryTimer (line 172) | public void setRetryTimer() {
    method setFailoverTimer (line 188) | public void setFailoverTimer() { //Sometimes it gets stuck in limbo on...
    method onBind (line 200) | @Override
    method attemptConnection (line 205) | public void attemptConnection() {
    method attemptRead (line 250) | public void attemptRead() {
    method connect (line 315) | public boolean connect(final String address) {
    method authenticateConnection (line 349) | public void authenticateConnection() {
    method assignCharacteristics (line 383) | public void assignCharacteristics() {
    method setListeners (line 401) | public void setListeners(int listener_number) {
    method close (line 413) | public void close() {
    method setCharacteristicNotification (line 424) | public void setCharacteristicNotification(BluetoothGattCharacteristic ...
    method setCharacteristicNotification (line 428) | public void setCharacteristicNotification(BluetoothGattCharacteristic ...
    method setCharacteristicIndication (line 437) | public void setCharacteristicIndication(BluetoothGattCharacteristic ch...
    method setCharacteristicIndication (line 441) | public void setCharacteristicIndication(BluetoothGattCharacteristic ch...
    method writeCommand (line 450) | public void writeCommand(List<byte[]> packets, int aRecordType, Action...
    method clearGattTask (line 460) | public void clearGattTask() {
    method gattSetupStep (line 465) | private void gattSetupStep() {
    method gattWritingStep (line 471) | private void gattWritingStep() {
    method onReceive (line 489) | public void onReceive(Context context, Intent intent) {
    method onConnectionStateChange (line 515) | @Override
    method onServicesDiscovered (line 553) | @Override
    method onCharacteristicRead (line 572) | @Override
    method onCharacteristicChanged (line 586) | @Override
    method onDescriptorWrite (line 599) | @Override
    method onCharacteristicWrite (line 627) | @Override
    method bondDevice (line 650) | public void bondDevice() {
    method writeStatusConnectionFailures (line 657) | private void writeStatusConnectionFailures(int status) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Services/MongoWrapper.java
  class MongoWrapper (line 21) | public class MongoWrapper {
    method MongoWrapper (line 31) | public MongoWrapper(String dbUriStr, String collection, String index, ...
    method openMongoDb (line 41) | public DBCollection openMongoDb() throws UnknownHostException {
    method closeMongoDb (line 54) | public void closeMongoDb() {
    method WriteDebugDataToMongo (line 60) | public boolean WriteDebugDataToMongo(String message)
    method WriteToMongo (line 68) | public boolean WriteToMongo(TransmitterRawData trd)
    method WriteToMongo (line 74) | public boolean WriteToMongo(BasicDBObject bdbo)
    method ReadFromMongo (line 99) | public List<TransmitterRawData> ReadFromMongo(int numberOfRecords) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Services/SyncService.java
  class SyncService (line 26) | public class SyncService extends Service {
    method onCreate (line 33) | @Override
    method onStartCommand (line 38) | @Override
    method onDestroy (line 44) | @Override
    method onBind (line 50) | @Override
    method attemptSend (line 55) | public void attemptSend() {
    method setRetryTimer (line 77) | public void setRetryTimer() {
    method syncToMogoDb (line 83) | public void syncToMogoDb() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Services/TransmitterRawData.java
  class TransmitterRawData (line 7) | public class TransmitterRawData {
    method getTransmissionId (line 27) | public int getTransmissionId() {
    method setTransmissionId (line 31) | public void setTransmissionId(int transmissionId) {
    method getUploaded (line 35) | public int getUploaded() {
    method setUploaded (line 39) | public void setUploaded(int uploaded) {
    method getUploadAttempts (line 43) | public int getUploadAttempts() {
    method setUploadAttempts (line 47) | public void setUploadAttempts(int uploadAttempts) {
    method getUploaderBatteryLife (line 51) | public int getUploaderBatteryLife() {
    method setUploaderBatteryLife (line 55) | public void setUploaderBatteryLife(int uploaderBatteryLife) {
    method getBatteryLife (line 59) | public int getBatteryLife() {
    method setBatteryLife (line 63) | public void setBatteryLife(int batteryLife) {
    method getReceivedSignalStrength (line 67) | public int getReceivedSignalStrength() {
    method setReceivedSignalStrength (line 71) | public void setReceivedSignalStrength(int receivedSignalStrength) {
    method getTransmitterId (line 75) | public String getTransmitterId() {
    method setTransmitterId (line 79) | public void setTransmitterId(String transmitterId) {
    method getRawValue (line 83) | public int getRawValue() {
    method setRawValue (line 87) | public void setRawValue(int rawValue) {
    method getFilteredValue (line 91) | public int getFilteredValue() {
    method setFilteredValue (line 95) | public void setFilteredValue(int filteredValue) {
    method getCaptureDateTime (line 99) | public long getCaptureDateTime() {
    method setCaptureDateTime (line 103) | public void setCaptureDateTime(long captureDateTime) {
    method get_id (line 107) | public long get_id() {
    method set_id (line 111) | public void set_id(long _id) {
    method getRelativeTime (line 115) | private Long getRelativeTime() {
    method TransmitterRawData (line 119) | public TransmitterRawData(){
    method toTableString (line 158) | public String toTableString()
    method toDbObj (line 174) | public BasicDBObject toDbObj(String DebugInfo) {
    method TransmitterRawData (line 187) | public TransmitterRawData(BasicDBObject src) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Services/WixelReader.java
  class WixelReader (line 24) | public class WixelReader  extends Thread {
    method getInstance (line 29) | public synchronized static WixelReader getInstance(Context ctx) {
    method WixelReader (line 41) | public WixelReader(Context ctx) {
    method sStart (line 45) | public static void sStart(Context ctx) {
    method sStop (line 55) | public static void sStop() {
    method IsConfigured (line 72) | public static boolean IsConfigured(Context ctx) {
    method almostEquals (line 81) | public static boolean almostEquals( TransmitterRawData e1, Transmitter...
    method Merge2Lists (line 95) | public static List<TransmitterRawData> Merge2Lists(List<TransmitterRaw...
    method MergeLists (line 125) | public static List<TransmitterRawData> MergeLists(List <List<Transmitt...
    method ReadHost (line 136) | public static List<TransmitterRawData> ReadHost(String hostAndIp, int ...
    method ReadFromMongo (line 177) | public static List<TransmitterRawData> ReadFromMongo(String dbury, int...
    method Read (line 207) | public static TransmitterRawData[] Read(String hostsNames, int numberO...
    method Read (line 250) | public static List<TransmitterRawData> Read(String hostName,int port, ...
    method run (line 316) | public void run()
    method runFake (line 358) | public void runFake()
    method Stop (line 392) | public void Stop()
    method setSerialDataToTransmitterRawData (line 397) | public void setSerialDataToTransmitterRawData(int raw_data ,int sensor...

FILE: app/src/main/java/com/eveningoutpost/dexdrip/SettingsActivity.java
  class SettingsActivity (line 15) | public class SettingsActivity extends PreferenceActivity {
    method onPostCreate (line 17) | @Override
    method setupSimplePreferencesScreen (line 23) | private void setupSimplePreferencesScreen() {
    method onPreferenceChange (line 49) | @Override
    method bindPreferenceSummaryToValue (line 82) | private static void bindPreferenceSummaryToValue(Preference preference) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/DexcomShareInterface.java
  type DexcomShareInterface (line 14) | public interface DexcomShareInterface {
    method getShareBg (line 15) | @POST("/Publisher/ReadPublisherLatestGlucoseValues")
    method getSessionId (line 18) | @POST("/General/LoginPublisherAccountByName")
    method checkSessionActive (line 23) | @POST("/Publisher/IsRemoteMonitoringSessionActive")
    method uploadBGRecords (line 28) | @POST("/Publisher/PostReceiverEgvRecords")

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/Egv.java
  class Egv (line 9) | public class Egv {
    method Egv (line 23) | public Egv(BgReading bg) {
    method toDateString (line 30) | public String toDateString(double timestamp) {
    method slopeOrdinal (line 35) | public int slopeOrdinal(BgReading bg) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/ShareAuthenticationBody.java
  class ShareAuthenticationBody (line 8) | public class ShareAuthenticationBody {
    method ShareAuthenticationBody (line 18) | public ShareAuthenticationBody(String aPassword, String aAccountName) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/ShareGlucose.java
  class ShareGlucose (line 18) | @Table(name = "ShareGlucose", id = BaseColumns._ID)
    method processShareData (line 41) | public void processShareData(Context context) {
    method slopeDirection (line 65) | public String slopeDirection() {
    method getBatteryLevel (line 87) | public int getBatteryLevel() {
    method calculateDelta (line 97) | public double calculateDelta(double timestamp, double currentValue) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/ShareRest.java
  class ShareRest (line 39) | public class ShareRest {
    method ShareRest (line 50) | public ShareRest(Context context) {
    method getBgData (line 58) | public boolean getBgData() {
    method sendBgData (line 65) | public boolean sendBgData(BgReading bg) {
    method loginAndGetData (line 75) | private boolean loginAndGetData() {
    method loginAndSendData (line 98) | private boolean loginAndSendData(final BgReading bg) {
    method getBgData (line 121) | private void getBgData(String sessionId) {
    method sendBgData (line 126) | private void sendBgData(String sessionId, BgReading bg) {
    method dexcomShareAuthorizeInterface (line 131) | private DexcomShareInterface dexcomShareAuthorizeInterface() {
    method dexcomShareGetBgInterface (line 138) | private DexcomShareInterface dexcomShareGetBgInterface() {
    method dexcomShareSendBgInterface (line 145) | private DexcomShareInterface dexcomShareSendBgInterface() {
    method checkSessionActive (line 152) | private DexcomShareInterface checkSessionActive() {
    method authoirizeAdapterBuilder (line 159) | private RestAdapter.Builder authoirizeAdapterBuilder() {
    method getBgAdapterBuilder (line 172) | private RestAdapter.Builder getBgAdapterBuilder() {
    method intercept (line 186) | @Override
    method intercept (line 194) | @Override
    method getOkHttpClient (line 203) | public OkHttpClient getOkHttpClient() {
    method getOkClient (line 246) | public OkClient getOkClient (){
    method queryParamMap (line 252) | public Map<String, String> queryParamMap(String sessionId) {
    class DataFetcher (line 261) | public class DataFetcher extends AsyncTask<Void, Void, Boolean> {
      method DataFetcher (line 264) | DataFetcher(Context context, String sessionId) {
      method doInBackground (line 269) | @Override
    class DataSender (line 293) | public class DataSender extends AsyncTask<Void, Void, Boolean> {
      method DataSender (line 297) | DataSender(Context context, String sessionId, BgReading bg) {
      method doInBackground (line 303) | @Override
    method requestCount (line 325) | public int requestCount() {
    method minutesCount (line 336) | public int minutesCount() {
    method querySessionMap (line 345) | public Map<String, String> querySessionMap(String sessionId) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/ShareUploadPayload.java
  class ShareUploadPayload (line 12) | public class ShareUploadPayload {
    method ShareUploadPayload (line 22) | public ShareUploadPayload(String sn, BgReading bg) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/ShareTest.java
  class ShareTest (line 59) | public class ShareTest extends Activity {
    method onCreate (line 114) | @Override
    method onDestroy (line 129) | @Override
    method addListenerOnButton (line 136) | public void addListenerOnButton() {
    method addListenerOnCloseButton (line 154) | public void addListenerOnCloseButton() {
    method onConnectionStateChange (line 164) | @Override
    method onServicesDiscovered (line 188) | @Override
    method onCharacteristicRead (line 197) | @Override
    method onCharacteristicChanged (line 213) | @Override
    method onDescriptorWrite (line 243) | @Override
    method onCharacteristicWrite (line 257) | @Override
    method attemptConnection (line 264) | public void attemptConnection() {
    method attemptRead (line 291) | public void attemptRead() {
    method bond (line 334) | public void bond(BluetoothGatt gatt) {
    method connect (line 339) | public boolean connect(final String address) {
    method authenticateConnection (line 372) | public void authenticateConnection(BluetoothGatt bluetoothGatt) {
    method assignCharacteristics (line 396) | public void assignCharacteristics() {
    method setListeners (line 404) | public void setListeners(int listener_number) {
    method disconnect (line 416) | public void disconnect() {
    method close (line 424) | public void close() {
    method readCharacteristic (line 435) | public void readCharacteristic(BluetoothGattCharacteristic characteris...
    method setCharacteristicNotification (line 443) | public void setCharacteristicNotification(BluetoothGattCharacteristic ...
    method setCharacteristicNotification (line 444) | public void setCharacteristicNotification(BluetoothGattCharacteristic ...
    method setCharacteristicIndication (line 454) | public void setCharacteristicIndication(BluetoothGattCharacteristic ch...
    method setCharacteristicIndication (line 455) | public void setCharacteristicIndication(BluetoothGattCharacteristic ch...
    method onReceive (line 466) | public void onReceive(Context context, Intent intent) {
    method writeCommand (line 487) | public void writeCommand(List<byte[]> packets, int aRecordType, Action...
    method nextGattStep (line 497) | private void nextGattStep() {
    method clearGattTask (line 515) | public void clearGattTask() {
    method gattSetupStep (line 520) | private void gattSetupStep() {
    method gattWritingStep (line 526) | private void gattWritingStep() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/StartNewSensor.java
  class StartNewSensor (line 22) | public class StartNewSensor extends Activity implements NavigationDrawer...
    method onCreate (line 29) | @Override
    method onResume (line 47) | @Override
    method onNavigationDrawerItemSelected (line 55) | @Override
    method addListenerOnButton (line 70) | public void addListenerOnButton() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/StopSensor.java
  class StopSensor (line 17) | public class StopSensor extends Activity implements NavigationDrawerFrag...
    method onCreate (line 22) | @Override
    method onResume (line 35) | @Override
    method onNavigationDrawerItemSelected (line 42) | @Override
    method addListenerOnButton (line 47) | public void addListenerOnButton() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/SystemStatus.java
  class SystemStatus (line 31) | public class SystemStatus extends Activity implements NavigationDrawerFr...
    method onCreate (line 45) | @Override
    method onNavigationDrawerItemSelected (line 69) | @Override
    method set_current_values (line 74) | private void set_current_values() {
    method setCollectionMethod (line 83) | public void setCollectionMethod() {
    method setCurrentDevice (line 87) | public void setCurrentDevice() {
    method setConnectionStatus (line 95) | public void setConnectionStatus() {
    method setNotes (line 111) | public void setNotes() {
    method restartButtonListener (line 125) | public void restartButtonListener() {
    method forgetDeviceListener (line 134) | public void forgetDeviceListener() {
    method refreshButtonListener (line 167) | public void refreshButtonListener() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Tables/BgReadingTable.java
  class BgReadingTable (line 24) | public class BgReadingTable extends ListActivity implements NavigationDr...
    method onCreate (line 28) | @Override
    method onResume (line 34) | @Override
    method onNavigationDrawerItemSelected (line 43) | @Override
    method getData (line 48) | private void getData() {
    class BgReadingCursorAdapterViewHolder (line 55) | public static class BgReadingCursorAdapterViewHolder {
      method BgReadingCursorAdapterViewHolder (line 61) | public BgReadingCursorAdapterViewHolder(View root) {
    class BgReadingAdapter (line 69) | public static class BgReadingAdapter extends BaseAdapter {
      method BgReadingAdapter (line 73) | public BgReadingAdapter(Context context, List<BgReading> readings) {
      method newView (line 81) | public View newView(Context context, ViewGroup parent) {
      method bindView (line 90) | public void bindView(View view, Context context, BgReading bgReading) {
      method getCount (line 98) | @Override
      method getItem (line 103) | @Override
      method getItemId (line 108) | @Override
      method getView (line 113) | @Override

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Tables/CalibrationDataTable.java
  class CalibrationDataTable (line 23) | public class CalibrationDataTable extends ListActivity implements Naviga...
    method onCreate (line 27) | @Override
    method onResume (line 33) | @Override
    method onNavigationDrawerItemSelected (line 41) | @Override
    method getData (line 46) | private void getData() {
    class CalibrationDataCursorAdapterViewHolder (line 55) | public static class CalibrationDataCursorAdapterViewHolder {
      method CalibrationDataCursorAdapterViewHolder (line 61) | public CalibrationDataCursorAdapterViewHolder(View root) {
    class CalibrationDataCursorAdapter (line 69) | public static class CalibrationDataCursorAdapter extends BaseAdapter {
      method CalibrationDataCursorAdapter (line 73) | public CalibrationDataCursorAdapter(Context context, List<Calibratio...
      method newView (line 81) | public View newView(Context context, ViewGroup parent) {
      method bindView (line 90) | public void bindView(View view, Context context, Calibration calibra...
      method getCount (line 98) | @Override
      method getItem (line 103) | @Override
      method getItemId (line 108) | @Override
      method getView (line 113) | @Override

FILE: app/src/main/java/com/eveningoutpost/dexdrip/Tables/SensorDataTable.java
  class SensorDataTable (line 17) | public class SensorDataTable extends ListActivity implements NavigationD...
    method onCreate (line 24) | @Override
    method onResume (line 30) | @Override
    method onNavigationDrawerItemSelected (line 38) | @Override
    method getData (line 43) | private void getData() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UsbConnectedActivity.java
  class UsbConnectedActivity (line 9) | public class UsbConnectedActivity extends Activity {
    method onCreate (line 11) | @Override

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/BgGraphBuilder.java
  class BgGraphBuilder (line 33) | public class BgGraphBuilder {
    method BgGraphBuilder (line 59) | public BgGraphBuilder(Context context){
    method lineData (line 73) | public LineChartData lineData() {
    method previewLineData (line 80) | public LineChartData previewLineData() {
    method defaultLines (line 90) | public List<Line> defaultLines() {
    method highValuesLine (line 104) | public Line highValuesLine() {
    method lowValuesLine (line 113) | public Line lowValuesLine() {
    method inRangeValuesLine (line 122) | public Line inRangeValuesLine() {
    method rawInterpretedLine (line 131) | public Line rawInterpretedLine() {
    method addBgReadingValues (line 139) | private void addBgReadingValues() {
    method highLine (line 157) | public Line highLine() {
    method lowLine (line 168) | public Line lowLine() {
    method maxShowLine (line 181) | public Line maxShowLine() {
    method minShowLine (line 191) | public Line minShowLine() {
    method yAxis (line 202) | public Axis yAxis() {
    method xAxis (line 222) | public Axis xAxis() {
    method hourFormat (line 250) | private SimpleDateFormat hourFormat() {
    method isXLargeTablet (line 254) | private boolean isXLargeTablet() {
    method previewXAxis (line 258) | public Axis previewXAxis(){
    method advanceViewport (line 274) | public Viewport advanceViewport(Chart chart, Chart previewChart) {
    method unitized (line 282) | public double unitized(double value) {
    method unitized_string (line 290) | public String unitized_string(double value) {
    method unitizedDeltaString (line 328) | public String unitizedDeltaString(double value) {
    method mmolConvert (line 340) | public double mmolConvert(double mgdl) {
    method unit (line 344) | public String unit() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/BgSendQueue.java
  class BgSendQueue (line 27) | @Table(name = "BgSendQueue", id = BaseColumns._ID)
    method nextBgJob (line 42) | public static BgSendQueue nextBgJob() {
    method queue (line 51) | public static List<BgSendQueue> queue() {
    method mongoQueue (line 59) | public static List<BgSendQueue> mongoQueue() {
    method addToQueue (line 69) | public static void addToQueue(BgReading bgReading, String operation_ty...
    method markMongoSuccess (line 129) | public void markMongoSuccess() {
    method getBatteryLevel (line 134) | public static int getBatteryLevel(Context context) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/CalibrationSendQueue.java
  class CalibrationSendQueue (line 19) | @Table(name = "CalibrationSendQueue", id = BaseColumns._ID)
    method nextCalibrationJob (line 31) | public static CalibrationSendQueue nextCalibrationJob() {
    method queue (line 41) | public static List<CalibrationSendQueue> queue() {
    method mongoQueue (line 48) | public static List<CalibrationSendQueue> mongoQueue() {
    method addToQueue (line 56) | public static void addToQueue(Calibration calibration, Context context) {
    method markMongoSuccess (line 71) | public void markMongoSuccess() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/CollectionServiceStarter.java
  class CollectionServiceStarter (line 16) | public class CollectionServiceStarter {
    method isBTWixel (line 19) | public static boolean isBTWixel(Context context) {
    method isBTShare (line 27) | public static boolean isBTShare(Context context) {
    method isWifiWixel (line 35) | public static boolean isWifiWixel(Context context) {
    method newStart (line 43) | public static void newStart(Context context) {
    method start (line 48) | public void start(Context context) {
    method CollectionServiceStarter (line 73) | public CollectionServiceStarter(Context context) {
    method restartCollectionService (line 77) | public static void restartCollectionService(Context context) {
    method startBtWixelService (line 85) | private void startBtWixelService() {
    method stopBtWixelService (line 91) | private void stopBtWixelService() {
    method startBtShareService (line 95) | private void startBtShareService() {
    method stopBtShareService (line 101) | private void stopBtShareService() {
    method startWifWixelThread (line 106) | private void startWifWixelThread() {
    method stopWifWixelThread (line 110) | private void stopWifWixelThread() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/Constants.java
  class Constants (line 6) | public class Constants {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/DexShareAttributes.java
  class DexShareAttributes (line 9) | public class DexShareAttributes {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/ForegroundServiceStarter.java
  class ForegroundServiceStarter (line 21) | public class ForegroundServiceStarter {
    method ForegroundServiceStarter (line 27) | public ForegroundServiceStarter(Context context, Service service) {
    method notification (line 34) | private Notification notification() {
    method start (line 59) | public void start() {
    method stop (line 66) | public void stop() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/HM10Attributes.java
  class HM10Attributes (line 6) | public class HM10Attributes {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/Intents.java
  type Intents (line 6) | public interface Intents {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/MongoSendTask.java
  class MongoSendTask (line 17) | public class MongoSendTask extends AsyncTask<String, Void, SyncService> {
    method MongoSendTask (line 24) | public MongoSendTask(Context pContext, BgSendQueue bgSendQueue) {
    method MongoSendTask (line 28) | public MongoSendTask(Context pContext, CalibrationSendQueue calibratio...
    method MongoSendTask (line 32) | public MongoSendTask(Context pContext) {
    method doInBackground (line 38) | public SyncService doInBackground(String... urls) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/NightscoutUploader.java
  class NightscoutUploader (line 48) | public class NightscoutUploader {
    method NightscoutUploader (line 57) | public NightscoutUploader(Context context) {
    method upload (line 64) | public boolean upload(BgReading glucoseDataSet, Calibration meterRecor...
    method upload (line 74) | public boolean upload(List<BgReading> glucoseDataSets, List<Calibratio...
    method doRESTUpload (line 94) | private boolean doRESTUpload(SharedPreferences prefs, List<BgReading> ...
    method doRESTUploadTo (line 120) | private void doRESTUploadTo(String baseURI, List<BgReading> glucoseDat...
    method populateV1APIBGEntry (line 269) | private void populateV1APIBGEntry(JSONObject json, BgReading record) t...
    method populateLegacyAPIEntry (line 284) | private void populateLegacyAPIEntry(JSONObject json, BgReading record)...
    method populateV1APIMeterReadingEntry (line 294) | private void populateV1APIMeterReadingEntry(JSONObject json, Calibrati...
    method populateV1APICalibrationEntry (line 304) | private void populateV1APICalibrationEntry(JSONObject json, Calibratio...
    method postDeviceStatus (line 323) | private void postDeviceStatus(String baseURL, Header apiSecretHeader, ...
    method doMongoUpload (line 346) | private boolean doMongoUpload(SharedPreferences prefs, List<BgReading>...
    method getBatteryLevel (line 432) | public int getBatteryLevel() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/Notifications.java
  class Notifications (line 33) | public class Notifications {
    method setNotificationSettings (line 60) | public static void setNotificationSettings(Context context) {
    method notificationSetter (line 79) | public static void notificationSetter(Context context) {
    method soundAlert (line 132) | public static void soundAlert(String soundUri) {
    method clearAllBgNotifications (line 149) | public static void clearAllBgNotifications() {
    method clearAllCalibrationNotifications (line 152) | public static void clearAllCalibrationNotifications() {
    method bgNotificationCreate (line 159) | public static void bgNotificationCreate(String title, String content, ...
    method calibrationNotificationCreate (line 170) | public static void calibrationNotificationCreate(String title, String ...
    method notificationUpdate (line 180) | public static void notificationUpdate(String title, String content, In...
    method notificationBuilder (line 186) | public static NotificationCompat.Builder notificationBuilder(String ti...
    method notificationIntent (line 193) | public static PendingIntent notificationIntent(Intent intent){
    method notificationDismiss (line 198) | public static void notificationDismiss(int notificationId) {
    method bgAlert (line 203) | public static void bgAlert(String value, String slopeArrow) {
    method calibrationRequest (line 222) | public static void calibrationRequest() {
    method doubleCalibrationRequest (line 233) | public static void doubleCalibrationRequest() {
    method extraCalibrationRequest (line 245) | public static void extraCalibrationRequest() {
    method clearCalibrationRequest (line 257) | public static void clearCalibrationRequest() {
    method clearDoubleCalibrationRequest (line 265) | public static void clearDoubleCalibrationRequest() {
    method clearExtraCalibrationRequest (line 273) | public static void clearExtraCalibrationRequest() {
    method clearBgAlert (line 281) | public static void clearBgAlert() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/PebbleSync.java
  class PebbleSync (line 19) | public class PebbleSync {
    method buildDictionary (line 40) | public PebbleDictionary buildDictionary() {
    method sendData (line 52) | public void sendData(Context context, BgReading bgReading){
    method bgReading (line 59) | public String bgReading() {
    method bgDelta (line 63) | public String bgDelta() {
    method phoneBattery (line 74) | public String phoneBattery() {
    method bgUnit (line 78) | public String bgUnit() {
    method sendDownload (line 82) | public void sendDownload(PebbleDictionary dictionary) {
    method getBatteryLevel (line 91) | public int getBatteryLevel() {
    method slopeOrdinal (line 101) | public String slopeOrdinal(){

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/RedBearLabAttributes.java
  class RedBearLabAttributes (line 8) | public class RedBearLabAttributes {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/RestCalls.java
  class RestCalls (line 28) | public class RestCalls {
    method sendBgReading (line 39) | public static void sendBgReading(final BgSendQueue bgSendQueue) {
    method updateBgReading (line 62) | public static void updateBgReading(final BgSendQueue bgSendQueue) {
    method sendCalibration (line 83) | public static void sendCalibration(final CalibrationSendQueue calibrat...
    method sendSensor (line 105) | public static void sendSensor(final SensorSendQueue sensorSendQueue) {
    method bgReadingInterface (line 126) | public static BgReadingInterface bgReadingInterface() {
    method sensorInterface (line 133) | public static SensorInterface sensorInterface() {
    method calibrationInterface (line 141) | public static CalibrationInterface calibrationInterface() {
    method adapterBuilder (line 148) | public static RestAdapter.Builder adapterBuilder() {
    method requestInterceptor (line 157) | public static RequestInterceptor requestInterceptor(){

FILE: app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/SensorSendQueue.java
  class SensorSendQueue (line 16) | @Table(name = "SensorSendQueue", id = BaseColumns._ID)
    method nextSensorJob (line 26) | public static SensorSendQueue nextSensorJob() {
    method queue (line 36) | public static List<SensorSendQueue> queue() {
    method addToQueue (line 44) | public static void addToQueue(Sensor sensor) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/utils/DatabaseUtil.java
  class DatabaseUtil (line 20) | public class DatabaseUtil {
    method saveSql (line 22) | public static String saveSql(Context context) {
    method loadSql (line 60) | public static void loadSql(Context context, Uri uri) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/utils/FileUtils.java
  class FileUtils (line 7) | public class FileUtils {
    method makeSureDirectoryExists (line 9) | public static boolean makeSureDirectoryExists( final String dir ) {
    method getExternalDir (line 14) | public static String getExternalDir() {
    method combine (line 23) | public static String combine( final String path1, final String path2 ) {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/utils/Preferences.java
  class Preferences (line 39) | public class Preferences extends PreferenceActivity {
    method onCreate (line 42) | @Override
    method onPostCreate (line 50) | @Override
    method isValidFragment (line 57) | @Override
    method onIsMultiPane (line 63) | @Override
    method isXLargeTablet (line 67) | private static boolean isXLargeTablet(Context context) {
    method onBuildHeaders (line 72) | @Override
    method onPreferenceChange (line 78) | @Override
    method bindPreferenceSummaryToValue (line 120) | private static void bindPreferenceSummaryToValue(Preference preference) {
    class AllPrefsFragment (line 128) | public static class AllPrefsFragment extends PreferenceFragment {
      method onCreate (line 129) | @Override

FILE: app/src/main/java/com/eveningoutpost/dexdrip/utils/ShareNotification.java
  class ShareNotification (line 17) | public class ShareNotification {
    method viewOrShare (line 19) | public static void viewOrShare(String mime, Uri uri, NotificationCompa...
    method addShare (line 42) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)

FILE: app/src/main/java/com/eveningoutpost/dexdrip/widgetUpdateService.java
  class widgetUpdateService (line 26) | public class widgetUpdateService extends Service {
    method widgetUpdateService (line 29) | public widgetUpdateService() {}
    method onBind (line 31) | @Override
    method onCreate (line 34) | @Override
    method onStartCommand (line 49) | @Override
    method onDestroy (line 56) | @Override
    method setFailoverTimer (line 64) | public void setFailoverTimer() { //Keep it alive!
    method updateCurrentBgInfo (line 74) | public void updateCurrentBgInfo() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/xDripWidget.java
  class xDripWidget (line 27) | public class xDripWidget extends AppWidgetProvider {
    method onUpdate (line 33) | @Override
    method onEnabled (line 42) | @Override
    method onDisabled (line 48) | @Override
    method updateAppWidget (line 54) | static void updateAppWidget(Context context, AppWidgetManager appWidge...
    method displayCurrentInfo (line 63) | public static void displayCurrentInfo() {

FILE: app/src/main/java/com/eveningoutpost/dexdrip/xdrip.java
  class xdrip (line 16) | @ReportsCrashes(
    method onCreate (line 39) | @Override
Condensed preview — 181 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (777K chars).
[
  {
    "path": ".gitignore",
    "chars": 467,
    "preview": "# Built application files\n*.apk\n*.ap_\n\n# Files for the Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated files\nbi"
  },
  {
    "path": "DexDrip.iml",
    "chars": 1304,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$"
  },
  {
    "path": "LICENSE",
    "chars": 35147,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "README.md",
    "chars": 1833,
    "preview": "xDrip\n=======\n##### ** Please note this is __NOT__ a product created by or backed by Dexcom, you can check them out [her"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/app.iml",
    "chars": 8446,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\":app\" external.linked.project.path=\"$MODULE_D"
  },
  {
    "path": "app/build.gradle",
    "chars": 1120,
    "preview": "buildscript {\n    repositories {\n        maven { url 'https://maven.fabric.io/public' }\n    }\n\n    dependencies {\n      "
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 687,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "app/src/androidTest/java/com/eveningoutpost/dexdrip/ApplicationTest.java",
    "chars": 358,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 6734,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "app/src/main/assets/migrations/10.sql",
    "chars": 204,
    "preview": "ALTER TABLE Notifications ADD COLUMN calibration_alert BOOLEAN;\nALTER TABLE Notifications ADD COLUMN double_calibration_"
  },
  {
    "path": "app/src/main/assets/migrations/16.sql",
    "chars": 125,
    "preview": "ALTER TABLE CalibrationSendQueue ADD COLUMN mongo_success BOOLEAN;\nALTER TABLE BgSendQueue ADD COLUMN mongo_success BOOL"
  },
  {
    "path": "app/src/main/assets/migrations/17.sql",
    "chars": 57,
    "preview": "ALTER TABLE Calibration ADD COLUMN possible_bad BOOLEAN;\n"
  },
  {
    "path": "app/src/main/assets/migrations/18.sql",
    "chars": 214,
    "preview": "ALTER TABLE Calibration ADD COLUMN first_decay REAL;\nALTER TABLE Calibration ADD COLUMN second_decay REAL;\nALTER TABLE C"
  },
  {
    "path": "app/src/main/assets/migrations/19.sql",
    "chars": 223,
    "preview": "ALTER TABLE Calibration ADD COLUMN first_intercept REAL;\nALTER TABLE Calibration ADD COLUMN second_intercept REAL;\nALTER"
  },
  {
    "path": "app/src/main/assets/migrations/20.sql",
    "chars": 53,
    "preview": "ALTER TABLE Calibration ADD COLUMN check_in BOOLEAN;\n"
  },
  {
    "path": "app/src/main/assets/migrations/21.sql",
    "chars": 64,
    "preview": "ALTER TABLE ActiveBluetoothDevice ADD COLUMN connected BOOLEAN;\n"
  },
  {
    "path": "app/src/main/assets/migrations/23.sql",
    "chars": 55,
    "preview": "ALTER TABLE BgReadings ADD COLUMN raw_calculated REAL;\n"
  },
  {
    "path": "app/src/main/assets/migrations/24.sql",
    "chars": 54,
    "preview": "ALTER TABLE BgReadings ADD COLUMN hide_slope BOOLEAN;\n"
  },
  {
    "path": "app/src/main/assets/migrations/25.sql",
    "chars": 46,
    "preview": "ALTER TABLE BgReadings ADD COLUMN noise TEXT;\n"
  },
  {
    "path": "app/src/main/assets/migrations/26.sql",
    "chars": 64,
    "preview": "ALTER TABLE BgReadings ADD COLUMN filtered_data REAL DEFAULT 0;\n"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/AddCalibration.java",
    "chars": 2629,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundl"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/AutoStart.java",
    "chars": 536,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport an"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/BluetoothScan.java",
    "chars": 10323,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.annotation.TargetApi;\nimport android.app.ListActivity;\nimport androi"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/CalibrationCheckInActivity.java",
    "chars": 2315,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundl"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/CalibrationGraph.java",
    "chars": 3223,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.support.v4.wi"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/CalibrationOverride.java",
    "chars": 3028,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundl"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/DoubleCalibrationActivity.java",
    "chars": 3235,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundl"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/FakeNumbers.java",
    "chars": 1444,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport java.util.Date;\n\nimport android.app.Activity;\nimport android.content.Intent;"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Home.java",
    "chars": 18224,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.app.NotificationManager;\nimport android"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/CRC16.java",
    "chars": 852,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;\n\n// This code and this particular library are from the Nigh"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/CRCFailRuntimeException.java",
    "chars": 432,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;\n\n// This code and this particular library are from the Nigh"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/Constants.java",
    "chars": 6266,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;\n\n// This code and this particular library are from the Nigh"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/PacketBuilder.java",
    "chars": 3959,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;\n\nimport android.util.Log;\n\nimport java.util.ArrayList;\nimpo"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/ReadData.java",
    "chars": 15392,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;\n\nimport android.hardware.usb.UsbDevice;\nimport android.hard"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/ReadDataShare.java",
    "chars": 14795,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;\n\nimport android.bluetooth.BluetoothGatt;\nimport android.blu"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/ReadPacket.java",
    "chars": 1228,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;\n\nimport java.util.Arrays;\n\n// This code and this particular"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/SyncingService.java",
    "chars": 15720,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;\n\nimport android.app.IntentService;\nimport android.bluetooth"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/Utils.java",
    "chars": 2955,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom;\n\nimport com.eveningoutpost.dexdrip.ImportedLibraries.dexcom"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/CalRecord.java",
    "chars": 2275,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;\n\nimport android.util.Log;\nimport java.nio.ByteBuffe"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/CalSubrecord.java",
    "chars": 1592,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;\n\nimport android.util.Log;\n\nimport com.eveningoutpos"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/EGVRecord.java",
    "chars": 2074,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;\n\nimport android.util.Log;\n\nimport com.eveningoutpos"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/GenericTimestampRecord.java",
    "chars": 1515,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;\n\nimport com.eveningoutpost.dexdrip.ImportedLibrarie"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/GenericXMLRecord.java",
    "chars": 1639,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;\n\nimport android.util.Log;\n\nimport org.w3c.dom.Docum"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/GlucoseDataSet.java",
    "chars": 1620,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;\n\nimport com.eveningoutpost.dexdrip.ImportedLibrarie"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/MeterRecord.java",
    "chars": 830,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;\n\nimport java.nio.ByteBuffer;\nimport java.nio.ByteOr"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/PageHeader.java",
    "chars": 3204,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;\n\nimport android.util.Log;\n\nimport com.eveningoutpos"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/dexcom/records/SensorRecord.java",
    "chars": 1260,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.dexcom.records;\n\nimport android.util.Log;\n\nimport java.nio.ByteBuff"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/BuildInfo.java",
    "chars": 518,
    "preview": "package com.eveningoutpost.dexdrip.ImportedLibraries.usbserial;\n\n/**\n * Static container of information about this libra"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/CdcAcmSerialDriver.java",
    "chars": 13264,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/CommonUsbSerialPort.java",
    "chars": 5109,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/Cp21xxSerialDriver.java",
    "chars": 14609,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/FtdiSerialDriver.java",
    "chars": 23126,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/ProbeTable.java",
    "chars": 3756,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/ProlificSerialDriver.java",
    "chars": 22803,
    "preview": "/* This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General "
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbId.java",
    "chars": 2772,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbSerialDriver.java",
    "chars": 1479,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbSerialPort.java",
    "chars": 7695,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbSerialProber.java",
    "chars": 4136,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/driver/UsbSerialRuntimeException.java",
    "chars": 1456,
    "preview": "/*\n * Copyright 2011 Google Inc.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under "
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/util/HexDump.java",
    "chars": 4718,
    "preview": "/*\n * Copyright (C) 2006 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ImportedLibraries/usbserial/util/SerialInputOutputManager.java",
    "chars": 5668,
    "preview": "/* Copyright 2011-2013 Google Inc.\n * Copyright 2013 mike wakerly <opensource@hoho.com>\n *\n * This library is free softw"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Interfaces/BgReadingInterface.java",
    "chars": 694,
    "preview": "package com.eveningoutpost.dexdrip.Interfaces;\n\nimport com.eveningoutpost.dexdrip.Models.BgReading;\n\nimport retrofit.Cal"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Interfaces/CalibrationInterface.java",
    "chars": 472,
    "preview": "package com.eveningoutpost.dexdrip.Interfaces;\n\nimport com.eveningoutpost.dexdrip.Models.Calibration;\n\nimport retrofit.C"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Interfaces/SensorInterface.java",
    "chars": 435,
    "preview": "package com.eveningoutpost.dexdrip.Interfaces;\n\nimport com.eveningoutpost.dexdrip.Sensor;\n\nimport retrofit.Callback;\nimp"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Interfaces/UserInterface.java",
    "chars": 355,
    "preview": "package com.eveningoutpost.dexdrip.Interfaces;\n\nimport com.eveningoutpost.dexdrip.Models.User;\n\nimport retrofit.Callback"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/LicenseAgreementActivity.java",
    "chars": 1568,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.content."
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Models/ActiveBluetoothDevice.java",
    "chars": 1827,
    "preview": "package com.eveningoutpost.dexdrip.Models;\n\nimport android.provider.BaseColumns;\n\nimport com.activeandroid.Model;\nimport"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Models/BgReading.java",
    "chars": 26181,
    "preview": "package com.eveningoutpost.dexdrip.Models;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport androi"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Models/Calibration.java",
    "chars": 28400,
    "preview": "package com.eveningoutpost.dexdrip.Models;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nim"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Models/CalibrationRequest.java",
    "chars": 2385,
    "preview": "package com.eveningoutpost.dexdrip.Models;\n\nimport android.provider.BaseColumns;\n\nimport com.activeandroid.Model;\nimport"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Models/TransmitterData.java",
    "chars": 3522,
    "preview": "package com.eveningoutpost.dexdrip.Models;\n\nimport android.provider.BaseColumns;\nimport android.util.Log;\n\nimport com.ac"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Models/User.java",
    "chars": 3291,
    "preview": "package com.eveningoutpost.dexdrip.Models;\n\nimport android.provider.BaseColumns;\nimport android.util.Log;\n\nimport com.ac"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Models/UserNotification.java",
    "chars": 2689,
    "preview": "package com.eveningoutpost.dexdrip.Models;\n\nimport android.provider.BaseColumns;\n\nimport com.activeandroid.Model;\nimport"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/NavDrawerBuilder.java",
    "chars": 6635,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.conte"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/NavigationDrawerFragment.java",
    "chars": 9501,
    "preview": "package com.eveningoutpost.dexdrip;\n\n\nimport android.app.ActionBar;\nimport android.app.Activity;\nimport android.app.Frag"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Sensor.java",
    "chars": 1891,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.provider.BaseColumns;\nimport android.util.Log;\n\nimport com.activeand"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Services/ComunicationHeader.java",
    "chars": 509,
    "preview": "package com.eveningoutpost.dexdrip.Services;\n\nimport java.io.Serializable;\n\nimport com.google.gson.annotations.Expose;\n\n"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Services/DexCollectionService.java",
    "chars": 13224,
    "preview": "/*\n * Copyright (C) 2013 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Services/DexShareCollectionService.java",
    "chars": 31153,
    "preview": "package com.eveningoutpost.dexdrip.Services;\n\nimport android.annotation.TargetApi;\nimport android.app.AlarmManager;\nimpo"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Services/MongoWrapper.java",
    "chars": 4863,
    "preview": "package com.eveningoutpost.dexdrip.Services;\nimport java.io.IOException;\nimport java.net.UnknownHostException;\n\nimport a"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Services/SyncService.java",
    "chars": 2926,
    "preview": "package com.eveningoutpost.dexdrip.Services;\n\nimport android.app.AlarmManager;\nimport android.app.PendingIntent;\nimport "
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Services/TransmitterRawData.java",
    "chars": 6442,
    "preview": "package com.eveningoutpost.dexdrip.Services;\nimport java.util.Date;\nimport com.mongodb.BasicDBObject;\n/**\n * Created by "
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Services/WixelReader.java",
    "chars": 14936,
    "preview": "package com.eveningoutpost.dexdrip.Services;\n\nimport java.io.IOException;\nimport java.util.Date;\nimport java.io.Buffered"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/SettingsActivity.java",
    "chars": 3631,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.media.Ringtone;\nimport android.media.RingtoneManager;\nimport android"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/DexcomShareInterface.java",
    "chars": 1230,
    "preview": "package com.eveningoutpost.dexdrip.ShareModels;\n\nimport java.util.Map;\n\nimport retrofit.Callback;\nimport retrofit.client"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/Egv.java",
    "chars": 1610,
    "preview": "package com.eveningoutpost.dexdrip.ShareModels;\n\nimport com.eveningoutpost.dexdrip.Models.BgReading;\nimport com.google.g"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/ShareAuthenticationBody.java",
    "chars": 539,
    "preview": "package com.eveningoutpost.dexdrip.ShareModels;\n\nimport com.google.gson.annotations.Expose;\n\n/**\n * Created by stephenbl"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/ShareGlucose.java",
    "chars": 3314,
    "preview": "package com.eveningoutpost.dexdrip.ShareModels;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport a"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/ShareRest.java",
    "chars": 13346,
    "preview": "package com.eveningoutpost.dexdrip.ShareModels;\n\nimport android.content.Context;\nimport android.content.SharedPreference"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ShareModels/ShareUploadPayload.java",
    "chars": 620,
    "preview": "package com.eveningoutpost.dexdrip.ShareModels;\n\nimport com.eveningoutpost.dexdrip.Models.BgReading;\nimport com.google.g"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/ShareTest.java",
    "chars": 23071,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.app.AlarmManager;\nimport android.app.Pe"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/StartNewSensor.java",
    "chars": 3370,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundl"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/StopSensor.java",
    "chars": 2260,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundl"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/SystemStatus.java",
    "chars": 7099,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.bluetooth.BluetoothAdapter;\nimport andr"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Tables/BgReadingTable.java",
    "chars": 4252,
    "preview": "package com.eveningoutpost.dexdrip.Tables;\n\nimport android.app.ListActivity;\nimport android.content.Context;\nimport andr"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Tables/CalibrationDataTable.java",
    "chars": 4380,
    "preview": "package com.eveningoutpost.dexdrip.Tables;\n\nimport android.app.ListActivity;\nimport android.content.Context;\nimport andr"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/Tables/SensorDataTable.java",
    "chars": 2028,
    "preview": "package com.eveningoutpost.dexdrip.Tables;\n\nimport android.app.ListActivity;\nimport android.database.Cursor;\nimport andr"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UsbConnectedActivity.java",
    "chars": 905,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundl"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/BgGraphBuilder.java",
    "chars": 13459,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.content.Context;\nimport android.content.SharedPreferen"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/BgSendQueue.java",
    "chars": 5325,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/CalibrationSendQueue.java",
    "chars": 2495,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.content.Context;\nimport android.content.SharedPreferen"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/CollectionServiceStarter.java",
    "chars": 4418,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/Constants.java",
    "chars": 229,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\n/**\n * Various constants\n */\npublic class Constants {\n    public stat"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/DexShareAttributes.java",
    "chars": 2127,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport java.math.BigInteger;\nimport java.util.UUID;\n\n/**\n * Created b"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/ForegroundServiceStarter.java",
    "chars": 2677,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.app.Notification;\nimport android.app.PendingIntent;\nim"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/HM10Attributes.java",
    "chars": 384,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\n/**\n * Created by stephenblack on 10/26/14.\n */\npublic class HM10Attr"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/Intents.java",
    "chars": 763,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\n/**\n * For integration.\n */\npublic interface Intents {\n    String REC"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/MongoSendTask.java",
    "chars": 2749,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.content.Context;\nimport android.os.AsyncTask;\nimport a"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/NightscoutUploader.java",
    "chars": 21075,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/Notifications.java",
    "chars": 14482,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.app.NotificationManager;\nimport android.app.PendingInt"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/PebbleSync.java",
    "chars": 4643,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/RedBearLabAttributes.java",
    "chars": 470,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport java.util.UUID;\n\n/**\n * Created by stephenblack on 2/21/15.\n *"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/RestCalls.java",
    "chars": 6819,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.util.Log;\n\nimport com.eveningoutpost.dexdrip.Interface"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/SensorSendQueue.java",
    "chars": 1391,
    "preview": "package com.eveningoutpost.dexdrip.UtilityModels;\n\nimport android.provider.BaseColumns;\n\nimport com.activeandroid.Model;"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/utils/DatabaseUtil.java",
    "chars": 3028,
    "preview": "package com.eveningoutpost.dexdrip.utils;\n\nimport android.content.Context;\nimport android.net.Uri;\nimport android.os.Env"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/utils/FileUtils.java",
    "chars": 717,
    "preview": "package com.eveningoutpost.dexdrip.utils;\n\nimport android.os.Environment;\n\nimport java.io.File;\n\npublic class FileUtils "
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/utils/Preferences.java",
    "chars": 11897,
    "preview": "package com.eveningoutpost.dexdrip.utils;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimp"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/utils/ShareNotification.java",
    "chars": 2249,
    "preview": "package com.eveningoutpost.dexdrip.utils;\n\nimport android.annotation.TargetApi;\nimport android.app.Notification;\nimport "
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/widgetUpdateService.java",
    "chars": 3217,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.AlarmManager;\nimport android.app.PendingIntent;\nimport android.a"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/xDripWidget.java",
    "chars": 5192,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.appwidget.AppWidgetManager;\nimport android.appwidget.AppWidgetProvid"
  },
  {
    "path": "app/src/main/java/com/eveningoutpost/dexdrip/xdrip.java",
    "chars": 1523,
    "preview": "package com.eveningoutpost.dexdrip;\n\nimport android.app.Application;\n\nimport com.crashlytics.android.Crashlytics;\nimport"
  },
  {
    "path": "app/src/main/res/layout/activity_add_calibration.xml",
    "chars": 2024,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_add_comparison.xml",
    "chars": 2420,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_bluetooth_scan.xml",
    "chars": 1426,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_calibration_check_in.xml",
    "chars": 1799,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_calibration_graph.xml",
    "chars": 2497,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_calibration_override.xml",
    "chars": 2613,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_double_calibration.xml",
    "chars": 3217,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_fake_numbers.xml",
    "chars": 1804,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "app/src/main/res/layout/activity_home.xml",
    "chars": 3734,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_license_agreement.xml",
    "chars": 2103,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "app/src/main/res/layout/activity_raw_data_table.xml",
    "chars": 923,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com"
  },
  {
    "path": "app/src/main/res/layout/activity_share_test.xml",
    "chars": 2219,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "app/src/main/res/layout/activity_start_new_sensor.xml",
    "chars": 3175,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_stop_sensor.xml",
    "chars": 2354,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com"
  },
  {
    "path": "app/src/main/res/layout/activity_system_status.xml",
    "chars": 7368,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/layout/activity_usb_connected.xml",
    "chars": 669,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "app/src/main/res/layout/fragment_navigation_drawer.xml",
    "chars": 414,
    "preview": "<ListView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\" "
  },
  {
    "path": "app/src/main/res/layout/listitem_device.xml",
    "chars": 684,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        "
  },
  {
    "path": "app/src/main/res/layout/raw_data_list.xml",
    "chars": 923,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com"
  },
  {
    "path": "app/src/main/res/layout/raw_data_list_item.xml",
    "chars": 926,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    and"
  },
  {
    "path": "app/src/main/res/layout/x_drip_widget.xml",
    "chars": 2274,
    "preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"wrap_content\"\n    and"
  },
  {
    "path": "app/src/main/res/layout-xlarge/activity_home.xml",
    "chars": 3780,
    "preview": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http"
  },
  {
    "path": "app/src/main/res/menu/global.xml",
    "chars": 74,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n</menu>\n"
  },
  {
    "path": "app/src/main/res/menu/menu_bluetooth_scan.xml",
    "chars": 1274,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2013 The Android Open Source Project\n\n     Licensed under the "
  },
  {
    "path": "app/src/main/res/menu/menu_home.xml",
    "chars": 325,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item andro"
  },
  {
    "path": "app/src/main/res/menu/menu_share_test.xml",
    "chars": 336,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    "
  },
  {
    "path": "app/src/main/res/menu/menu_system_status.xml",
    "chars": 339,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    "
  },
  {
    "path": "app/src/main/res/values/arrays.xml",
    "chars": 634,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string-array name=\"DexCollectionMethods\">\n        <item>Bluetoot"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 506,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <!-- Default screen margins, per the Android Design guidelines. "
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 6828,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <string name=\"pref_I_understand_title\"> I UNDERSTAND AND AGREE</"
  },
  {
    "path": "app/src/main/res/values/strings_activity_preferences.xml",
    "chars": 2105,
    "preview": "<resources>\n    <string name=\"title_activity_preferences\">Preferences</string>\n\n    <!-- Strings related to Settings -->"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 499,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo\">\n\n        <item"
  },
  {
    "path": "app/src/main/res/values-v14/dimens.xml",
    "chars": 263,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <!--\nRefer to App Widget Documentation for margin information\nht"
  },
  {
    "path": "app/src/main/res/values-v21/styles.xml",
    "chars": 457,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <style name=\"AppTheme\" parent=\"android:ThemeOverlay.Material\">\n  "
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "chars": 358,
    "preview": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as s"
  },
  {
    "path": "app/src/main/res/xml/device_filter.xml",
    "chars": 889,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2011 The Android Open Source Project\n     Licensed under the A"
  },
  {
    "path": "app/src/main/res/xml/pref_advanced_settings.xml",
    "chars": 1446,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\">\n   "
  },
  {
    "path": "app/src/main/res/xml/pref_data_source.xml",
    "chars": 1570,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\">\n   "
  },
  {
    "path": "app/src/main/res/xml/pref_data_sync.xml",
    "chars": 4246,
    "preview": "<PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <!-- NOTE: Hide buttons to simplify t"
  },
  {
    "path": "app/src/main/res/xml/pref_general.xml",
    "chars": 1112,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n    <PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\">"
  },
  {
    "path": "app/src/main/res/xml/pref_headers.xml",
    "chars": 103,
    "preview": "<preference-headers xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n</preference-headers>\n"
  },
  {
    "path": "app/src/main/res/xml/pref_license.xml",
    "chars": 601,
    "preview": "<PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <PreferenceCategory\n        android:ti"
  },
  {
    "path": "app/src/main/res/xml/pref_notifications.xml",
    "chars": 4391,
    "preview": "<PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <PreferenceCategory\n        android:ti"
  },
  {
    "path": "app/src/main/res/xml/x_drip_widget_info.xml",
    "chars": 472,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<appwidget-provider xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  "
  },
  {
    "path": "battle_of_the_dexes.md",
    "chars": 1483,
    "preview": "\nA few weeks ago I started a new sensor and kicked off the BattleOfTheDexes\nI compared my xDrip Alogrithm against the De"
  },
  {
    "path": "build.gradle",
    "chars": 572,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    r"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 232,
    "preview": "#Wed Dec 10 18:45:32 EST 2014\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 855,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 5080,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2404,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
  },
  {
    "path": "hardware_setup.md",
    "chars": 5750,
    "preview": "## What you need to get started\nNote, the following describes what I am currently using and recommend, it could definite"
  },
  {
    "path": "settings.gradle",
    "chars": 15,
    "preview": "include ':app'\n"
  },
  {
    "path": "xDrip-Experimental.iml",
    "chars": 1399,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\"xDrip-Experimental\" external.linked.project.p"
  },
  {
    "path": "xDrip.iml",
    "chars": 1304,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$"
  }
]

// ... and 5 more files (download for full content)

About this extraction

This page contains the full source code of the StephenBlackWasAlreadyTaken/xDrip GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 181 files (717.9 KB), approximately 163.2k tokens, and a symbol index with 968 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!