Skip to content

Commit 35475cd

Browse files
author
Lucem Anb
authored
Create README.md
1 parent 09f4eaa commit 35475cd

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# AndroidFlashLight
2+
This Project is built on the latest SDK and is meant to build a flash light example in android
3+
4+
Download the app Here:
5+
6+
7+
#### Implementation
8+
9+
Step 1. Add the JitPack repository to your build file
10+
Add it in your root build.gradle at the end of repositories:
11+
```
12+
allprojects {
13+
repositories {
14+
...
15+
maven { url 'https://jitpack.io' }
16+
}
17+
}
18+
```
19+
Step 2. Add the dependency
20+
```
21+
dependencies {
22+
implementation 'com.github.Lucem-Anb:AndroidFlashLight:1.0.0'
23+
}
24+
```
25+
That's it!
26+
27+
### Usage
28+
##### Permissions
29+
```
30+
<uses-permission android:name="android.permission.CAMERA" />
31+
<uses-feature android:name="android.hardware.camera" />
32+
```
33+
##### Initialize
34+
```
35+
mTorch = new Torch(this);
36+
```
37+
38+
Check for permissions
39+
```
40+
if (!mTorch.isPermissionGranted()){
41+
mTorch.requestPermission(this);
42+
return;
43+
}
44+
```
45+
46+
Toggle the torch on or off
47+
```
48+
mTorch.turnOn();
49+
mTorch.turnOff();
50+
```
51+

0 commit comments

Comments
 (0)