Sticky service not restarting on OnePlus 2 - android

I have a background service that handles network traffic for my app. The service returns START_STICKY and it works perfectly (restarts after app is swiped) on Emulated Google Pixel (Android 7.1.1) and on a physical Motorola G4 (Android 7.0).
However, when I test the same app on my OnePlus 2 (Android 6.0.1 - my main driver), the service just disappears when the app is swiped away without any trace or restart attempt...
If anyone has any ideas or suggestions I'd love to hear them.

Related

Notification shows up in android emulator but not on physical device

I have set a timely notification of 30 minutes using JobScheduler, my app shows the notification in Android Emulator(Pixel 3 API 29 Q-10) after 30 minutes but not on my physical device(Samsung S8 Android 9 Pie).
The weird thing is the same notification shows up when I open the app after 30 minutes.
Are there any restrictions in android?
I have tried so far:
Running app in physical device using USB debugger mode, no errors.
Building the APK and installing it in the device separately
I found that, If the phone is in power saver mode or any battery optimized mode the notifications won't show up. Turning off power saver mode worked for me.

How can I know why my app is crashing in some devices

My app is running fine in the emulator, and at Nokia 6 plus mobile, but it is crashing while running at Motorola motoOne, how can I find the reason of this?

Samsung system image for Android emulator?

Is there any way to get the Android emulator to run a system image other than vanilla Android? I'm developing an app that works fine on the emulator, a physical Huawei device and a physical Motorola device, but experiences some weird issues on a Samsung Galaxy S7.
Since I don't have physical access to a Galaxy S7, is there any way to run an emulator that actually runs the Samsung official ROM? Note that I'm not talking about an emulator skin, I'm talking about the actual system image.
While there might not be any Samsung system images to download and install on the Android Studio emulator, there is another option.
Samsung has something called Remote Test Lab, which lets you access and control a real Samsung device online. You have to join the Samsung Developers programme, and then you can use these test devices. Samsung uses a credit-based system for this, and you get 20 free credits every day, which you can then use to run test devices. Running a Galaxy S7 for 30 minutes cost me 2 credits.
This actually works surprisingly well, and only slightly more lagging than the AVD. It is even possible to get Logcat output by connecting to the device with ADB (right click on the device window for options).

Android BLE Scan unstable 6.0.1

I am using Android 6.0.1 and I am facing BLE Scan issue. The problem is sometimes the scan results return no device and sometimes it returns device. It means I have a remote device by name 'A'. 'A' is discovered and shown in my app once and again after few seconds, 'A' disappears in my discovered window and again re-appears after few seconds. This is the problem which I am facing in Samsung S5. But the same app running in Samsung S6 and S7 works fine with scanning.
I have given necessary permission for Location Services too and my GPS is ON. What could be the problem stil?

Android app works on emulator but not on phone

So I've made this game for android-phones, that runs perfectly fine on my emulator. The problem is that when i try to run it on my phone, it just turns back to the in-app menu when i try to launch the game - I don't get any error messages.
Any tips on why this happens, and how I can possibly fix it.
btw. The phone I am using is HTC Desire
Update:
I tried testing it on an SIII. Here I got a crash message instead.
The android emulator, and the HTC Desire runs Android 2.2 while the SIII runs Android 4.0

Categories

Resources