├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── FlicLibProj.iml ├── LICENSE.txt ├── README.md ├── build.gradle ├── docs ├── allclasses-frame.html ├── allclasses-noframe.html ├── constant-values.html ├── deprecated-list.html ├── help-doc.html ├── index-files │ ├── index-1.html │ ├── index-10.html │ ├── index-11.html │ ├── index-12.html │ ├── index-13.html │ ├── index-14.html │ ├── index-15.html │ ├── index-16.html │ ├── index-17.html │ ├── index-18.html │ ├── index-19.html │ ├── index-2.html │ ├── index-20.html │ ├── index-21.html │ ├── index-3.html │ ├── index-4.html │ ├── index-5.html │ ├── index-6.html │ ├── index-7.html │ ├── index-8.html │ └── index-9.html ├── index.html ├── io │ └── flic │ │ └── lib │ │ ├── AppCredentialsNotProvidedException.html │ │ ├── FlicAppNotInstalledException.html │ │ ├── FlicBroadcastReceiver.html │ │ ├── FlicBroadcastReceiverFlags.html │ │ ├── FlicButton.html │ │ ├── FlicButtonCallback.html │ │ ├── FlicButtonCallbackFlags.html │ │ ├── FlicError.html │ │ ├── FlicIntentExtras.html │ │ ├── FlicIntentTypes.html │ │ ├── FlicIntentValues.html │ │ ├── FlicManager.html │ │ ├── FlicManagerInitializedCallback.html │ │ ├── FlicManagerUninitializedCallback.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html ├── overview-tree.html ├── package-list ├── resources │ ├── background.gif │ ├── tab.gif │ ├── titlebar.gif │ └── titlebar_end.gif ├── serialized-form.html └── stylesheet.css ├── fliclib ├── .gitignore ├── build.gradle ├── fliclib.iml ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── io │ │ └── flic │ │ └── lib │ │ ├── IFlicLibCallbackInterface.aidl │ │ └── IFlicLibInterface.aidl │ └── java │ └── io │ └── flic │ └── lib │ ├── AppCredentialsNotProvidedException.java │ ├── Curve25519.java │ ├── DB.java │ ├── FlicAppNotInstalledException.java │ ├── FlicBroadcastReceiver.java │ ├── FlicBroadcastReceiverFlags.java │ ├── FlicButton.java │ ├── FlicButtonCallback.java │ ├── FlicButtonCallbackFlags.java │ ├── FlicIntentExtras.java │ ├── FlicIntentTypes.java │ ├── FlicIntentValues.java │ ├── FlicManager.java │ ├── FlicManagerInitializedCallback.java │ ├── FlicManagerUninitializedCallback.java │ └── Utils.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | FlicLibProj -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 24 | 25 | 37 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 64 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FlicLibProj.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fliclib-android 2 | 3 | This SDK library can be used to create your own functionality for flic buttons. Buy buttons at https://flic.io. 4 | See the tutorial at https://partners.flic.io/partners/developers/android-tutorial for more info. 5 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 |

All Classes

12 |
13 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 |

All Classes

12 |
13 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
64 |

Deprecated API

65 |

Contents

66 |
67 | 68 |
69 | 70 | 71 | 72 | 73 | 81 |
82 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /docs/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Help 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
64 |

How This API Document Is Organized

65 |
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
66 |
67 |
68 | 163 | This help file applies to API documentation generated using the standard doclet.
164 | 165 |
166 | 167 | 168 | 169 | 170 | 178 |
179 | 206 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /docs/index-files/index-1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | A-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

A

67 |
68 |
addFlicButtonCallback(FlicButtonCallback) - Method in class io.flic.lib.FlicButton
69 |
70 |
Add callbacks for this button.
71 |
72 |
ALL - Static variable in class io.flic.lib.FlicBroadcastReceiverFlags
73 |
 
74 |
ALL - Static variable in class io.flic.lib.FlicButtonCallbackFlags
75 |
 
76 |
AppCredentialsNotProvidedException - Exception in io.flic.lib
77 |
78 |
Exception thrown when app credentials were not provided.
79 |
80 |
81 | A B C D F G I N O R S T U 
82 | 83 |
84 | 85 | 86 | 87 | 88 | 96 |
97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/index-files/index-10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | R-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

R

67 |
68 |
readRemoteRSSI() - Method in class io.flic.lib.FlicButton
69 |
70 |
Read the current RSSI value of the button.
71 |
72 |
registerListenForBroadcast(int) - Method in class io.flic.lib.FlicButton
73 |
74 |
To receive button clicks that also works in the case the app is not currently running, you 75 | can set up a broadcast receiver extending FlicBroadcastReceiver.
76 |
77 |
releaseExclusivity() - Method in class io.flic.lib.FlicButton
78 |
79 |
Release a button exclusivity.
80 |
81 |
removeAllFlicButtonCallbacks() - Method in class io.flic.lib.FlicButton
82 |
83 |
Remove all callbacks for this button.
84 |
85 |
REMOVED - Static variable in class io.flic.lib.FlicBroadcastReceiverFlags
86 |
 
87 |
removeFlicButtonCallback(FlicButtonCallback) - Method in class io.flic.lib.FlicButton
88 |
89 |
Removes a callback for this button.
90 |
91 |
92 | A B C D F G I N O R S T U 
93 | 94 |
95 | 96 | 97 | 98 | 99 | 107 |
108 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /docs/index-files/index-11.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | S-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

S

67 |
68 |
setActiveMode(boolean) - Method in class io.flic.lib.FlicButton
69 |
70 |
Set the button to active mode.
71 |
72 |
setAppCredentials(String, String, String) - Static method in class io.flic.lib.FlicManager
73 |
74 |
Set the App credentials.
75 |
76 |
setFlicButtonCallbackFlags(int) - Method in class io.flic.lib.FlicButton
77 |
78 |
Set which button events to listen for.
79 |
80 |
81 | A B C D F G I N O R S T U 
82 | 83 |
84 | 85 | 86 | 87 | 88 | 96 |
97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/index-files/index-12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | T-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

