Git Product home page Git Product logo

Comments (25)

davidgyoung avatar davidgyoung commented on August 20, 2024

This could be a misconfiguration in your app. Please try to reproduce with the reference application here: https://github.com/AltBeacon/android-beacon-library-reference

If you can reproduce with thgast app, please post results here. If it is an issue with your app, please open a question on Stackoverflow.com

from android-beacon-library.

f4t-t0ny avatar f4t-t0ny commented on August 20, 2024

I found the exact same Issue like cokeby190 described. I monitored the behaviour (I9300, 4.4.4) with the reference app(https://github.com/AltBeacon/android-beacon-library-reference), which also does not start the altbeacon-service after (dis)connecting power. Any clues?

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

@f4t-t0ny, can you please set beaconManager.setDebug(true) during app startup, then link to a LogCat excerpt showing what you see when you connect the device to your workstation.

from android-beacon-library.

f4t-t0ny avatar f4t-t0ny commented on August 20, 2024

Installed the reference Application, started the App once, killed, now connected power:

Excerpt when connecting:

11-06 13:52:23.687 2293 LightsService D Excessive delay setting light: 54ms
11-06 13:52:23.687 2293 lights D set_light_buttons: 1
11-06 13:52:23.687 5131 PicasaUploaderSync.. D battery info: true
11-06 13:52:23.692 2917 GCoreUlr I Starting service, intent=Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingServic
e (has extras) }, extras=Bundle[{receiverAction=android.intent.action.ACTION_POWER_CONNECTED}]
11-06 13:52:23.697 2917 GCoreUlr I WorldUpdater received intent Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingSe
rvice (has extras) } with receiverAction android.intent.action.ACTION_POWER_CONNECTED
11-06 13:52:23.787 2917 GCoreUlr I No GCM registration ID
11-06 13:52:23.892 2917 GCoreUlr I Ensuring that reporting is stopped because of reasons: {account#17#=[InactiveReason{mVersionCode=0, mIdentifier=6, mName='ReportingNotSelected'}, InactiveReason{mVersionCode=0, mIdentifi
er=7, mName='DasherPolicy'}], account#12#=[InactiveReason{mVersionCode=0, mIdentifier=6, mName='ReportingNotSelected'}]}
11-06 13:52:23.892 2917 GCoreFlp D Unknown pending intent to remove.
11-06 13:52:23.897 2917 GCoreUlr I Unbound from all location providers
11-06 13:52:28.692 2293 lights D set_light_buttons: 2

Excerpt when disconnecting:

11-06 13:54:46.337 5131 PicasaUploaderSync.. D battery info: false
11-06 13:54:46.347 2917 GCoreUlr I Starting service, intent=Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingServic
e (has extras) }, extras=Bundle[{receiverAction=android.intent.action.ACTION_POWER_DISCONNECTED}]
11-06 13:54:46.372 2917 GCoreUlr I WorldUpdater received intent Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingSe
rvice (has extras) } with receiverAction android.intent.action.ACTION_POWER_DISCONNECTED
11-06 13:54:46.452 2917 GCoreUlr I No GCM registration ID
11-06 13:54:46.517 2917 GCoreUlr I Ensuring that reporting is stopped because of reasons: {account#17#=[InactiveReason{mVersionCode=0, mIdentifier=6, mName='ReportingNotSelected'}, InactiveReason{mVersionCode=0, mIdentifi
er=7, mName='DasherPolicy'}], account#12#=[InactiveReason{mVersionCode=0, mIdentifier=6, mName='ReportingNotSelected'}]}
11-06 13:54:46.517 2917 GCoreFlp D Unknown pending intent to remove.
11-06 13:54:46.522 2917 GCoreUlr I Unbound from all location providers

from android-beacon-library.

f4t-t0ny avatar f4t-t0ny commented on August 20, 2024

Tested behaviour with debug flag (BeaconManager.debug = true), but Line 20 of "StartupBroadcastReceiver" is never printed (However starting the service works with action.BOOT_COMPLETED).

from android-beacon-library.

