I am having two issues or problems relating to running my app on Bluestacks Android emulator and my actual hardware device Samsung Note 8. In both cases my app works as it should on the Bluestacks emulator but has problems on my Note 8. My emulator runs Android 4.0.4 and is modeled after a Samsung GT-N7000. My Note 8 is running 4.1.2 rooted.
The first issue relates to calling CancelScheduledService from my Main App. I have a Widget that uses
StartServiceAt("", DateTime.now + 60 * 1000, True) which is put under Sub Service_Start. I have two buttons for my widget. With a button click event from my widget I call StartService("").
With another button click event from my widget I call CancelScheduledService(""). From my main app I needed the ability to also cancel a scheduled service. So, I have CancelScheduledService("MyWidget_Service") called with a button click event sub.
With the Bluestacks emulator the widget's scheduled service gets properly canceled by calling CancelScheduledService("MyWidget_Service") from my main app as well as my widget's button click event that also calls CancelScheduledService("").
With my Samsung note 8 the service does not get canceled when calling CancelScheduledService("MyWidget_Service") from my main app. It keeps running. If I add StopService(MyWidget_Service") right after CancelScheduledService("MyWidget_Service") in my main app then I can get the Scheduled service to finally terminate. I don't think I should have to do that. I can't figure out what is causing this issue.
The second issue I have discussed with Erel somewhat. I was suppose to send him an example that shows this problem. I did not yet because I discovered that this issue or problem only shows up on my Note 8 and not when my app is running on the Bluestacks emulator.
I have a label placed over the top of an Imageview object for my home screen widget made in designer. The Imageview has a graphic image loaded in designer. The label that is placed over the Imageview has a transparent background so as to show the imageview graphic. Text is put into the label from the widget's code. The text is black in color.
Now if my widget is displayed on my home screen and I happen to open an app which covers over my widget and then close the app the text in my widget's label disappears. This happens only on my Note 8 and not in the emulator.
During screen rotation on my note 8 this will also happen but I detect the rotation (Landscape or Portrait) and call rv.updatewidget which corrects the issue and displays the text on the label again. This uses a 500 millisecond timer to do this. Checking every 500 millisecond for a screen rotation. I can't really rotate the screen on an emulator like on an actual device so I don't know if the emulator would have the same problem.
So, these two problem seem have something to do with my Note 8 I don't know why. You would think I have more problems using an emulator. My manifest is below if that helps at all. I have all APIs downloaded with Android SDK manager 14 to 19.
The first issue relates to calling CancelScheduledService from my Main App. I have a Widget that uses
StartServiceAt("", DateTime.now + 60 * 1000, True) which is put under Sub Service_Start. I have two buttons for my widget. With a button click event from my widget I call StartService("").
With another button click event from my widget I call CancelScheduledService(""). From my main app I needed the ability to also cancel a scheduled service. So, I have CancelScheduledService("MyWidget_Service") called with a button click event sub.
With the Bluestacks emulator the widget's scheduled service gets properly canceled by calling CancelScheduledService("MyWidget_Service") from my main app as well as my widget's button click event that also calls CancelScheduledService("").
With my Samsung note 8 the service does not get canceled when calling CancelScheduledService("MyWidget_Service") from my main app. It keeps running. If I add StopService(MyWidget_Service") right after CancelScheduledService("MyWidget_Service") in my main app then I can get the Scheduled service to finally terminate. I don't think I should have to do that. I can't figure out what is causing this issue.
The second issue I have discussed with Erel somewhat. I was suppose to send him an example that shows this problem. I did not yet because I discovered that this issue or problem only shows up on my Note 8 and not when my app is running on the Bluestacks emulator.
I have a label placed over the top of an Imageview object for my home screen widget made in designer. The Imageview has a graphic image loaded in designer. The label that is placed over the Imageview has a transparent background so as to show the imageview graphic. Text is put into the label from the widget's code. The text is black in color.
Now if my widget is displayed on my home screen and I happen to open an app which covers over my widget and then close the app the text in my widget's label disappears. This happens only on my Note 8 and not in the emulator.
During screen rotation on my note 8 this will also happen but I detect the rotation (Landscape or Portrait) and call rv.updatewidget which corrects the issue and displays the text on the label again. This uses a 500 millisecond timer to do this. Checking every 500 millisecond for a screen rotation. I can't really rotate the screen on an emulator like on an actual device so I don't know if the emulator would have the same problem.
So, these two problem seem have something to do with my Note 8 I don't know why. You would think I have more problems using an emulator. My manifest is below if that helps at all. I have all APIs downloaded with Android SDK manager 14 to 19.
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Light")
SetApplicationAttribute(android:theme, "@style/Theme.Tclstyle1")
SetApplicationAttribute(android:uiOptions, "splitActionBarWhenNarrow")
SetActivityAttribute(main, android:windowSoftInputMode, adjustPan|stateHidden)