Giter VIP home page Giter VIP logo

android-sensorium's People

Contributors

aaaaalbert avatar afmachado avatar fmetzger avatar yyzhuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-sensorium's Issues

Proprietary library

Google Play Services (GMS) is proprietary, hence not compatible with GNU LGPL. (The jar inside the Android library referred to in the project.properties).

F-Droid.org publishes the ....o3gm package, but we cant publish this without removing this library.

Stop listening for GPS updates when GPS has been turned off

What steps will reproduce the problem?
Turn on the GPS, start the app, go to setting and make sure that GPS sensor is enabled. After few minutes, turn off the GPS on the device.

What is the expected output? What do you see instead?
When I turn off the GPS, I expect the app stops listening to the GPS updates, since none would be available. However, it does not remove the location listener and unnecessarily drains the battery.

What version are you using? On what operating system?
Latest version available on the F-Droid on both Nexus 5x and Nexus 6 running Android Marshmallow.

My suggestion to fix the problem
This issue can be easily fixed by calling the method "_disable()" in the callback "onProviderDisabled" and call "_enable" in the callback "onProviderEnabled" to avoid consuming power unnecessarily. Therefore, you remove the listener when user turns off the GPS and register it to resume collecting GPS sensor when the user turns on GPS

@aaaaalbert

Cannot do HTTPS uploads

When I try to do an HTTPS upload, it immediately appears to complete with the message:

Upload finished with:

(nothing follows the colon).

On the nginx server, I see:

Apr 10 20:54:12 www nginx[232]: www nginx: 2017/04/10 20:54:12 [info] 232#232: *1 client closed connection while SSL handshaking, client: ::ffff:1.2.3.4, server: [::]:443

If an SSL handshake failure is happening, it would be good to show/log the reason. The server is a standard nginx TLS configuration. Please let me know if you want any additional information.

Radio Sensor causes NullPointerException

NullPointerException whenever radio cell sensor is enabled. Stack trace

10-16 12:35:44.898: E/AndroidRuntime(5218): FATAL EXCEPTION: main
10-16 12:35:44.898: E/AndroidRuntime(5218): java.lang.NullPointerException
10-16 12:35:44.898: E/AndroidRuntime(5218): at at.univie.sensorium.sensors.SensorValue.getValueRepresentation(SensorValue.java:85)
10-16 12:35:44.898: E/AndroidRuntime(5218): at at.univie.sensorium.SensorViewItem.updateDisplay(SensorViewItem.java:40)
10-16 12:35:44.898: E/AndroidRuntime(5218): at at.univie.sensorium.SensorViewItem.sensorUpdated(SensorViewItem.java:53)
10-16 12:35:44.898: E/AndroidRuntime(5218): at at.univie.sensorium.sensors.AbstractSensor.notifyListeners(AbstractSensor.java:167)
10-16 12:35:44.898: E/AndroidRuntime(5218): at at.univie.sensorium.sensors.RadioSensor$1.onServiceStateChanged(RadioSensor.java:111)
10-16 12:35:44.898: E/AndroidRuntime(5218): at android.telephony.PhoneStateListener$2.handleMessage(PhoneStateListener.java:360)
10-16 12:35:44.898: E/AndroidRuntime(5218): at android.os.Handler.dispatchMessage(Handler.java:99)
10-16 12:35:44.898: E/AndroidRuntime(5218): at android.os.Looper.loop(Looper.java:137)
10-16 12:35:44.898: E/AndroidRuntime(5218): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-16 12:35:44.898: E/AndroidRuntime(5218): at java.lang.reflect.Method.invokeNative(Native Method)
10-16 12:35:44.898: E/AndroidRuntime(5218): at java.lang.reflect.Method.invoke(Method.java:511)
10-16 12:35:44.898: E/AndroidRuntime(5218): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-16 12:35:44.898: E/AndroidRuntime(5218): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-16 12:35:44.898: E/AndroidRuntime(5218): at dalvik.system.NativeStart.main(Native Method)

Sensorium Configuration File

Instead of explicitly registering each invidiual sensor in the code, read a config file listing all the sensors and load them.

Read out the SIM card's MCC and MNC, too!

I don't know if this will be interesting, but it would represent another way of, (1), detecting roaming users, and (2), finding out which operators allow which to roam inside their networks. As always, the user needs to stay in control over the readouts of the sensor data.