jessolo avatar jessolo commented on August 20, 2024

I too face this issue. BeaconService does not detect beacon when the app is killed and power connected and disconnected. I sometimes see beacon service detecting beacon when the phone is rebooted. I have never seen the app opening up when a beacon is detected. Can you pls help me in setting this right?

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

I wonder if some devices are blocking the ACTION_POWER_DISCONNECTED and ACTION_POWER_CONNECTED events. They are not supposed to require any special permissions. I have not seen this behavior on Nexus devices or on the Galaxy S3 (as reported by @f4t-t0ny), but my Galaxy S3 has a Cyanogenmod 4.4 image installed which may not block these events.

I would be curious to hear if somebody who is experiencing this behavior can make a simple app that does nothing but set up a BroadcastReceiver to receive the events below and see if certain devices are blocking receipt of connected/disconnected events:

<receiver android:name=".MyBroadcastReceiver">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED"/>
        <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
        <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
    </intent-filter>
</receiver>

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

I have created an app to test devices to make sure they can receive the ACTION_POWER_CONNECTED event in order to restart beacon detections. Please try running this app (instructions in the README.md, binary download available under releases) and report the results along with your model number here.

https://github.com/davidgyoung/power-connect-tester

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

@cokeby190, @jessolo, @f4t-t0ny, I'd appreciate it if you could run the test above on your devices to help get to the bottom of this issue.

from android-beacon-library.

markvandertol avatar markvandertol commented on August 20, 2024

I've tried the app on my Nexus 5 (Android 4.4) and there it works as expected when you kill the app through the app switcher. However if you force-stop the app through the app settings, then Android won't automatically restart the app until the app is launched manually by the user again. This is by design.

Maybe some launchers perform a "force stop" instead of a "normal stop" when closing a task through the task switcher? I don't know if there is a easy way to see if an app has been "force stopped".

I don't see a clear distinction for a force stop and the other ways the app gets killed in http://altbeacon.github.io/android-beacon-library/resume-after-terminate.html Maybe something that could be added.

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

@markvandertol I think you have a good point. Per the docs here if an app is force stopped its app package is put in a stopped state (same as if app is never run) and it cannot receive any broadcast intents until the app is explicitly launched again.

Now, reading back on the folks who reported the problem in this issue, it is not exactly clear how they killed the app. Did they (a) swipe the app off of the recent apps list? or (b) hit the "FORCE STOP" button on the App info screen under settings.

@cokeby190 and @f4t-t0ny, can you please clarify?

I doubt that some phone builds perform a "force stop" when closing an app through the task switcher, but it is possible. One way to verify this is to close the app through the task switcher, then go to the app info page in settings and see if the "force stop" button is greyed out. If it is, then a force stop was performed.

@markvandertol, I agree that clarification should be made in http://altbeacon.github.io/android-beacon-library/resume-after-terminate.html. But I'd like to fully understand what we should clarify first. :)

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

I have verified that on a Nexus 5 / Android the following intents are received after killing the task from the task switcher, and are not received after doing a force stop. When the intents are received, they have the flags below:

android.intent.action.ACTION_POWER_CONNECTED flg=0x4000010 (FLAG_ACTIVITY_CLEAR_TOP | FLAG_EXCLUDE_STOPPED_PACKAGES)
android.intent.action.ACTION_POWER_DISCONNECTED flg=0x4000010 (FLAG_ACTIVITY_CLEAR_TOP | FLAG_EXCLUDE_STOPPED_PACKAGES)
android.intent.action.BOOT_COMPLETED flg=0x8000010 (FLAG_RECEIVER_NO_ABORT | FLAG_EXCLUDE_STOPPED_PACKAGES)

This confirms that these intents are not supposed to be delivered to stopped packages. (Those killed through force stop).

from android-beacon-library.

chrisriesgo avatar chrisriesgo commented on August 20, 2024

Using the power-connect-test, I've confirmed that the app works as expected on:

Model number: SAMSUNG-SGH-I337 (Galaxy S4)
Android version: 4.4.4
Build Number: KTU84P.I337UCUFNJ4

