Use Android phone camera to perform an action? - android

I would like to know if it is possible to register a movement close to the camera, and then perform some actions inside an app.
This was possible on Symbian, so it should be also on newer Android-powered phones. The problem is I can't find any resource to get started with.
Does anybody have any ideas on where I should start?

Looks like there's a library created over on Google Code: http://code.google.com/p/android-motion-detection/
If you want something a little more powerful, you can also run OpenCV on Android: http://opencv.org/android Don't think you will be able to do anything detecting the distance without another camera or a different type of sensor (like sonar) though.
As a bonus, depending on what your are trying to achieve, there's even a nice API doesn't involve anything additional to the Android SDK: http://developer.android.com/reference/android/media/FaceDetector.Face.html

Related

Convert Audio Output in Audio Input using Flutter

I am starting to learn mobile programming through a Flutter course, and I had the idea of an app to fulfill a need of mine. However, I'm not sure if Flutter has a library capable of that; I searched a lot and could not find it.
Below is a drawing of what I intend to do.
Diagram
Can anyone tell me if it is possible to do this with flutter or even pure development for android (then I'll start to learn this)? If you know the library, could you inform me? The apps in question are not relevant to this question, but they would be two very specific apps. The goal is for the app to work when activated and stop when deactivated, without the need for headsets.
I just wish someone with more experience could point me in the right direction.

How to create an Auto Clicker app which can click on other apps?

I have seen so many apps that provide auto tapping feature. But they don't provide some specific customization so I decided to create a one. I have seen many tutorials that offers auto tapping, but they are supposed to be used in the same app. But I want to create an auto tapping app that can click on other app's View. I am an intermediate java developer but new to Android studio, so I don't know much about Android APIs. Is there any class or package which can provide this feature. For more clearance, I want to do auto tap, when the color at the specific location on screen, (213, 120) for instance, becomes green.
Thanks in advance!
I am not an expert on the subject, I have experience as a BackEnd developer, I am new to the Android world, just like you I am interested in building an app to automate some farming mechanics in Android games with specific behaviors, so I investigated on the subject and the solution you are looking for is the AccessibilityService API, from Android 8.0 (API level 26) it includes several functionalities to make touches without the need for Root, I leave you links with examples of some open source repos that can guide you.
https://developer.android.com/guide/topics/ui/accessibility/service#continued-gestures (Doc)
https://github.com/nestorm001/AutoClicker (Old and abandoned project, but has the functionality of touches)
https://github.com/pylapp/SmoothClicker (A more mature App but need root, it can be helpful to guide you in how to build the UI)
For the detection in the change of the pixel I still do not have a concrete answer, I keep looking, maybe obtaining a dump of the screen every X time and validate the pixels on that is the way but it is still uncertain if it is the way to go.
Something like How to record screen and take screenshots, using Android API?.
I know that you can get a bitmap dump of the screen if you have the activity, but it's not the case, however some class in the following package may be helpful https://developer.android.com/reference/kotlin/android/graphics/package-summary.
I'm currently working in my own implementation, when I have something to show I will gladly share it.

How to built a Android Single App Mode

I want to use a Android Phone as a controlling unit for one of my projects.
In this the Smartphone is fixed on the hardware.
Tasks for the smartphone are:
Communication via Bluetooth
Handling User Input (e.g. PIN-Entry)
Turning on/off vibration, led ,...
So I wrote a App which does all the things I want.
Now I want that the Smartphone can only be used for this application.
Maybe you can give me some Ideas how to manage this.
I heard about 'kiosk-mode', could this be a solution.
Another option would be a custom ROM or is it possible to get a 'basic-android' without a launcher an just one single app.
I just want some ideas and usefull suggestions from you:)
If you are using Android version "L" there is a way to do that. It is called Task Locking, however it needs root access.
There is a lot of tutorials on this site. I just don't want to copy-paste it.
Take a look here: http://www.sureshjoshi.com/mobile/android-kiosk-mode-without-root/
Pretty good article about task locking and device ownership. And unlike Evgeniy said, root is not needed.

Creating custom hardware Sensors in Android

I'm looking into creating custom sensors in Android and was wondering if anybody has attempted this. I was hoping there might be a way of creating custom sensors other than by using Android Open Accessory Development Kit.
For example, I manufacture a bespoke piece of hardware which has two water level readers built in. Is there any way of of exposing these to the Android OS via the SensorManager? Has anyone attempted this before? Essentially is there a way of adding custom Sensor items to the SensorManager.
Thanks a lot
I would say that it's not possible to modify the set of sensors provided by the sensor manager - it's a system service with a hard coded set of sensor types.
It would probably be best if you provided an Android service instead which provided these sensor readings which would then be available to any app which needed them.
This service would probably wrap the accessory devkit api to actually communicate with your device.
The service base class you would derive from would be this, which includes examples:
I have no experience on this, but I did some reading on similar topics recently.
I assume you already know about Arduino. I can give a link to a project where the author gets information from some external sensors and the control is done from an Android device. I consider that this project is similar to what you want to do.

Continuous Speechrecognition in Android

I googled around and found the regular speech-api from google. But I think this isn't what I need. I need continious voice recognition and the ability to launch other actions when a specific word is spoken. Is there anything in the android sdk that I can use?
If not: Is it possible to implement third-party libraries? (If yes: which - and what do I have to think about when implement a third-party-library?)
Edit: I thought about this again. I have to recognize just one 'word' (that probably won't be in googles-speech-databases). I have the chance to record it. That means, I'm able to continiously match the incoming audio-stream against my recording. That should work without a database. But I'm new to android-development. Do you have suggestions for APIs to use for recording and matching the recorded? Or is there any better way to continiously wait for a specifig 'word' to occur and then process any further actions?
btw: if that wasn't clear described: the app should continue to record and watch for the word to occure again when the reaction is done.
Is there anything in the android sdk that I can use?
No, sorry.

Categories

Resources