I have written an App using the Mobile and Android SDK (based on the sample app).
However on when the app runs on a DJI Crystal Sky, it frequently happens that no Toast Messages get displayed.
Patterns:
- They work fine on other devices.
- If they work, they work continuously while the app runs.
- If they don't work, they won't show up at all.
- The best way to get them to show is to reinstall the app.
- Changing notification settings on the Crystal Sky had no effect for me.
Has anyone else come across this issue and found a way to solve it?
It seems like DJI use Toast messages in DJI Go and Go4 where they show reliably. I.e.: there must be a way to get them to work.
P.S: I already looked into Snackbar and other libraries, but they are by far not as versatile which is why I would like to stick to Toast if possible.
EDIT 29/04/2019
I have just noticed that the same behaviour is observed in other Apps (ES file explorer).
Probably not fixable in code and a bug in the Crystal Sky's software.
EDIT 02/07/2019
As it was pointed out by Milanka in the comments,
the Crystal Sky automatically disables Notifications for apps which hides Toast messages.
On my units it happens after each reboot.
Related
We have a (rather complicated) Qt application, with port to Android. It worked quite OK - until we started trying it on Android Pie.
Sometimes, either after start, or after return from background, application visually freezes - however, logging shows that UI thread is alive, it responds to taps, widgets receive paintEvent()'s and process them. But nothing changes on screen.
Hardware buttons like 'Back' also work - application is able to show 'Are you sure to exit?" message box and it works properly.
Also, you you try to go ot home screen and back to app - most of the time it unfreezes.
Actually, this behavior started on Android 8, but was resolve with a dirty hack - doing hide/show for main widget upon receiving applicationStateChange(Active). But it stopped working on Android 9.
I am completely out of ideas what could we do to produce such behavior, and how to fix that...
After a long and rather tedious debugging we finally narrowed it to a problem in Qt itself.
I've reported a bug: https://bugreports.qt.io/browse/QTBUG-76142
However, I don't know whether it was fixed in newer releases, since we stopped development of Android apps for now.
This is not an actual solution, but shares some ideas. I used QT 6.3 and the same hang/freeze problem occurred in qt android app (arm64-v8a / Qt widgets) after returning from background or after phone auto off when app is opened and after return to phone on. Another consequence is that after sending the app to background, I can't use Google chrome properly (I only tested this app, not other apps). What happened is that it's very slow and scrolling in Chrome doesn't work as usual.
I suppressed this problem with this trick (not a solution): i.e., before sending the QT app to the background, I triggered it to show a message box (from clicking a button) and let message box open. Now the Google Chrome app worked normally. And after dragging the QT app to the front and giving OK to the message box, I was able to use the application as usual. No hang/freeze problem.
Also I read an article from a link (https://lists.qt-project.org/pipermail/interest/2014-November/014218.html) : That is, we can able to modify the QtActivity.java (which can communicate to the QT app) and use the on pause and on resume event. So what I thought is that, If I trigger the app to show Qt message box from this "on pause" event, and automatically close the same in the "on resume" event this hang/freeze can be handled.
But I didn't try above (modify QtActivity.java) because now I switched to QT 6.4 and hang/freeze problem is not present in this version.
sadly I am facing problem with One Signal and my react native application. I don't know why but somehow my push notifications aren't working anymore.. But only on iOS.. I have had the same problem with Android too but Android is working again. So, that means that the problem cannot really be the react native code cause it is working on Android.
However, when I receive a notification on my iOS device the screen remains white and the application doesn't crash. This is actually not good cause that means I don't get any crash log.. And you cannot debug iOS devices on a MacBook cause Apple has deactivated to receive push notifications on the iPhone emulator..
So, I don't really know what to do.. All I did was replacing the icons and the splash screen. On both, Android and iOS. Also confusing is, the application gets compiled and build without any problems on XCode..
I have read some issues on GitHub already but none of them are working.. What I am really wondering about is, why it is working on my Android device but not on my iOS device..
I already tried to solve the problem by deleting the node_modules folder and create it again by npm install. However, this didn't fix the problem. I also runned pod install again and checked the OneSignal documentation to double check if everything is correctly installed.. And yes, everything is correctly installed..
You guys have any idea on what to do and how to solve the problem?
After I tap on the notification the app launches and then remains on a white screen..
If the app is running in background and I tap on the push notification everything works fine!
But when I am inside the app and I receive a push notification, the app "crashes" and keeps remaining on the white screen. As well when the app is completely closed and I tap on the push notification.. The app "crashes" and keeps remaining on the white screen also...
You guys can help me?
Kind regards and Thank You!
If you don't have an IOS-Device, but only an Emulator it will become really hard to debug this.
You can give it a try with output some Test-Strings with respones-values at important points inside of your app (e.g. function for recieving Notification, for sending notification ... and so on.)
But if you need more help you have to provide more Information. What Library do you use for Firebase-Notifications (fcm, rnfirebase.io or other)... how did you implement it...
If the app is running in background and I tap on the push notification
everything works fine!
But when I am inside the app and I receive a push notification, the
app "crashes" and keeps remaining on the white screen.
Yes, here you have the Point where to start with your debugging. If receiving notifications in Background work, you're issue might be found on the Event-Handler which listen for foreground notifications.
Did you have a clean Code-Structure, where you use try & catch for all your api-based request (notification-methods)? Then it shouldn't be hard to found the issue by echo some catched errors
I just learned Android from scratch and built an app with simple process using Android Studio.
The app has one process with repeating Alarm manager which will toast a message after 10 mins. That's it.
However, once I install it on a real device, after an hour or so, the device will ask to Share Bug Report. When I do share it,(via e-mail to my self), it is just a blank black screen..!
This happens with any device. I tried it on 3 devices so far. It is like:
Device before my app: Normal functioning.
Device after installing my app (after an hour or 2): A pop up comes
up with 'Share bug report'.
PS: I have not written any code to call or share bug report or any popup.
Has anyone come across this strange behavior?? Any idea on what is happening here??
EDIT 1: It is not just a blank screen but there is a word doc with lengthy set of code. It basically contains the entire lump of data of entire system. Not just my app..!
Probably your app is freezing or stops responding.
Analyze your app logs, you will find the cause.
Did you read these threads ?
What does it mean with bug report captured in android tablet?
http://android-developers.blogspot.com/2010/05/google-feedback-for-android.html
I'll try to explain what I want to do. I have an i9100 SGS2 w/ CM10.1 (so a pretty quick phone).
What I'm trying to do is modify the mms.apk app so that when I hit the send button in an SMS, the messages pops up on the screen right away, and any backend work that needs to be done with sending the message, etc, can be done after it is on the screen.
Right now, if you send a bunch of SMS's one after the other, it seems to lag the OS, and sometimes can take up to a full second between hitting the send button and the actual SMS being shown up in the conversation...it's extremely annoying.
I've decompiled the mms.apk, but don't know what exactly I should be modifying...or if what I need to modify is even in this app?
Any ideas? I know it's a weird request...I'm just trying to get it to feel more like iPhone SMS where there is zero lag whatsoever.
Thanks,
Elliott
First of all...
This question seems to be more suitable for https://android.stackexchange.com/
As to why this is happening...
Maybe you have a ton of old messages.
Decompiling the APK is not a good idea. Especially when the source code is available for everyone to view, download and modify.
The Mms app source code for CyanogenMod can be found HERE.
This post is related to the existing filed bug:
https://groups.google.com/forum/#!topic/android-developers/K7pjy3Gm5Lk/discussion
Apparently, in some devices after a system update, the toasts are not shown. The problem happens when in preferences, for your application the notifications checkbox is unchecked. Due to that your all the toasts of your app will be hidden.
This happened to me on a Samsung galaxy tab 2 but it can happen on other devices:
Toast Notifications Not Showing Up on Nexus 7 Tablet
or on SGS3 as commented on the google group link.
I don't know if this happens on all devices with jelly bean or not.
The suggested "fixes" are fine for me but what if my app is downloaded by some people who don't know how to do that or don't want to activate notifications. I rely on toasts a lot in the app to inform the user about some feedback so I only see one solution to this:
->IMPLEMENT MY OWN TOAST CLASS, different from toast but with similar behaviour.
I have searched around I haven't found anything out there already done so I am asking if anyone has found any custom implementations (before I start coding it myself)?
The objective is: show a toast or some replacement for it even if notifications are turned off for this app.
I don't know if this happens on all devices with jelly bean or not.
AFAIK, it does.
I rely on toasts a lot in the app to inform the user about some feedback
That is not a good idea. Toasts are very short-lived, and users can easily miss them. Toasts are fine for light advisory/confirmation messages -- and for book examples :-) -- but that's about it.
The objective is: show a toast or some replacement for it even if notifications are turned off for this app.
Hopefully, your real objective is to have a quality user experience. Relying on Toasts being seen will not result in a quality user experience.
Toasts have fallen out of favor for other reasons as well, such as the fact that they are independent of the underlying activity, and so a displayed Toast may not be relevant if the user has already navigated elsewhere in the app. The leading replacement implementation is called a "crouton", based upon a term used by Cyril Mottier in a blog post, with a couple of open source implementations, such as this one.