I have done a little but of looking around on google and think i know the answer to this before asking, however most of what i found on the internet dates back almost a year so.
Is it possible to add an extra menu item to the SMS context menu so for example an app i am working on, if you press it it can open you app from that message.
otherwise is it possible to add a "flag" to an SMS so then when it is recieved on a device it would try to open it in a different application than the stock SMS one if it exsists.
*edit to elaborate:
I am currently writing an app which is basically a custom SMS app (its a uni project) What i am trying to find out is if it is possible to 1 of 2 things:
1, add a context menu item to a SMS in the standard app - the idea of this menu is to link it to open it in my app
if not then
2, add somesort of flag? to the text message so that when its recived on the phone a service or something checks to see if the flag exists, if it does then opens that SMS on my app (if its installed) else opens it in the standard default SMS application
For the second approach I will suggest you should use BroadcastReceiver.
BroadcastReceiver is used when there will any action which needs to happens on a particular
event let's say onIncomingVoiceCall or incomingSMS.
I think this will serve your purpose.
If you find my answer useful please mark it.
Best Regards,
~Anup
Related
I just want to show an alert box at just killing the application in android.
It's like a Notepad application, if we simply kill the app (on clicking the close button) then we get an alert box asking for save changes.
I just want to add same thing in my application.I have tried onBackPressed() and its working fine on clicking on Back Button. But I need same thing on closing the application.
There is now way to be sure if the app is being closed but you can place a check if the application is in foreground or not which is a better metric IMHO as this tells you when the user moved away from your application.
To check the ProcessLifeCycleOwner this will help you find state of process. You can check this Github sample or this stackoverflow question in how to use it.
I’m working on an app that can "disable" another apps for a limited time. In the first activity the user can choose which application he wants to disable, then my application needs to check if the chosen apps have been opened. If so, my app needs to detect it and show the “disabled app” activity of my app instead.
My problem is how my app can detect that the disabled app has been opened.
I looked for solutions and found this one and this one, but they were removed.
Thank you!
There is an API you can use to query events about apps (packages) but it requires an additional 'special access' permission . Have a look at UsageStatsManager
I started a project of a windows program that connects to an android phone and gives the user information
about it, so I want to display all of the popups that appere on the phone. to do this I need the app version of the program to catch them somehow and give me the name of the app that sent the popup and the popup's contant. is it possible?
it would be kind of security issue if any app could do that... you can try with AccessibilityService with some permissions for reading screen/running Activities and checking style of every Activity is this "popup", but note that some of them are just DialogFragments. So I doubt you can recognize "popups" this way in a reliable way. Look for AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED for more info
I am developing an Android app that allows sports team coaches to update the attendance for events like training/matches. A feature I would like to add would be to display a notification on the device to remind them that they need to update the attendance for the event when it has started.
I have been reading online a bit and it seems that push is the preferred method for data that is changing. But because i know the start times of the events, would it be better to create a background service using something like the following?
https://stackoverflow.com/a/9933130/2039505
I basically want the user to receive a vibrate notification which when they click on it, it will open the events attendance screen. Hopefully someone will have some insight into which option is best!
Since all you need is a notification on a timer, the AlarmManager would be the best way to go.
If you used Push Notifications(GCM), that would require server side code and a method to store the device id to send the notification to.
Overkill if you ask me.
Here are links to the official documentation and example code:
Official documentation
Vogella's example on services
when sms is recieved a pop up is appeared on inbox icon which show number of unread sms,, how can i show that popup which indicate number of unread sms in inbox....
Is there a way to add a badge to an application icon in Android?
Unfortunately, Android does not allow changing of the application icon because it's sealed in the APK once the program is compiled. There is no way to programmatically change it to a 'drawable'.
Read this link: Is there a way to add a badge to an application icon in Android?
There is no way to implement this for all devices out there. The problem is, this is no feature of Android by itself, but of the specific launcher, and while there are some launchers that offer this possibility (each slightly differently), there is no solution that would work with all devices.
Also, it is discouraged to use this UI pattern in Android apps, as it is an iOS design pattern.