Scanning for Bluetooth devices even if the Bluetooth is off

I have installed the latest version of the Sensorium from F-Droid (1.1.12) and installed it on Nexus 5, Nexus 6, and Galaxy S3. When I enable the Bluetooth sensor on the setting, the app shows the information about my phone Bluetooth status, discoverable devices, and paired devices, if the bluetooth is on. When I turn off the Bluetooth of the device, but the Bluetooth sensor of the sensorium is still enabled, the app keeps performing Bluetooth discovery (I can see the "restart bluetooth scanning" on the logCat every 10 seconds, which is the scan interval for Bluetooth sensor). I believe that the application should stop scanning for Bluetooth connections when the user turns of the Bluetooth on the device.

My suggestion to fix the problem:

in "at.univie.sensorium.sensors.BluetoothSensor", you stop scanning for Bluetooth connections only when the bluetooth sensor is disabled:
protected void _disable() { ... handler.removeCallbacks(scanTask); ... }

You can identify a broadcast receiver that listens to changes in the status of the device Bluetooth (with the "android.bluetooth.BluetoothAdapter.ACTION_STATE_CHANGED" intent filter). in the "OnReceive" method of this broadcast receiver, check if the Bluetooth is off or turning off. In either case, remove the callback that performs bluetooth discovery.

int state1 = android.bluetooth.BluetoothAdapter.STATE_OFF; int state2 = android.bluetooth.BluetoothAdapter.STATE_TURNING_OFF;
if(state1 || state2){ handler.removeCallbacks(scanTask); }

Meta-issue: Handle disabled sensors in a generic way

@ReyhanJB reports in issues #17, #18, #19 that Sensorium keeps trying to use sensors even if the user disabled them through Android's (but not the app's) configuration screens. Sensorium's AbstractSensor class deals with properties, data, and methods that are generic across different sensor types.

It may make sense to add a generic way to auto-disable such turned-off sensors to AbstractSensor (and also re-enable them as fit) --- perhaps a configurable BroadcastReceiver that you configure for a specific intent relates to turning a sensor on or off, and an additional latch that enables/disables Sensorium's other actions for this sensor.

Network connection information

Would it be possible to add network related information (internal and external ipv4, ipv6, dns etc)? I've seen that wifi information shows only internal ipv4 and no ipv6 info.

Scanning for wireless/cellular connections even if the wireless/radio is off

What steps will reproduce the problem?
Turn on the wireless, start the app, go to setting and make sure that wireless connection sensor is enabled. After few minutes, turn off the wireless on the device.

What is the expected output? What do you see instead?
When I turn off the wireless, I expect the app stops scanning for wireless connections. However, it does not remove the scanTask callback and unnecessarily scans for wireless devices, which drains the battery.

What version are you using? On what operating system?
Latest version available on the F-Droid on both Nexus 5x and Nexus 6 running Android Marshmallow.

My suggestion to fix the problem
This issue can be fixed similar to what is suggested in #17. In the "WifiConnectionSensor.java", identify a broadcast receiver that listens to changes in the status of the wireless sensor (That would be a Broadcast Receiver registered with "ConnectivityManager.CONNECTIVITY_ACTION" intent filter). In the "onReceive()" method of the broadcast receiver, if the wireless is turned off, then remove the scanTask callback. If the wireless is turned on, register it again to resume scanning.

IntentFilter filters = new IntentFilter(); filters.addAction(ConnectivityManager.CONNECTIVITY_ACTION); registerReceiver(connectivityChange, filters);

private final BroadcastReceiver connectivityChange = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Intent intent1 = new Intent(getApplicationContext(), DisplayMessageActivity.class); boolean disconnection = intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false); if(!disconnection) intent1.putExtra(EXTRA_MESSAGE, "Connected to WiFi"); //The first parameter is the key for the intent if(disconnection) intent1.putExtra(EXTRA_MESSAGE, "Disconnected from WiFi"); } }

@aaaaalbert

Stop scanning on low battery

Currently, the app keeps running in the background and scans the sensors until the user terminate the app. Although this is kind of what the app is supposed to do, it's better that Sensorium stops scanning and collecting sensor information when the battery is running low. It would be nice to do it automatically (disable all the sensors when the battery drops under a certain level) or let users decide if the app should stop the background service when the battery is low.

Sensorium currently tracks the battery information. With a simple check on the battery level, you can fix this issue.

@aaaaalbert

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.