[RELEASE] Improved Mobile Presence (Android only)

android
presence
dth_presence
project_presence
webcore

#101

Spoke too soon


#102

Did you allow the permission to ignore optimizations? Did it actually update after that? It should retry if it fails to update.


#103

Got it working now. I believe the issue was because I was using an old Android phone. I tried it on a more current phone, and it worked just fine.


(Kyle Porter) #104

First, I really appreciate what you did with this app/device. This seems like a much more accurate way to detect presence than currently supported methods in native ST. I’m having a problem with the app - likely due to legacy android compatibility. I installed your app on my S5 running 6.0.1 - everything works fine. Then, I installed the app on a family member’s LG G3 running 6.0. The installation works, but when I attempt to “Add network” I get the error message “Unfortunately, Presence Sensor has stopped.” I’ve uninstalled and reinstalled the app multiple times, and I’m getting this same error message on multiple devices (I have 2 of these phones in my family). Reading through previous posts, I turned on the notifications in the app settings and unfortunately that has not revealed more information regarding the error. Any help you can provide would be much appreciated. Again, thanks for creating this improved presence method.


#105

Does it pop up anything at all before that? Might be an issue with scanning for networks or something but I’ll have to look into it more. If you know how to get logs or anything that would help.


(Kyle Porter) #106

Yes, I do momentarily see the dialog “Select a network to add” with a circular in-progress graphic. The app fails after this dialog displays. Another interesting note - it seems to search for networks a little longer before failing on the initial app launch then it does on subsequent launches (fails faster after the first try). I believe you are right - it is something to do with searching for networks. I’ve confirmed that the phone is in fact within range of multiple networks and connected to one of them. I’m having lots of difficulty accessing logcat on this phone. I will post the log if I can get to it.


(Kyle Porter) #107

Here’s some log information. It looks like the app is lacking required permissions on this version of android to pull the network info.

“Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results”

--------- beginning of crash

12-26 10:39:42.621 385 385 E AndroidRuntime: FATAL EXCEPTION: main

12-26 10:39:42.621 385 385 E AndroidRuntime: Process: com.callahtech.presencesensor, PID: 385

12-26 10:39:42.621 385 385 E AndroidRuntime: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.wifi.SCAN_RESULTS flg=0x4000010 (has extras) } in com.callahtech.PresenceSensor.NetworkSelectionDialog$ScanReceiver@940f809

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:935)

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5527)

12-26 10:39:42.621 385 385 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)

12-26 10:39:42.621 385 385 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)

12-26 10:39:42.621 385 385 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)

12-26 10:39:42.621 385 385 E AndroidRuntime: Caused by: java.lang.SecurityException: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1599)

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1552)

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.net.wifi.IWifiManager$Stub$Proxy.getScanResults(IWifiManager.java:1150)

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.net.wifi.WifiManager.getScanResults(WifiManager.java:1356)

12-26 10:39:42.621 385 385 E AndroidRuntime: at com.callahtech.PresenceSensor.NetworkSelectionDialog$ScanReceiver.onReceive(NetworkSelectionDialog.java:105)

12-26 10:39:42.621 385 385 E AndroidRuntime: at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:925)

12-26 10:39:42.621 385 385 E AndroidRuntime: … 7 more


#108

Thanks for the information. Just added the permissions so it should be working in the next update.


(Kyle Porter) #109

Thanks - much appreciated!


(Kyle Porter) #110

I saw the new version of your app on the play store last night - devices updated… good stuff. I like the new interface. Two comments:

  1. My phone that was working well now does not scan for networks - no errors. When I add a location, nothing shows up in the list… just the text “Check the networks that you would like to include in this location.” and nothing else.

  2. My phones that were not working before are still reporting the same permissions error:

[31873,0,com.callahtech.presencesensor,952680004,java.lang.SecurityException,Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results,Parcel.java,1599]

Thanks again for your help!


#111

Um… Ok so make sure you have the permissions enabled. Forgot to add a prompt to ask for them. Also you said your other one that was working before is no longer working? Wait like 30 seconds and see if the networks come up. And there is also now stable and beta versions of the app. You can pick in the play store if you scroll down all the way to the bottom.


(Kyle Porter) #112

Yup, you’re right. Enabling the permission through the application manager cleared up all of the issues - my mistake. I was expecting the dialog to ask me for permission, and when I didn’t see it, I didn’t think to look in application manager. Everything is working now as expected. Thanks again for all of your help - this is an awesome product.


#113

I think that this is a much better solution to a ST presence sensor than what is currently implemented in ST but I am having a hard time getting this to work. The device in displayed in ST but it doesn’t seem to want to update whether I am home or away. I have even went in a granted it location permissions as was suggested to a previous poster. I am currently running Android 8.1. Any assistance to get this running is greatly appreciated. Thank you.


#114

What app version do you have?


#115

It looks like I am running app version 1.5. Thanks for the follow up.


#116

Were you able to add a location and add networks to it?


#117

I might be having the same problem. Everything else works fine, v 1.5, location and network added, and if I hit the manual refresh button I get the notification “Server is updated” and ST Presence is updated.

But it won’t do it automatically. I can connect and disconnect to wifi all day and it won’t trigger. Not even once. I’m running 8.1.


#118

I am having the same issues as mark2k. I can add locations and wifi without issues and can manually refresh the app to update ST but it will not automatically update itself.


#119

Ok so I think I know what the problem is then. I’m going to send you an apk and it should help me get some more info.


(Tim Mathis) #120

I have the same problem. Running 8.1 as well. Side question, is there an ios version? My step daughter has an iPhone and I don’t want to give her access to the actual ST app.