{"action":"closed","issue":{"url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/343","repository_url":"https://api.github.com/repos/AltBeacon/android-beacon-library","labels_url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/343/labels{/name}","comments_url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/343/comments","events_url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/343/events","html_url":"https://github.com/AltBeacon/android-beacon-library/issues/343","id":135826288,"number":343,"title":"No beacon detection if the Android device OS is lower than 5","user":{"login":"tyler77","id":17255479,"avatar_url":"https://avatars.githubusercontent.com/u/17255479?v=3","gravatar_id":"","url":"https://api.github.com/users/tyler77","html_url":"https://github.com/tyler77","followers_url":"https://api.github.com/users/tyler77/followers","following_url":"https://api.github.com/users/tyler77/following{/other_user}","gists_url":"https://api.github.com/users/tyler77/gists{/gist_id}","starred_url":"https://api.github.com/users/tyler77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyler77/subscriptions","organizations_url":"https://api.github.com/users/tyler77/orgs","repos_url":"https://api.github.com/users/tyler77/repos","events_url":"https://api.github.com/users/tyler77/events{/privacy}","received_events_url":"https://api.github.com/users/tyler77/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-23T18:45:42Z","updated_at":"2016-04-01T16:17:50Z","closed_at":"2016-04-01T16:17:50Z","body":"Here is the code that we're using:\r\n\r\n`\r\n\r\npublic class ApplicationClass extends Application implements BootstrapNotifier, BeaconConsumer {\r\n\tprivate static final String TAG = \"Demo1\";\r\n\tprivate RegionBootstrap regionBootstrap;\r\n\tprivate BeaconManager beaconManager;\r\n\t@Override\r\n\tpublic void onCreate()\r\n\t{\r\n\t\tsuper.onCreate();\r\n\r\n\t\t// Initialize the singletons so their instances\r\n\t\t// are bound to the application process.\r\n\t\tinitSingletons();\r\n\t}\r\n\r\n\tpublic String getIncompatibilityReason(Context context) {\r\n\t\tif (android.os.Build.VERSION.SDK_INT < 18) {\r\n\t\t\treturn \"requires Android 4.3\";\r\n\t\t}\r\n\t\tif (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\r\n\t\t\treturn \"requires Bluetooth LE\";\r\n\t\t}\r\n\t\treturn null;\r\n\t}  \r\n\r\n\tprotected void initSingletons()\r\n\t{\r\n\t\t\r\n\t\tBeaconManager.setsManifestCheckingDisabled(true);\r\n\t\tLog.d(TAG, \"App started up\");\r\n\t\tbeaconManager = BeaconManager.getInstanceForApplication(this);\r\n\t\tbeaconManager.bind(this);\r\n\t\t// wake up the app when any beacon is seen (you can specify specific id filers in the parameters below)\r\n\t\r\n\t}\r\n\t\r\n\t@Override\r\n\tpublic void onBeaconServiceConnect() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tbeaconManager.setBackgroundBetweenScanPeriod(10000l);\r\n\t    beaconManager.setBackgroundScanPeriod(10000l);\r\n\t    beaconManager.setBackgroundMode(true);\r\n\t      try {\r\n\t\t\tbeaconManager.updateScanPeriods();\r\n\t\t} catch (RemoteException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t       beaconManager.getBeaconParsers().add(new BeaconParser().\r\n\t              setBeaconLayout(\"m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25\"));\r\n\t   \tRegion region = new Region(\"com.easibeacon.demos.demo1\", null, null, null);\r\n\t\tregionBootstrap = new RegionBootstrap(this, region);\r\n\t\t\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\tpublic void showNotification(String title, String message) {\r\n\t\tIntent notifyIntent = new Intent(this, BeaconListActivity.class);\r\n\t\tnotifyIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\r\n\t\tPendingIntent pendingIntent = PendingIntent.getActivities(this, 0,\r\n\t\t\t\tnew Intent[] { notifyIntent }, PendingIntent.FLAG_UPDATE_CURRENT);\r\n\t\tNotification notification = new Notification.Builder(this)\r\n\t\t.setSmallIcon(android.R.drawable.ic_dialog_info)\r\n\t\t.setContentTitle(title)\r\n\t\t.setContentText(message)\r\n\t\t.setAutoCancel(true)\r\n\t\t.setContentIntent(pendingIntent)\r\n\t\t.build();\r\n\t\tnotification.defaults |= Notification.DEFAULT_SOUND;\r\n\t\tNotificationManager notificationManager =\r\n\t\t\t\t(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\r\n\t\tnotificationManager.notify(1, notification);\r\n\t}\r\n\r\n\r\n\r\n\t@Override\r\n\tpublic void didDetermineStateForRegion(int arg0, Region arg1) {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void didEnterRegion(Region arg0) {\r\n\t\r\n\t\tshowNotification(\r\n\t\t\t\t\"Enter in Beacon area\",\r\n\t\t\t\t\"Thanks\");\r\n\t\tIntent intent = new Intent(this, BeaconListActivity.class);\r\n\r\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\tthis.startActivity(intent);\r\n\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void didExitRegion(Region arg0) {\r\n\t\tshowNotification(\r\n\t\t\t\t\"Exit From Beacon\",\r\n\t\t\t\t\"Thanks\");\r\n\t}\r\n\r\n\r\n}\r\n\r\n\r\n`\r\nWe have made some tests on the following devices:\r\nSamsung Neo Plus - Android 4.4.4\r\nSony Xperia Z1 - Android 4.3\r\nHuawei Y125U21 - Android 4.4.2\r\nHuawei P8 - Android 5\r\n\r\nOnly the P8 detects the beacons and detects the region also in background.\r\nOn stackoverflow I found this post and it seems my problem..\r\nhttp://stackoverflow.com/questions/35503904/android-4-4-ble-scanning-lack-of-stability\r\n\r\nWhat do you think? Do you think it is an OS problem? Any advice?\r\nPlease, can you check if my code is correct?\r\nThank you very very much.\r\n\r\n\r\n"}}