T

67 |
68 |
toString() - Method in class io.flic.lib.FlicButton
69 |
 
70 |
71 | A B C D F G I N O R S T U 
72 | 73 |
74 | 75 | 76 | 77 | 78 | 86 |
87 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /docs/index-files/index-13.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | U-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

U

67 |
68 |
UP_OR_DOWN - Static variable in class io.flic.lib.FlicBroadcastReceiverFlags
69 |
 
70 |
UP_OR_DOWN - Static variable in class io.flic.lib.FlicButtonCallbackFlags
71 |
 
72 |
73 | A B C D F G I N O R S T U 
74 | 75 |
76 | 77 | 78 | 79 | 80 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/index-files/index-15.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Q-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D E F G H I L M N O P Q R S T U V W  64 | 65 | 66 |

Q

67 |
68 |
queryBackground - Static variable in class io.flic.lib.R.attr
69 |
70 |
Must be a reference to another resource, in the form "@[+][package:]type:name" 71 | or to a theme attribute in the form "?
72 |
73 |
queryHint - Static variable in class io.flic.lib.R.attr
74 |
75 |
Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
76 |
77 |
78 | A B C D E F G H I L M N O P Q R S T U V W 
79 | 80 |
81 | 82 | 83 | 84 | 85 | 93 |
94 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /docs/index-files/index-19.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | U-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D E F G H I L M N O P Q R S T U V W  64 | 65 | 66 |

U

67 |
68 |
unListenForConnectionCallbacks(long, String) - Method in interface io.flic.lib.IFlicLibInterface
69 |
 
70 |
unregisterCallback(long) - Method in interface io.flic.lib.IFlicLibInterface
71 |
 
72 |
up - Static variable in class io.flic.lib.R.id
73 |
 
74 |
UP_OR_DOWN - Static variable in class io.flic.lib.FlicBroadcastReceiverFlags
75 |
 
76 |
UP_OR_DOWN - Static variable in class io.flic.lib.FlicButtonCallbackFlags
77 |
 
78 |
useLogo - Static variable in class io.flic.lib.R.id
79 |
 
80 |
81 | A B C D E F G H I L M N O P Q R S T U V W 
82 | 83 |
84 | 85 | 86 | 87 | 88 | 96 |
97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/index-files/index-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | B-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

B

67 |
68 |
BUTTON_CONNECTION_COMPLETED - Static variable in class io.flic.lib.FlicButton
69 |
70 |
The button is currently connected and button events will arrive immediately when pressed.
71 |
72 |
BUTTON_CONNECTION_STARTED - Static variable in class io.flic.lib.FlicButton
73 |
74 |
The button is currently not connected but there is a pending connection to it.
75 |
76 |
BUTTON_DISCONNECTED - Static variable in class io.flic.lib.FlicButton
77 |
78 |
The button is disconnected and there is no pending connection to it.
79 |
80 |
81 | A B C D F G I N O R S T U 
82 | 83 |
84 | 85 | 86 | 87 | 88 | 96 |
97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/index-files/index-3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | C-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

C

67 |
68 |
CLICK_OR_DOUBLE_CLICK - Static variable in class io.flic.lib.FlicBroadcastReceiverFlags
69 |
 
70 |
CLICK_OR_DOUBLE_CLICK - Static variable in class io.flic.lib.FlicButtonCallbackFlags
71 |
 
72 |
CLICK_OR_DOUBLE_CLICK_OR_HOLD - Static variable in class io.flic.lib.FlicBroadcastReceiverFlags
73 |
 
74 |
CLICK_OR_DOUBLE_CLICK_OR_HOLD - Static variable in class io.flic.lib.FlicButtonCallbackFlags
75 |
 
76 |
CLICK_OR_HOLD - Static variable in class io.flic.lib.FlicBroadcastReceiverFlags
77 |
 
78 |
CLICK_OR_HOLD - Static variable in class io.flic.lib.FlicButtonCallbackFlags
79 |
 
80 |
completeGrabButton(int, int, Intent) - Method in class io.flic.lib.FlicManager
81 |
82 |
Completes a grab button sequence.
83 |
84 |
85 | A B C D F G I N O R S T U 
86 | 87 |
88 | 89 | 90 | 91 | 92 | 100 |
101 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /docs/index-files/index-4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | D-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

D

67 |
68 |
destroyInstance() - Static method in class io.flic.lib.FlicManager
69 |
70 |
Clean resources and unregister all callbacks.
71 |
72 |
73 | A B C D F G I N O R S T U 
74 | 75 |
76 | 77 | 78 | 79 | 80 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/index-files/index-6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | G-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

G

67 |
68 |
getButtonByDeviceId(String) - Method in class io.flic.lib.FlicManager
69 |
70 |
Get a button by its Bluetooth device address.
71 |
72 |
getButtonId() - Method in class io.flic.lib.FlicButton
73 |
74 |
Get the Bluetooth device address of this button.
75 |
76 |
getCallbackFlags() - Method in class io.flic.lib.FlicButton
77 |
78 |
Get the current callback flags.
79 |
80 |
getColor() - Method in class io.flic.lib.FlicButton
81 |
82 |
Get the color of this button.
83 |
84 |
getConnectionStatus() - Method in class io.flic.lib.FlicButton
85 |
86 |
Get the connection status.
87 |
88 |
getInstance(Context, FlicManagerInitializedCallback) - Static method in class io.flic.lib.FlicManager
89 |
90 |
Get the singleton instance of the manager.
91 |
92 |
getInstance(Context, FlicManagerInitializedCallback, FlicManagerUninitializedCallback) - Static method in class io.flic.lib.FlicManager
93 |
94 |
Get the singleton instance of the manager.
95 |
96 |
getKnownButtons() - Method in class io.flic.lib.FlicManager
97 |
98 |
Get a copy of the internal list of buttons.
99 |
100 |
getName() - Method in class io.flic.lib.FlicButton
101 |
102 |
Get the name of this button, as assigned in the Flic app.
103 |
104 |
GRAB_BUTTON_REQUEST_CODE - Static variable in class io.flic.lib.FlicManager
105 |
106 |
Request code used in the grab button flow.
107 |
108 |
grabExclusivity() - Method in class io.flic.lib.FlicButton
109 |
110 |
Grab a button exclusivity.
111 |
112 |
113 | A B C D F G I N O R S T U 
114 | 115 |
116 | 117 | 118 | 119 | 120 | 128 |
129 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /docs/index-files/index-7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | I-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