from android-beacon-library.

kapilkumarchawala avatar kapilkumarchawala commented on August 20, 2024

I downloaded the reference application and it worked fine in background and foreground but not working after killing the app from task switcher. I tested using nexus 5. Same is happening with my app in which I have used this plugin.

Process that I followed is:
Launched the app from eclipse-> detached the device from computer->Killed the app -> attached the device to the computer-> transmitted the registered beacon.
but it is not detecting that beacon. I have issued a local notification from the didenter method which appears when app is running in foreground or background but not appears when app is killed.

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

@kapilkumarchawala, Your results do not match those of mine on the Nexus 5. Can you please confirm your Nexus 5 OS version and try with the following app: https://github.com/davidgyoung/power-connect-tester (See instructions in the README.md)

from android-beacon-library.

kapilkumarchawala avatar kapilkumarchawala commented on August 20, 2024

Nexus 5 OS version is 5.1

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

It is possible this has changed in Android 5.1. My tests so far have only been on 5.0 on the Nexus 5, I will retest when I get the OS upgrade.

from android-beacon-library.

jnivard avatar jnivard commented on August 20, 2024

Hai

I did set up the project in eclips. But when I start the project I recieve a message : Unable to create the application BeaconServiceNotDelclared exception. The BeaconService is not properly declared

<uses-sdk
    android:minSdkVersion="17"
    android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

<application 
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" 
    android:name="BeaconReferenceApplication">
    <activity
        android:name="org.altbeacon.beaconreference.MonitoringActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="org.altbeacon.beaconreference.RangingActivity"
        android:label="@string/app_name" >
        <intent-filter>
        </intent-filter>
    </activity>

</application>

Project target.
target=android-21
manifestmerger.enabled=true
android.library.reference.1=../android-beacon-library-eclipse

I can not see what is wrong?

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

@jnivard, for assistance using this library, please create a question on Stackoverflow.com. this forum is reserved for feature requests and reporting reproducible bugs with the library itself.

To save you time, I will say right off that it appears manifest merging is not working in your Eclipse setup. If you can't fix this, you might try copying entries manually from here: https://github.com/AltBeacon/android-beacon-library/blob/master/src/main/AndroidManifest.xml

If you need more help, please open a question on StackOverflow.com

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

Model Number: Nexus 9
Build Number: MPA44l (Android 6.0 Preview)

The app works as expected. Power connect and disconnect events are passed to the app, even after you kill the app with the task switcher, and even after a reboot.

If, however, you do a force stop of the app from settings, it will no longer re-launch on power connect/disconnect events until you manually relaunch.

This is all expected behavior consistent with tests on 4.4.x on the Nexus 5.

from android-beacon-library.

AlexTrotsenko avatar AlexTrotsenko commented on August 20, 2024

Hi @davidgyoung ,

I have just read http://altbeacon.github.io/android-beacon-library/resume-after-terminate.html.

Please, correct me if I am wrong, but following statement misses Negation ("NOT" word)

Terminating an app as described in case 5 above will typically allow them to resume automatically without starting them manually -- this is a limitation imposed by the operating system.

I know, that It's not very linked to the current issue, but I don't know any better place to report this kind of issues.

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

Good catch, Alex. I have fixed this and added the missing "not"

from android-beacon-library.

tyler77 avatar tyler77 commented on August 20, 2024

Hi @davidgyoung, maybe my P8 Huawey have the same issue. It seems that after killing the App from the task switcher, the App does't detect the beacons anymore. But I have some trouble if i import

https://github.com/davidgyoung/power-connect-tester

in Eclipse. Is the App still working? Could you please explain me how to import it correctly into Eclipse?

I would like to have a confirmation that also P8 blocks the reboot.

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

@tyler77, the project only builds with Android Studio, but you can download a binary release here: https://github.com/davidgyoung/power-connect-tester/releases

Please let us know what you find on the P8

from android-beacon-library.

davidgyoung avatar davidgyoung commented on August 20, 2024

closing due to inactivity

from android-beacon-library.

Related Issues (20)

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.