Torch is a simple-use library for Android hepls you to have an access on the flash light.

Related tags

App Torch
Overview

Torch

Torch is a simple-use library for Android hepls you to have an access on the flash light.

Gradle

Step 1. Add the JitPack repository to your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
      maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the library dependency to your project build.gradle:

dependencies {
  implementation 'com.github.AhmedAbdEllatiif:Torch:(lastest release version)'
}

Usage

Sample code (Java):

  TorchProvider.Builder builder = new TorchProvider.Builder(this);
        builder.repeat(true)
            .repeatTimes(10)
            .intervalTime(100)
            .waitFor(5000)
            .infinite(true)
            .showToastException(true)
            .setTorchOnCallBack(new TorchProvider.Builder.OnTorchChanged() {
                    @Override
                    public void onTorchModeUnavailable(@NotNull String s) {
                         Log.d(TAG, "onTorchModeUnavailable: ")
                    }

                    @Override
                    public void onTorchModeChanged(@NotNull String s, boolean b) {
                      Log.d(TAG, "onTorchModeChanged: ")
                    }
                })
            .start()

Sample code (Kotlin):

   val builder = TorchProvider.Builder(this)
        builder
            .repeat(true)
            .repeatTimes(10)
            .intervalTime(100)
            .waitFor(5000)
            .infinite(true)
            .showToastException(true)
            .setTorchOnCallBack(object : TorchProvider.Builder.OnTorchChanged {
                override fun onTorchModeUnavailable(cameraId: String) {
                    Log.d(TAG, "onTorchModeUnavailable: ")
                }

                override fun onTorchModeChanged(cameraId: String, enabled: Boolean) {
                    Log.d(TAG, "onTorchModeChanged: ")
                }
            })
            .start()
Usage Description
builder.repeat(boolean) To repeat the flash (default false)
builder.repeatTimes(int) Num of repeat times (default repeats 2 times)
builder.intervalTime(Long) defines the interval time between flash ON and OFF (default 100 ms)
builder.waitFor(Long) wait for some time then the flash goes OFF
builder.infinite(boolean) open flash forever (default false)
builder.showToastException(boolean) show the exception instance of (TorchException) in a toast message (default false)
builder.setTorchOnCallBack(TorchProvider.Builder.OnTorchChanged()) call back of the flash light
builder.start() start the flash light with pervious configuration
You might also like...
Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. :zap:
Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. :zap:

Villains & Heroes Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information

Application to solve a personal problem, which was the wish to have a simple app that handles a market list with prices, quantity and total price
Application to solve a personal problem, which was the wish to have a simple app that handles a market list with prices, quantity and total price

Market List Application that handles a market list offline in device's storage system. The list can be just pasted in a big edit text field and the ap

Flym News Reader is a light Android feed reader (RSS/Atom)
Flym News Reader is a light Android feed reader (RSS/Atom)

BEWARE: Google added some restrictions to news app and I don't see how Flym (and other RSS aggregators) could comply to that. For instance, Flym canno

Flym News Reader is a light Android feed reader (RSS/Atom)
Flym News Reader is a light Android feed reader (RSS/Atom)

BEWARE: Google added some restrictions to news app and I don't see how Flym (and other RSS aggregators) could comply to that. For instance, Flym canno

A light Sina Weibo client for Android
A light Sina Weibo client for Android

BlackLight 新浪微博客户端 请注意,当前BlackLight的开发已经被冻结,直到2016年高考后重启。 The development progress has been FROZEN till June 2016. 详细介绍以及Changelog请见Play商店。 https://pl

The Free & Open Source Android Application for reading (Light) Novels
The Free & Open Source Android Application for reading (Light) Novels

Shosetsu The Free & Open Source Android Application for reading (Light) Novels! We appreciate any help in improving the app, so let us know by opening

A liteweight Android application to access your hanger!
A liteweight Android application to access your hanger!

星河避难所 这是一个星际公民 Android 客户端,可以简化部分官网操作以及信息查询。 A Star Citizen Android Application. 实现功能 官网登录相关 免代理登录/注册 多账号一键切换 光谱账号一键切换 官网信息相关 玩家个人信息显示 官网玩家查询 舰船信息查询 玩

Flym News Reader is a light Android feed reader (RSS/Atom)

BEWARE: The original developer stopped the development of the app so I'm starting to work on it to improve it and maintain it. Flym News Reader Light

MEGA Android Client - A fully-featured client to access your Cloud Storage provided by MEGA

A fully-featured client to access your Cloud Storage provided by MEGA. This document will guide you to build the application on a Linux machine with Android Studio.

Releases(1.0.0)
Owner
Ahmed
Android & Flutter Developer
Ahmed
when you use restful api and network get disconnect you have to store your data local for make your app faster and work on ofline mode

AppArchitectureOflineMode when you use restful api and network get disconnect you have to store your data local for make your app faster and work on o

Kareem-Mansy 3 Jun 20, 2021
NativeScript empowers you to access native platform APIs from JavaScript directly. Angular, Capacitor, Ionic, React, Svelte, Vue and you name it compatible.

NativeScript empowers you to access native APIs from JavaScript directly. The framework currently provides iOS and Android runtimes for rich mobile de

NativeScript 22k Dec 31, 2022
App that allows you juice lemons until you have a glass of lemonade!! 🍹

Project: Lemonade App - Starter Code Starter code for the first independent project for [Android Basics in Kotlin] Introduction This is the starter co

Shaima Alghamdi 4 Nov 28, 2022
android-delicious Delicious Android is an Android app which helps you access and save bookmarks via Delicious. It's available over at Google Play.

Delicious Android Delicious Android is an Android app which helps you access and save bookmarks via Delicious. It's available over at Google Play. Fea

Alexander Blom 137 Nov 20, 2022
An app that allows you to search for Github profiles of users and their repositories [d.light Android Engineer Test], for the Android Engineer Role

An app that allows you to search for Github profiles of users and their repositories [d.light Android Engineer Test], for the Android Engineer Role

Joel Kanyi 9 Aug 26, 2022
This is a Interview application which made by me in interview task what it do? that will give you the result from Api and also save data in the cache using RoomDb so that we can access it offline.

Clean-MVVM-App An Android application built using Clean + MVVM architecture. Components used in the app. Kotlin - As a programming language. Material

Android1500 2 Oct 29, 2022
A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library.

Expo Music Picker A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library. Supp

Bartłomiej Klocek 60 Dec 29, 2022
Simple access to Firebase Realtime Database.

FbRemoteDb Simple access to Firebase Realtime Database. Everything is inside a Bucket, there you can store your items. This is for simplifying the acc

null 1 Dec 28, 2021
NetGuard provides simple and advanced ways to block access to the internet

NetGuard NetGuard provides simple and advanced ways to block access to the internet - no root required. Applications and addresses can individually be

Marcel Bokhorst 598 Dec 31, 2022
A Jetpack Compose-based app to exhibit all the beautiful GLSL Fragment shaders I have ever written, where you can set them as Live Wallpaper.

?? Shader Showcase Shader Showcase is a minimal Android app made with Jetpack Compose, to showcase all the beautiful OpenGL* based Fragment shaders I

Piyush Pradeepkumar 198 Dec 28, 2022