I

67 |
68 |
initiateGrabButton(Activity) - Method in class io.flic.lib.FlicManager
69 |
70 |
Initiate a grab button sequence.
71 |
72 |
io.flic.lib - package io.flic.lib
73 |
 
74 |
isInitialized() - Method in class io.flic.lib.FlicManager
75 |
76 |
Is initialized.
77 |
78 |
79 | A B C D F G I N O R S T U 
80 | 81 |
82 | 83 | 84 | 85 | 86 | 94 |
95 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /docs/index-files/index-8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | N-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
A B C D F G I N O R S T U  64 | 65 | 66 |

N

67 |
68 |
NONE - Static variable in class io.flic.lib.FlicBroadcastReceiverFlags
69 |
 
70 |
NONE - Static variable in class io.flic.lib.FlicButtonCallbackFlags
71 |
 
72 |
73 | A B C D F G I N O R S T U 
74 | 75 |
76 | 77 | 78 | 79 | 80 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 59 | 60 | 61 | 62 | 63 | 64 | <noscript> 65 | <div>JavaScript is disabled on your browser.</div> 66 | </noscript> 67 | <h2>Frame Alert</h2> 68 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="io/flic/lib/package-summary.html">Non-frame version</a>.</p> 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /docs/io/flic/lib/AppCredentialsNotProvidedException.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | AppCredentialsNotProvidedException 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 77 | 78 | 79 |
80 |
io.flic.lib
81 |

Class AppCredentialsNotProvidedException

82 |
83 |
84 | 107 |
108 |
    109 |
  • 110 |
    111 |
    All Implemented Interfaces:
    112 |
    java.io.Serializable
    113 |
    114 |
    115 |
    116 |
    public class AppCredentialsNotProvidedException
    117 | extends java.lang.RuntimeException
    118 |
    Exception thrown when app credentials were not provided.
    119 |
    See Also:
    Serialized Form
    120 |
  • 121 |
122 |
123 |
124 |
    125 |
  • 126 | 127 |
      128 |
    • 129 | 130 | 131 |

      Method Summary

      132 |
        133 |
      • 134 | 135 | 136 |

        Methods inherited from class java.lang.Throwable

        137 | addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • 138 |
      139 |
        140 |
      • 141 | 142 | 143 |

        Methods inherited from class java.lang.Object

        144 | clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • 145 |
      146 |
    • 147 |
    148 |
  • 149 |
150 |
151 |
152 | 153 | 154 |
155 | 156 | 157 | 158 | 159 | 167 |
168 | 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /docs/io/flic/lib/FlicAppNotInstalledException.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | FlicAppNotInstalledException 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 77 | 78 | 79 |
80 |
io.flic.lib
81 |

Class FlicAppNotInstalledException

82 |
83 |
84 | 107 |
108 |
    109 |
  • 110 |
    111 |
    All Implemented Interfaces:
    112 |
    java.io.Serializable
    113 |
    114 |
    115 |
    116 |
    public class FlicAppNotInstalledException
    117 | extends java.lang.RuntimeException
    118 |
    Exception thrown when the Flic App was not installed
    119 |
    See Also:
    Serialized Form
    120 |
  • 121 |
122 |
123 |
124 |
    125 |
  • 126 | 127 |
      128 |
    • 129 | 130 | 131 |

      Method Summary

      132 |
        133 |
      • 134 | 135 | 136 |

        Methods inherited from class java.lang.Throwable

        137 | addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • 138 |
      139 |
        140 |
      • 141 | 142 | 143 |

        Methods inherited from class java.lang.Object

        144 | clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • 145 |
      146 |
    • 147 |
    148 |
  • 149 |
150 |
151 |
152 | 153 | 154 |
155 | 156 | 157 | 158 | 159 | 167 |
168 | 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /docs/io/flic/lib/FlicManagerInitializedCallback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | FlicManagerInitializedCallback 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 77 | 78 | 79 |
80 |
io.flic.lib
81 |

Interface FlicManagerInitializedCallback

82 |
83 |
84 |
85 |
    86 |
  • 87 |
    88 |
    89 |
    public interface FlicManagerInitializedCallback
    90 |
    FlicManagerInitializedCallback.
    91 |
  • 92 |
93 |
94 |
95 |
    96 |
  • 97 | 98 |
      99 |
    • 100 | 101 | 102 |

      Method Summary

      103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 114 | 115 |
      Methods 
      Modifier and TypeMethod and Description
      voidonInitialized(FlicManager manager) 112 |
      Called once when the manager has been initialized.
      113 |
      116 |
    • 117 |
    118 |
  • 119 |
120 |
121 |
122 | 147 |
148 |
149 | 150 | 151 |
152 | 153 | 154 | 155 | 156 | 164 |
165 | 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /docs/io/flic/lib/FlicManagerUninitializedCallback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | FlicManagerUninitializedCallback 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 77 | 78 | 79 |
80 |
io.flic.lib
81 |

Class FlicManagerUninitializedCallback

82 |
83 |
84 | 92 |
93 |
    94 |
  • 95 |
    96 |
    97 |
    public class FlicManagerUninitializedCallback
     98 | extends java.lang.Object
    99 |
    FlicManagerUninitializedCallback
    100 |
  • 101 |
