I a’m trying to make a android flash light apps.
In this apps have flash light on off switch, but i am trying to make it professional for this reason i added an extra features Shake Service . That’s means when user will click shake service button then Gravity/Accelerometer Sensor will be enable (I don’t know what sensor should i use for this service), then when user will shake her device then Flash light will be on (So far I have completed) and again if user shake her device then flash light will be off. main fact is I can not do this last option.
for your better understanding please see the below block, Kindly share with me a better suggestion how can i complete it.
When Accelerometer1.Shaking
if global flashlight_status
call (turn off)
set global flashlight_status to false
else
call (turn on)
set global flashlight_status to true
This material is unlicensed as of now, and open-source. This can be used with acknowledgement to me and a link to my website kanishkadeveloper.wordpress.com in the app, easily viewable by users.
Something went wrong with this demo.apk
when i’m shaking my device then flash light doing on off, on off, automatically.
For your better understanding please you can check it your own device.
Everything is okay, but if is it possible to do, when user will use shake service if user minimize this apps then keep running apps in notification bar with a message as like your apps is running.