Toast Notification issue with recent device update in Android - android

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.

Related

DJI CrystalSky - Toast Messages no showing (intermittent)

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.

show web site on Android lock screen [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm looking for a reliable way to let the Android user show a web site on the lock screen.
This could be done in principle in 3 ways:
Showing it on the native Android lock screen, but then they should be able to remove the native clock because my site is a world clock (you can see it at intelnav.50webs.com/world_time.html if you're interested). For all I know this can't be done.
Using a 3rd party custom lock screen that allows this. Unfortunately I couldn't find a good one, and I did some searching.
Writing a custom lock screen myself.
There are some suggestions and even sample projects for doing this, even some questions here on StackOverflow. But I'm not sure how reliable they are. There is no standard way of doing it, from what I found, since lock screen widgets were removed. But the proposed ways of building custom lock screens don't seem very reliable to me, from what I could judge from the comments I could find. So, one of my questions (sorry but the problem is somewhat complex), does anybody know of a sample project for a custom lock screen that actually has an app built by it and offered on Google Play and which actually works well on a wide range of devices ?
Could anybody help me with a suggestion for a reliable way to do what I want? Along the lines above?
Looks like I'm going to answer my own question. I'm not sure how many will be interested but you can never know.
Update sep 18: Now there is a short answer that wasn't available a year ago when I first answered it. Namely, my own WebLock app:
https://play.google.com/store/apps/details?id=com.simionescu.vlad.weblock
Below is my original answer that gives a general idea of how this can be done programmatically.
So I went into digging and looks like it can be done. It wasn't even as difficult as I feared it would be, though I wouldn't say it was very easy either.
The main points are as follows:
I wrote an app that basically puts the site on the native Android lock screen. (Actually, I already had an app and I added this functionality to it, but that's less important. The main thing is that my method requires writing an app.)
So I guess this falls somewhere between the cases 1 and 3 above. I do need an app, but it's not a full-fledged custom lock screen, as detailed below.
This of course means that the method is more general, it works with any app, not just for displaying a site.
Set FLAG_SHOW_WHEN_LOCKED for the Activity window, as shown for instance here:
How to make our own lock screen in android instead of default lock screen
But I only used this flag, the other 3 mentioned in the link I didn't need.
Launch the Activity (if it's not running already) and set it on top before the device screen goes off, that is on receipt of the ACTION_SCREEN_OFF event. This way, the app is always visible when the screen goes off so next time it starts, Android will put it in front of the lock screen. (At least if it's the standard one; from the documentation it looks like it should be working with a custom lock screen too but I didn't test it. I guess it depends on how that custom lock screen is written. Anyway, I don't necessarily want my site on a custom lock screen, if the user has one he probably won't want to see my site in front of it).
This also means that the site will appear in front if the device is switched off then on, even if it's not locked. Which is what I intended.
Automatically start the app at startup via the BOOT_COMPLETED event
Capture the standard back key (which is allowed, unlike for the home key) and make it act like the home key when it would otherwise terminate the app.
I intentionally let the home key act normally. This of course means that after pressing it (which is the way the user exits the app and enters the device) the lock screen underneath is shown. Otherwise I would have had to deal myself with password-protecting the device, which is in no way something I want to do. There are a few drawbacks with this approach but IMO they're small. For simplicity's sake I chose to do it like this.
Besides, this way my app remains reliable, which it wouldn't have if I had hijacked the home key, no matter which way.
As said, this means that this is no full-fledged custom lock screen, just a way of putting the site over the default lock screen.
(update nov. 18) There's one more important point. As described so far, such an app could have a security issue. I'm not an expert so I'm not sure if it really does, and if so how important it is, but you can never be too safe. If the user can go unchecked to any site, when on the lock screen, it means that if the phone is lost and a bad guy finds it, he could go to a site that has dangerous code that could unlock the device. I'm not sure if it really could be done but I wouldn't be surprised. So, one good advice for anybody who writes such an app would be to severely (but reasonably) restrict Web navigation while on the lock screen.
These are the main points, there are a few other implementation details but I'll leave them out for the moment.
All this looks pretty standard and reliable to me, given that it's all in the official Android documentation.
I tested it on my KitKat device, plus on 2 emulators, one also with KitKat on it, the other one with the latest and greatest. Everything seems to work fine. Including the case when the device / emulator is password protected.
So I just wrote the app and published it on Google play. It's here:
https://play.google.com/store/apps/details?id=com.a50webs.intelnav.worldtime
Which means that now there is at least an app on Google Play which has this feature. It remains to be seen how well it will behave. I'll probably have to make minor corrections in the coming weeks, but other than that it should be fine.
Also in the coming weeks, maybe a month or so, I plan to put another app that will do this generally with any site, at the user's request.
(update nov. 18) I finally wrote the app and put it on Google play. It took a little longer than planned but it's ready. It's here:
https://play.google.com/store/apps/details?id=com.simionescu.vlad.weblock&hl=en
As noted above, when on the lock screen, navigation is restricted to the same domain, so that if a bad guy finds the phone he cannot go to some malware site and unlock it.

Android screen stops reading inputs

First off, this has never happened before on any other android device I've used (multiple devices have been tried and tested before this).
Now I have an app that I have worked on for a little over a year now, it is called AutomatedId (on the app store) and it has worked quite well for my company for quite some time.
Recently I have been given a device to add compatibility to the app (specifically for reading UHF tags) but that isn't the problem.
The problem comes whenever you open the app, the screen stops reading inputs completely, as well as buttons cease to function. I turned on developer options to see the screen inputs and as i suspected, it completely stops and does not read any of the inputs after the app is opened. Clicks don't work, buttons don't work, keyboard doesn't open, hardware buttons on the device stop working. It's a mess, does anyone know what could have caused this?
This is a S98 from here: http://www.wepoy.com/product_view_18.html
moved my comment to the answer as you said. This may be due to memory leak. Here are some references that may help you fix them: Fixing-Memory-Leaks-in-Android-Studio & use this library from square to detect memory leaks early: leakcanary

Android Modifying mms.apk

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.

How do I set up HTC Sense and Samsung Touchwiz app icon badges?

Stock Android doesn't support 'badges' (e.g. unread count on a messaging app) that overlay the app icon like on the iPhone. There are a number of questions here on Stackoverflow which confirm this and suggest using a widget.
Whilst widgets are lovely things, they require too much interaction from the user to get in place (all that searching, long pressing etc.) and don't actually change the app icon. So no, that is not an option.
I accept that Android doesn't have app icon badges. However, HTC Sense and Samsung TouchWiz do. I'm looking at my Galaxy S right now, and the app launcher Messaging icon has a badge with the number of unread SMS messages.
Does anyone know how to access this badge functionality individually for Sense and TouchWiz devices? (I expect there are two APIs).
I don't know about HTC but I've written up how to do this on Samsung phones here How to interface with the BadgeProvider on Samsung phones to add a count to the app icon?
Does anyone know how to access this badge functionality individually for Sense and TouchWiz devices? (I expect there are two APIs).
Become an employee of HTC or Samsung, respectively.
HTC might start offering an API for stuff like this through Open Sense. Samsung might start offering an API for stuff like this through their developer site. I am not aware that either are at present and I wouldn't count on it becoming available.
What you are seeing is a feature of those home screens. You are, of course, welcome to write your own home screen where you have this functionality, perhaps even exposing an API for third-party developers to use.
Still no positive answer to this?
It's very strange that they (HTC and Samsung) haven't come up with a way for third-party apps to update their widgets! So we end up with users of third-party sms apps to complain about the sms counter not updating when it should. This is very sad, especially on the Android world where app integration has been made so easy by the framework! Such implementations should be negatively judged by Android community and the Android Alliance!
If anyone has found a work-around for force updating the widgets of the vendor specific sms apps (HTC and Samsung), so the unread sms counters correctly update, and would like to share this knowledge, you are more than welcome!

Categories

Resources