In Android, I want to know if I can receive the event whenever I open Android Message Application?
I tried get task in foreground but that didn't work in service as for that service has to continuously poll
Kindly guide
The only way you can achieve this is by polling. No other way :(
I can receive the event whenever I open Android Message Application?
No.
First, there are thousands of Android device models, spanning hundreds of manufacturers. There are dozens upon dozens of "Android Message Application" pre-installed across the device models, as manufacturers often provide their own. There are also hundreds of "Android Message Applications" available on the Play Store and elsewhere. You have no great way to know what apps are and are not "Android Messaging Applications", though you could try to examine <intent-filter> structures and deduce which ones might meet your requirements.
Second, there are no events posted to ordinary Android SDK apps when other apps or their activities start. Even some of the polling techniques that you mention will not work on Android 5.0+, and any that still do work represent bugs that should get fixed. Google is locking down this information for privacy and security reasons, such as to help prevent OAuth hijacking attacks like this one.
Related
I am working on an Android enterprise application that targets limited mobile devices which help owner to track the user/device status (like GPS, Calls logs) remotely. I managed to implement these basics features to my application. Challenge that I'm facing now is the end users who traveling away with the device can force stop the application or can revoke some permissions(above Marshmallow) to prevent them self from being tracked remotely by the owner.
First of all is it possible to make such an application?
If yes, what are APIs given for such applications development?
Note - All the targeted devices are rooted anything I can get advantage of that.
Is there are any special APIs available for developments of those applications which work only on Rooted devices?
According to your requirement i will suggest you to look deep into the android Service.
As You might also have a look on the persistent service,
You can only make your service persistent if you are developing system apps. This service is basically unkillable.
Here is some write up for persistent service
Hopefully this might help you.
But for non-system applications, startForeground is your best option.
There is an android application I am planning to write, that will be used as an "always on" application (kiosk-mode) used on Android tablets running restaurant menu. Today, I already have a rudimentary application, but it is not quite what might qualify as kiosk-mode, since sometimes users close the application.
I wanted to see if there is a way to monitor the application remotely (or on device itself) and automatically restart it, s.t. it comes the foreground application ?
Of course, I'd prefer to remotely monitor for some remote customer service. It is not exactly essential to view (in remote desktop / vnc sense), but gather information like application health (running in foreground or not), get it's logs etc. Now I understand that on an unrooted device an applications log is not visible to other applications. So I was wondering if I could design my application to create light logs or status information, in a non-standard way, that could be shared by my other monitoring application.
While I get a feel that I am reinventing the wheel, since requirements like these seem far-from-unique, but in my search haven't found much beyond the standard 'screen cast' / 'screen share' applications... most of which either don't work too well (especially without root), or need one to jump through hoops to get them working.
There are ways to monitor activities of your application. There are utilities available to help you keep logs of events carried out by the users of the application. Like getting statistical information. They are typically Mobile Analytics tools.
Check this for instance: https://mixpanel.com/
This for example can help to keep track of events fired by the application. You can even send mails and notification to the users. There are similar tools available. For instance Google Analytics for Mobile Apps
The other possibility is to use Google Cloud Messaging. I believe this is even more powerful, which may help us to control our application to some extent. You may find this of help: http://hmkcode.com/android-google-cloud-messaging-tutorial/
I'm new to the Android platform. Apple requires every iOS app to ask for and confirm push notifications, but I have not noticed any apps that I've downloaded on my new Android phone prompting me if I want to receive push notifications. It just automatically registers me for them. Is this normal Android convention, to automatically register users for push notifications, assuming they can disable them later?
In my own Android application, should I be prompting users and asking if they want them before I register them? Obviously it would be the polite thing to do to ask permission before signing them up for push notifications, but if that's not common practice I see no reason to potentially lose some receivers of them.
Making decisions for the user is actually a strong Android guideline. Here is a list of the "Android Design Principles", written by Google. As you can see "Decide for me, but let me have the final say" fits the behavior that you've mentioned.
Some things to keep in mind when discussing Android notifications:
Users can disable your app's notifications in their OS settings. If they really don't want to hear from your app, they'll disable notification's there.
User context. You don't know what context the user is installing your app in. Users who are on a crowded train, relaxing on their day off, hanging out at a friend's place, or maybe waiting for a flight, all want different things out of your app at the time of installation. The guy on a crowded train is going to want your app to work immediately, with very minimal setup, while the guy relaxing at home may not mind a long setup process.
Your setup process can have a significant impact on your user retention. This Forbes article briefly discusses intrusive setup forums and their impact on app uninstalls.
At the end of the day however, it all depends on the needs of your audience. If you're targeting professionals, then they might be willing to put in some extra time up-front if they believe your app could help make their job easier. If you're targeting a casual gamer, you'll want them to get in and rolling as fast as possible. It's up to you to decide how best to serve your audience.
Here's a video from Google I/O 2013 that discusses the Android Design Principals in greater detail.
Hope I was able to provide some insight.
Sadly, it does not appear to be a very common practice. I've installed several Android applications that will randomly give me a notification in the middle of the night. I've recently made a new habit of disabling notifications for every new app that I install unless I really want notifications from it. I think your application would result in a much better user experience if you prompted them for notifications. You could also offer configurations for which notifications they wish to receive. If other apps were like this I might choose to receive some notifications instead of globally turning them off.
I have created an app. Works great, but I want some same functionality as gmail uses:
When I receive a new email, I get a notification. I inspected my phone and saw no services or applications running that look like the gmail-app.
I have investigated the AlarmManager and services, but as soon as I stop the app both don't work anymore.
Could someone give me a hint how to accomplish this?
Thanks in advance
I inspected my phone and saw no services or applications running that look like the gmail-app.
Partly, that is because Gmail gets such notifications via broadcast Intents from the OS, via the subsystem we see as C2DM (which is why you do not see a process). Partly, that is because Gmail is part of the firmware and may get some extra benefits as a result, in terms of resisting the normal behaviors that befall an app that is force-stopped.
Could someone give me a hint how to accomplish this?
You can't. Particularly on Android 3.1+, if your app is force-stopped, it will not run again until the user manually runs one of your activities (e.g., from the launcher).
As far as I know, there is no way to control over the activities occurring in an app in android phones unless the application that you want to log/monitor is written by you.
I wonder is it really like that or is there any possible way to do this? For example, is it possible to control over emails which, let's say, who I sent an email to in an android phone?
It is not possible to "just log it". Some events are possible to catch in broadcast receivers in a logging application. The user will get notified by particular event sniffing when installing such an application, by approving the permissions request.
It's generally possible to add instrumentation for security purposes to apps where they interface to the sdk api's, either by modifying the platform (rooted phone) or by decompiling, modifying, and recompiling the app using apktool.
possible of course does not mean trivially easy.