Creating custom hardware Sensors in Android - 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.

Related

Adding Bluetooth Low Energy to android app with Kotlin

So, I've created an app and I want to be able to Add bluetooth devices to it (BLE or not). After I've added them, i want to display them in a different activity. I've looked for lots of tutorials(Stackoverflow and others) but couldnt find something specific.
I am a beginner and i used Kotlin to create the app.
Not exactly sure what you're looking for, but perhaps this SensorTag sample app is a simple enough example of what you're looking to accomplish?
It relies on Kotlin Coroutines to scan for nearby SensorTags, then allows you to select one, which navigates you to another Activity and connects to it, then displays sensor data.
I would like to recommend to use the rxJava for the BLE Scanning. For scanning the tags for forground and background working fine '
For view the demo on github rxAndroidBle_github_demo
on this library handled all exception.
I hope this will work for you !

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.

Is it possible to access Bluetooth with ARM assembly?

I've done some research into creating a simple app that could act as a Bluetooth input device, and discarded the project after finding that it would not currently be possible to use the human interface device profile without rooting the device.
However, is it possible that there is a workaround for this in direct assembly code? This may be a stupid question, and I understand that there may not be any relevant documentation even if it is possible.
But as I understand it, one should be able to access and modify RAM data directly with assembly. If you knew what to change, could you edit the signal to use a different profile?

Use Android phone camera to perform an action?

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

Is it possible to modify WiFi frames (layer 2 PDUs) to include new fields?

I want to develop an app that makes use of the WiFi interface to establish cooperation amongst a subset of mobile devices, which will then allow me to exploit location information and achieve higher energy efficiency (cluster based communications).
For security reasons, I must append a digital signature (or a keyed hash) at the end of specific WiFi frames (e.g. when ARP protocol runs).
Is it possible to achieve this in Android OS?
Will I be able to update the WiFi protocol stack in Android?
Will it be feasible?
Any literature suggestions?
I'd be grateful for any directions.
Is it possible to achieve this in Android OS?
I think you would need some kind of raw sockets. For that you can look to Raw Sockets on Android
Will I be able to update the WiFi protocol stack in Android?
Android is open source so you can try to modify it and load another Android firmware to your phone. For example, you have custom firmware versiones like the one you find at http://www.cyanogenmod.com/
Will it be feasible?
In my opinion it is possible but very difficult. Probably you can find a more feasible solution for your problem.
Any literature suggestions?
You can read this threat about how to download and edit Android source code: http://groups.google.com/group/android-kernel/browse_thread/thread/6e428031c5e70417/8d99386a62f7d75e?pli=1
Good luck.

Categories

Resources