This extension provides access to the environmental sensors on many devices. They are:
- Ambient Temperature (in Celcius);
- Relative Humidity (As a percentage);
- Barometric Pressure (as
This will be embedded into HackProtect because you can use these sensors to determine if someone is using an emulator or has patched your app. The reason everything is turned off by default is because sensors can kill batteries. You will have to experiment about how you want to use them.
Blocks . (There are a lot of them)
First from the Designer screen you can turn the individual sensors on at runtime.
Are the sensors available blocks, i.e. does your device even have the sensor.
Check the status of the sensor, enabled or not blocks:
Turn the sensors on or off in the program blocks:
Event Functions so you can watch if one of the sensors changes its value:
Specific Pressure Blocks and Explanation.
You can calculate Altitude (in meters) based on a linear relationship between pressure at sealevel and actual barometric pressure. This extension does that math for you. I provide a way to enter in your own sea-level pressure. The default I have set is 1013.247. (hPa also known as millibar). You can get the current pressure from your local weather, or airport sites. This pressure will change with temperature and weather. This is why planes have to adjust their altimeter when they are taking off or landing. The weather changes how the altitude is calculated.
This calculation is far more accurate than GPS.
The three other sensors.
Celcius, Lux, and %
Two List Functions.
Here we provide a list of all sensors available on the device, and a list of just the environmental ones that are available. The values are returned as a string.
How to use:
To use it, turn the sensor on, and catch the value. If you want to continue to watch the value, use the Event blocks.
You can use these sensors readings in any way you wish. I built this for you to cross reference altitude and location to see if they are close. Example if the location is returned as Bogota Colombia, but the altitude is only 450 meters, we know there is a problem. This could be a a fake location, etc.
The sensors also return strange things that can hint there is an emulator at play. Example is you can provide an instruction to have the user turn their device over on a table for 2 seconds, and check to make sure the light dropped. If not, you know they are on an emulator.
This will be handy for any location apps, if you want to keep track of weather conditions while you are out and about.
EnviroSenseHP.aix (16.3 KB)
AIA File: EnviroSenseApp4.aia (20.2 KB)
APK Test File: EnviroSenseApp4.apk (4.1 MB)
Experimental APEnviroSenseAppExp2.apk (4.6 MB)