102 |
103 |
104 |
    105 |
  • 106 | 107 | 123 | 124 |
      125 |
    • 126 | 127 | 128 |

      Method Summary

      129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 140 | 141 |
      Methods 
      Modifier and TypeMethod and Description
      voidonUninitialized(FlicManager manager) 138 |
      Called when the manager was uninitialized.
      139 |
      142 |
        143 |
      • 144 | 145 | 146 |

        Methods inherited from class java.lang.Object

        147 | clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 148 |
      149 |
    • 150 |
    151 |
  • 152 |
153 |
154 |
155 |
    156 |
  • 157 | 158 |
      159 |
    • 160 | 161 | 162 |

      Constructor Detail

      163 | 164 | 165 | 166 |
        167 |
      • 168 |

        FlicManagerUninitializedCallback

        169 |
        public FlicManagerUninitializedCallback()
        170 |
      • 171 |
      172 |
    • 173 |
    174 | 175 |
      176 |
    • 177 | 178 | 179 |

      Method Detail

      180 | 181 | 182 | 183 |
        184 |
      • 185 |

        onUninitialized

        186 |
        public void onUninitialized(FlicManager manager)
        187 |
        Called when the manager was uninitialized.
        188 |
        Parameters:
        manager - The manager
        189 |
      • 190 |
      191 |
    • 192 |
    193 |
  • 194 |
195 |
196 |
197 | 198 | 199 |
200 | 201 | 202 | 203 | 204 | 212 |
213 | 255 | 256 | 257 | 258 | -------------------------------------------------------------------------------- /docs/io/flic/lib/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | io.flic.lib 7 | 8 | 9 | 10 | 11 |

io.flic.lib

12 |
13 |

Interfaces

14 | 17 |

Classes

18 | 27 |

Exceptions

28 | 32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/io/flic/lib/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | io.flic.lib 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
64 |

Package io.flic.lib

65 |
66 |
67 | 164 |
165 | 166 |
167 | 168 | 169 | 170 | 171 | 179 |
180 | 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /docs/io/flic/lib/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | io.flic.lib Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
64 |

Hierarchy For Package io.flic.lib

65 |
66 |
67 |

Class Hierarchy

68 | 99 |

Interface Hierarchy

100 | 103 |
104 | 105 |
106 | 107 | 108 | 109 | 110 | 118 |
119 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /docs/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
64 |

Hierarchy For All Packages

65 | Package Hierarchies: 66 | 69 |
70 |
71 |

Class Hierarchy

72 | 103 |

Interface Hierarchy

104 | 107 |
108 | 109 |
110 | 111 | 112 | 113 | 114 | 122 |
123 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /docs/package-list: -------------------------------------------------------------------------------- 1 | io.flic.lib 2 | -------------------------------------------------------------------------------- /docs/resources/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjshay/fliclib-android/ddfbfebfd5090bb2cc80a7e66c613134ffc4071a/docs/resources/background.gif -------------------------------------------------------------------------------- /docs/resources/tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjshay/fliclib-android/ddfbfebfd5090bb2cc80a7e66c613134ffc4071a/docs/resources/tab.gif -------------------------------------------------------------------------------- /docs/resources/titlebar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjshay/fliclib-android/ddfbfebfd5090bb2cc80a7e66c613134ffc4071a/docs/resources/titlebar.gif -------------------------------------------------------------------------------- /docs/resources/titlebar_end.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjshay/fliclib-android/ddfbfebfd5090bb2cc80a7e66c613134ffc4071a/docs/resources/titlebar_end.gif -------------------------------------------------------------------------------- /docs/serialized-form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Serialized Form 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 34 |
35 | 62 | 63 |
64 |

Serialized Form

65 |
66 |
67 | 84 |
85 | 86 |
87 | 88 | 89 | 90 | 91 | 99 |
100 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /fliclib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /fliclib/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "21.1.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 19 9 | targetSdkVersion 22 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | compile 'com.android.support:appcompat-v7:22.1.1' 24 | } 25 | -------------------------------------------------------------------------------- /fliclib/fliclib.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /fliclib/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Emil\android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /fliclib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /fliclib/src/main/aidl/io/flic/lib/IFlicLibCallbackInterface.aidl: -------------------------------------------------------------------------------- 1 | // Internal class used for communication with the Flic Application 2 | 3 | package io.flic.lib; 4 | 5 | interface IFlicLibCallbackInterface { 6 | void onConnect(String mac); 7 | void onReady(String mac); 8 | void onDisconnect(String mac, int flicError); 9 | void onConnectionFailed(String mac, int status); 10 | 11 | void onReadRemoteRSSI(String mac, int rssi, int status); 12 | void onButtonUpOrDown(String mac, boolean wasQueued, int timeDiff, int action); 13 | void onButtonClickOrHold(String mac, boolean wasQueued, int timeDiff, int action); 14 | void onButtonSingleOrDoubleClick(String mac, boolean wasQueued, int timeDiff, int action); 15 | void onButtonSingleOrDoubleClickOrHold(String mac, boolean wasQueued, int timeDiff, int action); 16 | 17 | void onButtonRemoved(String mac); 18 | } 19 | -------------------------------------------------------------------------------- /fliclib/src/main/aidl/io/flic/lib/IFlicLibInterface.aidl: -------------------------------------------------------------------------------- 1 | // Internal class used for communication with the Flic Application 2 | 3 | package io.flic.lib; 4 | 5 | import io.flic.lib.IFlicLibCallbackInterface; 6 | 7 | interface IFlicLibInterface { 8 | long registerCallback(IFlicLibCallbackInterface cb, String appId, String appSecret, String appName); 9 | void unregisterCallback(long id); 10 | 11 | void listenForConnectionCallbacks(long id, String mac); 12 | void unListenForConnectionCallbacks(long id, String mac); 13 | void setButtonCallbacks(long id, String mac, int flags); 14 | int getConnectionStatus(long id, String mac); 15 | String getColor(long id, String mac); 16 | boolean readRemoteRSSI(long id, String mac); 17 | void setActiveMode(long id, String mac, boolean activeMode); 18 | void grabExclusivity(long id, String mac); 19 | void releaseExclusivity(long id, String mac); 20 | 21 | boolean validateIntent(long id, in Bundle bundle); 22 | List listButtons(long id); 23 | void removeButton(long id, String mac); 24 | void registerListenForBroadcast(long id, String mac, int flags); 25 | 26 | String getName(long id, String mac); 27 | } 28 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/AppCredentialsNotProvidedException.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | /** 4 | * Exception thrown when app credentials were not provided. 5 | */ 6 | public class AppCredentialsNotProvidedException extends RuntimeException { 7 | AppCredentialsNotProvidedException(String s) { 8 | super(s); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/DB.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | import android.content.ContentValues; 4 | import android.content.Context; 5 | import android.database.Cursor; 6 | import android.database.sqlite.SQLiteDatabase; 7 | import android.database.sqlite.SQLiteOpenHelper; 8 | 9 | import java.util.ArrayList; 10 | import java.util.HashMap; 11 | 12 | /** 13 | * Created by Emil on 2015-09-06. 14 | */ 15 | class DB extends SQLiteOpenHelper { 16 | private static final String TAG = "DB"; 17 | private static final int DATABASE_VERSION = 1; 18 | 19 | private static final String DATABASE_NAME = "fliclib"; 20 | private static final String BUTTONS_TABLE_NAME = "buttons"; 21 | private static final String BUTTONS_TABLE_CREATE = 22 | "CREATE TABLE " + BUTTONS_TABLE_NAME + " (mac TEXT UNIQUE);"; 23 | 24 | public DB(Context context) { 25 | super(context, DATABASE_NAME, null, DATABASE_VERSION); 26 | } 27 | 28 | @Override 29 | public void onCreate(SQLiteDatabase db) { 30 | db.execSQL(BUTTONS_TABLE_CREATE); 31 | } 32 | 33 | @Override 34 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 35 | 36 | } 37 | 38 | public synchronized ArrayList getButtons() { 39 | SQLiteDatabase db = this.getWritableDatabase(); 40 | ArrayList list = new ArrayList<>(); 41 | Cursor query = db.query(BUTTONS_TABLE_NAME, null, null, null, null, null, null); 42 | query.moveToFirst(); 43 | if (!query.isAfterLast()) { 44 | do { 45 | String mac = query.getString(query.getColumnIndex("mac")); 46 | list.add(mac); 47 | } while(query.moveToNext()); 48 | } 49 | query.close(); 50 | db.close(); 51 | 52 | return list; 53 | } 54 | 55 | public synchronized void addButton(String mac) { 56 | SQLiteDatabase db = this.getWritableDatabase(); 57 | ContentValues values = new ContentValues(); 58 | values.put("mac", mac); 59 | db.insertWithOnConflict(BUTTONS_TABLE_NAME, null, values, SQLiteDatabase.CONFLICT_IGNORE); 60 | db.close(); 61 | } 62 | 63 | public synchronized void removeButton(String mac) { 64 | SQLiteDatabase db = this.getWritableDatabase(); 65 | db.delete(BUTTONS_TABLE_NAME, "mac = ?", new String[] { mac }); 66 | db.close(); 67 | } 68 | } -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicAppNotInstalledException.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | /** 4 | * Exception thrown when the Flic App was not installed 5 | */ 6 | public class FlicAppNotInstalledException extends RuntimeException { 7 | FlicAppNotInstalledException(String s) { 8 | super(s); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.util.Log; 7 | 8 | /** 9 | * Broadcast receiver for events from the Flic App. 10 | * Extend this class and implement the methods you want to get events for. 11 | * To activate events, call {@link FlicButton#registerListenForBroadcast(int)}. 12 | * See also {@link FlicBroadcastReceiverFlags}. 13 | */ 14 | public abstract class FlicBroadcastReceiver extends BroadcastReceiver { 15 | private static final String TAG = "FlicBroadcastReceiver"; 16 | 17 | public final void onReceive(final Context context, final Intent intent) { 18 | if (!FlicManager.hasSetAppCredentials()) { 19 | onRequestAppCredentials(context); 20 | } 21 | FlicManager.getInstance(context, new FlicManagerInitializedCallback() { 22 | @Override 23 | public void onInitialized(FlicManager manager) { 24 | if (!manager.validateIntent(intent)) { 25 | Log.d(TAG, "Invalid intent received"); 26 | return; 27 | } 28 | 29 | String deviceId = intent.getStringExtra(FlicIntentExtras.BUTTON_ID); 30 | FlicButton button = manager.getButtonByDeviceId(deviceId); 31 | if (button == null) { // For removed 32 | button = new FlicButton(manager, deviceId); 33 | } 34 | 35 | String value = intent.getStringExtra(FlicIntentExtras.VALUE); 36 | 37 | switch (intent.getStringExtra(FlicIntentExtras.TYPE)) { 38 | case FlicIntentTypes.UP_OR_DOWN: 39 | onButtonUpOrDown(context, button, intent.getBooleanExtra(FlicIntentExtras.WAS_QUEUED, false), intent.getIntExtra(FlicIntentExtras.TIME_DIFF, 0), value.equals(FlicIntentValues.UP), value.equals(FlicIntentValues.DOWN)); 40 | break; 41 | case FlicIntentTypes.CLICK_OR_HOLD: 42 | onButtonClickOrHold(context, button, intent.getBooleanExtra(FlicIntentExtras.WAS_QUEUED, false), intent.getIntExtra(FlicIntentExtras.TIME_DIFF, 0), value.equals(FlicIntentValues.CLICK), value.equals(FlicIntentValues.HOLD)); 43 | break; 44 | case FlicIntentTypes.SINGLE_OR_DOUBLE_CLICK: 45 | onButtonSingleOrDoubleClick(context, button, intent.getBooleanExtra(FlicIntentExtras.WAS_QUEUED, false), intent.getIntExtra(FlicIntentExtras.TIME_DIFF, 0), value.equals(FlicIntentValues.SINGLE_CLICK), value.equals(FlicIntentValues.DOUBLE_CLICK)); 46 | break; 47 | case FlicIntentTypes.SINGLE_OR_DOUBLE_CLICK_OR_HOLD: 48 | onButtonSingleOrDoubleClickOrHold(context, button, intent.getBooleanExtra(FlicIntentExtras.WAS_QUEUED, false), intent.getIntExtra(FlicIntentExtras.TIME_DIFF, 0), value.equals(FlicIntentValues.SINGLE_CLICK), value.equals(FlicIntentValues.DOUBLE_CLICK), value.equals(FlicIntentValues.HOLD)); 49 | break; 50 | case FlicIntentTypes.REMOVED: 51 | onButtonRemoved(context, button); 52 | button.forgotten = true; 53 | break; 54 | } 55 | } 56 | }); 57 | } 58 | 59 | /** 60 | * Sets app credentials. 61 | * 62 | * In this method, call {@link FlicManager#setAppCredentials(String, String, String)} and set the appropriate app credentials. 63 | * 64 | * @param context The Context in which the receiver is running 65 | */ 66 | protected abstract void onRequestAppCredentials(Context context); 67 | 68 | /** 69 | * Called when the button was pressed or released. 70 | * 71 | * @param context The Context in which the receiver is running 72 | * @param button The button 73 | * @param wasQueued If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true. 74 | * @param timeDiff If the event was queued, the timeDiff will be the number of seconds since the event happened. 75 | * @param isUp True if up, else false 76 | * @param isDown True if down, else false 77 | */ 78 | public void onButtonUpOrDown(Context context, FlicButton button, boolean wasQueued, int timeDiff, boolean isUp, boolean isDown) {} 79 | 80 | /** 81 | * Used for the scenario where you want to listen on button click and hold. 82 | * 83 | * @param context The Context in which the receiver is running 84 | * @param button The button 85 | * @param wasQueued If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true. 86 | * @param timeDiff If the event was queued, the timeDiff will be the number of seconds since the event happened. 87 | * @param isClick True if click, else false 88 | * @param isHold True if hold, else false 89 | */ 90 | public void onButtonClickOrHold(Context context, FlicButton button, boolean wasQueued, int timeDiff, boolean isClick, boolean isHold) {} 91 | 92 | /** 93 | * Used for the scenario where you want to listen on single click and double click. 94 | * Single clicks might be delayed for up to 0.5 seconds because we can't be sure if it was rather a double click or not until then. 95 | * 96 | * @param context The Context in which the receiver is running 97 | * @param button The button 98 | * @param wasQueued If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true. 99 | * @param timeDiff If the event was queued, the timeDiff will be the number of seconds since the event happened. 100 | * @param isSingleClick True if single click, else false 101 | * @param isDoubleClick True if double click, else false 102 | */ 103 | public void onButtonSingleOrDoubleClick(Context context, FlicButton button, boolean wasQueued, int timeDiff, boolean isSingleClick, boolean isDoubleClick) {} 104 | 105 | /** 106 | * Used for the scenario where you want to listen on single click, double click and hold. 107 | * Single clicks might be delayed for up to 0.5 seconds because we can't be sure if it was rather a double click or not until then. 108 | * 109 | * @param context The Context in which the receiver is running 110 | * @param button The button 111 | * @param wasQueued If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true. 112 | * @param timeDiff If the event was queued, the timeDiff will be the number of seconds since the event happened. 113 | * @param isSingleClick True if single click, else false 114 | * @param isDoubleClick True if double click, else false 115 | * @param isHold True if hold, else false 116 | */ 117 | public void onButtonSingleOrDoubleClickOrHold(Context context, FlicButton button, boolean wasQueued, int timeDiff, boolean isSingleClick, boolean isDoubleClick, boolean isHold) {} 118 | 119 | /** 120 | * Called when the button was removed in the Flic App, or when the user disconnected this app from the button in the Flic App (if so the button can be grabbed again as usual). 121 | * This object cannot be used any more once this method has returned. 122 | * 123 | * @param context The Context in which the receiver is running. 124 | * @param button The button 125 | */ 126 | public void onButtonRemoved(Context context, FlicButton button) {} 127 | } 128 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicBroadcastReceiverFlags.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | /** 4 | * Used in {@link FlicButton#registerListenForBroadcast(int)} to tell which events you want to listen for. 5 | * If you are concerned about low latencies and performance, only register the flags you actually use. 6 | * These can be bitwise-or'ed together. 7 | */ 8 | public class FlicBroadcastReceiverFlags { 9 | public static final int NONE = 0; 10 | public static final int UP_OR_DOWN = 1; 11 | public static final int CLICK_OR_HOLD = 2; 12 | public static final int CLICK_OR_DOUBLE_CLICK = 4; 13 | public static final int CLICK_OR_DOUBLE_CLICK_OR_HOLD = 8; 14 | public static final int REMOVED = 16; 15 | public static final int ALL = 31; 16 | } 17 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicButtonCallback.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | /** 4 | * FlicButtonCallback 5 | * 6 | * Callbacks for button updates. You should extend this class and implement the callbacks you want. 7 | */ 8 | public class FlicButtonCallback { 9 | /** 10 | * Called when the Bluetooth connection has just been started. 11 | * It's not ready for use yet however - {@link FlicButtonCallback#onConnectionCompleted(FlicButton)} will be called when ready. 12 | * 13 | * @param button The button 14 | */ 15 | public void onConnectionStarted(FlicButton button) {} 16 | 17 | /** 18 | * Called if there was a problem establishing a Bluetooth connection to the button. Happens very rarely. 19 | * 20 | * @param button The button 21 | * @param status A Bluetooth GATT status. 22 | */ 23 | public void onConnectionFailed(FlicButton button, int status) {} 24 | 25 | /** 26 | * Called when the Bluetooth connection was disconnected, for example if the button becomes out of range or the user manually disconnecting this button in the Flic Application. 27 | * 28 | * @param button The button 29 | */ 30 | public void onDisconnect(FlicButton button) {} 31 | 32 | /** 33 | * Called when the connection to the button has been established and is ready to use. 34 | * 35 | * @param button The button 36 | */ 37 | public void onConnectionCompleted(FlicButton button) {} 38 | 39 | /** 40 | * Called as a result of {@link FlicButton#readRemoteRSSI()}. 41 | * 42 | * @param button The button 43 | * @param rssi RSSI value for the remote device 44 | * @param status 0 if the RSSI was read successfully 45 | */ 46 | public void onReadRemoteRSSI(FlicButton button, int rssi, int status) {} 47 | 48 | /** 49 | * Called when the button was pressed or released. 50 | * 51 | * @param button The button 52 | * @param wasQueued If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true. 53 | * @param timeDiff If the event was queued, the timeDiff will be the number of seconds since the event happened. 54 | * @param isUp True if up, else false 55 | * @param isDown True if down, else false 56 | */ 57 | public void onButtonUpOrDown(FlicButton button, boolean wasQueued, int timeDiff, boolean isUp, boolean isDown) {} 58 | 59 | /** 60 | * Used for the scenario where you want to listen on button click and hold. 61 | * 62 | * @param button The button 63 | * @param wasQueued If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true. 64 | * @param timeDiff If the event was queued, the timeDiff will be the number of seconds since the event happened. 65 | * @param isClick True if click, else false 66 | * @param isHold True if hold, else false 67 | */ 68 | public void onButtonClickOrHold(FlicButton button, boolean wasQueued, int timeDiff, boolean isClick, boolean isHold) {} 69 | 70 | /** 71 | * Used for the scenario where you want to listen on single click and double click. 72 | * Single clicks might be delayed for up to 0.5 seconds because we can't be sure if it was rather a double click or not until then. 73 | * 74 | * @param button The button 75 | * @param wasQueued If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true. 76 | * @param timeDiff If the event was queued, the timeDiff will be the number of seconds since the event happened. 77 | * @param isSingleClick True if single click, else false 78 | * @param isDoubleClick True if double click, else false 79 | */ 80 | public void onButtonSingleOrDoubleClick(FlicButton button, boolean wasQueued, int timeDiff, boolean isSingleClick, boolean isDoubleClick) {} 81 | 82 | /** 83 | * Used for the scenario where you want to listen on single click, double click and hold. 84 | * Single clicks might be delayed for up to 0.5 seconds because we can't be sure if it was rather a double click or not until then. 85 | * 86 | * @param button The button 87 | * @param wasQueued If the event was locally queued in the button because it was disconnected. After the connection is completed, the event will be sent with this parameter set to true. 88 | * @param timeDiff If the event was queued, the timeDiff will be the number of seconds since the event happened. 89 | * @param isSingleClick True if single click, else false 90 | * @param isDoubleClick True if double click, else false 91 | * @param isHold True if hold, else false 92 | */ 93 | public void onButtonSingleOrDoubleClickOrHold(FlicButton button, boolean wasQueued, int timeDiff, boolean isSingleClick, boolean isDoubleClick, boolean isHold) {} 94 | 95 | /** 96 | * Called when the button was removed in the Flic App, or when the user disconnected this app from the button in the Flic App (if so the button can be grabbed again as usual). 97 | * This object cannot be used any more once this method has returned. 98 | * 99 | * @param button The button 100 | */ 101 | public void onButtonRemoved(FlicButton button) {} 102 | } 103 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicButtonCallbackFlags.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | /** 4 | * Used in {@link FlicButton#setFlicButtonCallbackFlags(int)} to tell which events you want to listen for. 5 | * If you are concerned about low latencies and performance, only register the flags you actually use. 6 | * These can be bitwise-or'ed together. 7 | */ 8 | public class FlicButtonCallbackFlags { 9 | public static final int NONE = 0; 10 | public static final int UP_OR_DOWN = 1; 11 | public static final int CLICK_OR_HOLD = 2; 12 | public static final int CLICK_OR_DOUBLE_CLICK = 4; 13 | public static final int CLICK_OR_DOUBLE_CLICK_OR_HOLD = 8; 14 | public static final int ALL = 15; 15 | } 16 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicIntentExtras.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | /** 4 | * Intent extras of flic event intents. 5 | */ 6 | class FlicIntentExtras { 7 | /** 8 | * Contains the button identifier (Bluetooth Address). 9 | */ 10 | public static final String BUTTON_ID = "buttonId"; 11 | 12 | /** 13 | * Contains the type of this event. 14 | * See {@link FlicIntentTypes} for possible values. 15 | */ 16 | public static final String TYPE = "type"; 17 | 18 | /** 19 | * Contains the value of this event, unless {@link FlicIntentExtras#TYPE} is {@link FlicIntentTypes#REMOVED}. 20 | * See {@link FlicIntentValues} for possible values. 21 | */ 22 | public static final String VALUE = "value"; 23 | 24 | /** 25 | * Contains a boolean whether the event was queued or not on the Flic button. 26 | * The event will be queued on the button if it is not connected when it is pressed. 27 | * This will not be present if {@link FlicIntentExtras#TYPE} is {@link FlicIntentTypes#REMOVED}. 28 | */ 29 | public static final String WAS_QUEUED = "wasQueued"; 30 | 31 | /** 32 | * If the event was queued (see {@link FlicIntentExtras#WAS_QUEUED}, contains the number of seconds since the event happened. 33 | * This will not be present if {@link FlicIntentExtras#TYPE} is {@link FlicIntentTypes#REMOVED}. 34 | */ 35 | public static final String TIME_DIFF = "timeDiff"; 36 | } 37 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicIntentTypes.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | /** 4 | * Represents possible values for the intent extra {@link FlicIntentExtras#TYPE}. 5 | */ 6 | class FlicIntentTypes { 7 | /** 8 | * Indicates that the button was pressed or released. 9 | * See {@link FlicIntentValues#UP} and {@link FlicIntentValues#DOWN}. 10 | */ 11 | public static final String UP_OR_DOWN = "UP_OR_DOWN"; 12 | 13 | /** 14 | * Indicates that the button was clicked or held. 15 | * See {@link FlicIntentValues#CLICK} and {@link FlicIntentValues#HOLD}. 16 | */ 17 | public static final String CLICK_OR_HOLD = "CLICK_OR_HOLD"; 18 | 19 | /** 20 | * Indicates that the button was single- or double clicked. 21 | * See {@link FlicIntentValues#SINGLE_CLICK} and {@link FlicIntentValues#DOUBLE_CLICK}. 22 | */ 23 | public static final String SINGLE_OR_DOUBLE_CLICK = "SINGLE_OR_DOUBLE_CLICK"; 24 | 25 | /** 26 | * Indicates that the button was single- or double clicked or held. 27 | * See {@link FlicIntentValues#SINGLE_CLICK}, {@link FlicIntentValues#DOUBLE_CLICK} and {@link FlicIntentValues#HOLD}. 28 | */ 29 | public static final String SINGLE_OR_DOUBLE_CLICK_OR_HOLD = "SINGLE_OR_DOUBLE_CLICK_OR_HOLD"; 30 | 31 | /** 32 | * Indicates that this app for this button was released by the user in the Flic app. 33 | * 34 | * This broadcast receiver will no longer receive intents for this button, until {@link FlicButton#registerListenForBroadcast(int)} is called again. 35 | */ 36 | public static final String REMOVED = "REMOVED"; 37 | } 38 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicIntentValues.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | /** 4 | * Represents possible values of {@link FlicIntentExtras#VALUE}. 5 | */ 6 | class FlicIntentValues { 7 | /** 8 | * Indicates that the button was released. 9 | * Possible value for {@link FlicIntentExtras#VALUE} when {@link FlicIntentExtras#TYPE} is {@link FlicIntentTypes#UP_OR_DOWN}. 10 | */ 11 | public static final String UP = "UP"; 12 | 13 | /** 14 | * Indicates that the button was pressed. 15 | * Possible value for {@link FlicIntentExtras#VALUE} when {@link FlicIntentExtras#TYPE} is {@link FlicIntentTypes#UP_OR_DOWN}. 16 | */ 17 | public static final String DOWN = "DOWN"; 18 | 19 | /** 20 | * Indicates that the button was clicked. 21 | * Possible value for {@link FlicIntentExtras#VALUE} when {@link FlicIntentExtras#TYPE} is {@link FlicIntentTypes#CLICK_OR_HOLD}. 22 | */ 23 | public static final String CLICK = "CLICK"; 24 | 25 | /** 26 | * Indicates that the button was hold for half a second. 27 | * Possible value for {@link FlicIntentExtras#VALUE} when {@link FlicIntentExtras#TYPE} is {@link FlicIntentTypes#CLICK_OR_HOLD} or {@link FlicIntentTypes#SINGLE_OR_DOUBLE_CLICK_OR_HOLD}. 28 | */ 29 | public static final String HOLD = "HOLD"; 30 | 31 | /** 32 | * Indicates that the button was single clicked. 33 | * Possible value for {@link FlicIntentExtras#VALUE} when {@link FlicIntentExtras#TYPE} is {@link FlicIntentTypes#SINGLE_OR_DOUBLE_CLICK} or {@link FlicIntentTypes#SINGLE_OR_DOUBLE_CLICK_OR_HOLD}. 34 | */ 35 | public static final String SINGLE_CLICK = "SINGLE_CLICK"; 36 | 37 | /** 38 | * Indicates that the button was double clicked. 39 | * Possible value for {@link FlicIntentExtras#VALUE} when {@link FlicIntentExtras#TYPE} is {@link FlicIntentTypes#SINGLE_OR_DOUBLE_CLICK} or {@link FlicIntentTypes#SINGLE_OR_DOUBLE_CLICK_OR_HOLD}. 40 | */ 41 | public static final String DOUBLE_CLICK = "DOUBLE_CLICK"; 42 | } 43 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicManagerInitializedCallback.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * FlicManagerInitializedCallback. 7 | */ 8 | public interface FlicManagerInitializedCallback { 9 | /** 10 | * Called once when the manager has been initialized. 11 | * This is called on the UI thread shortly after {@link FlicManager#getInstance(Context, FlicManagerInitializedCallback)} 12 | * or {@link FlicManager#getInstance(Context, FlicManagerInitializedCallback, FlicManagerUninitializedCallback)} was called. 13 | * 14 | * @param manager The manager 15 | */ 16 | void onInitialized(FlicManager manager); 17 | } 18 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/FlicManagerUninitializedCallback.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | /** 4 | * FlicManagerUninitializedCallback 5 | */ 6 | public class FlicManagerUninitializedCallback { 7 | /** 8 | * Called when the manager was uninitialized. 9 | * 10 | * @param manager The manager 11 | */ 12 | public void onUninitialized(FlicManager manager) { 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /fliclib/src/main/java/io/flic/lib/Utils.java: -------------------------------------------------------------------------------- 1 | package io.flic.lib; 2 | 3 | import java.security.MessageDigest; 4 | import java.security.NoSuchAlgorithmException; 5 | 6 | /** 7 | * Created by Emil on 2015-09-06. 8 | */ 9 | class Utils { 10 | public static byte[] hexToBytes(String s) { 11 | int len = s.length(); 12 | byte[] data = new byte[len / 2]; 13 | for (int i = 0; i < len; i += 2) { 14 | data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) 15 | + Character.digit(s.charAt(i + 1), 16)); 16 | } 17 | return data; 18 | } 19 | 20 | public static MessageDigest createSHA256() { 21 | MessageDigest md = null; 22 | try { 23 | md = MessageDigest.getInstance("SHA-256"); 24 | } catch (NoSuchAlgorithmException e) { 25 | e.printStackTrace(); 26 | } 27 | return md; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjshay/fliclib-android/ddfbfebfd5090bb2cc80a7e66c613134ffc4071a/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Sep 10 12:42:56 CEST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':fliclib' 2 | --------------------------------------------------------------------------------