I want to be able to have the user press a button in the app that disables sending texts. In my googling attempts, I've seen that it might be impossible. Does anyone know how to accomplish this? My thoughts are either to disable opening the texting app or just disable the send button in the texting app.
This is not truly disabling it, as other comments have pointed out. However... you could set up a service or some sort of polling period with an alarm. You can check if a SMS app (you'll have to gather SMS packages) is open in the foreground by its package name, and then launch some activity from your application, essentially blocking the SMS app.
Granted, this is horrible UX and is very hacky, but it could work for preventing the sending of SMS by preventing the user from actually using any SMS apps.
It's not possible, because "texting app" is a system application, which have no open API's for it's UI customization. All you can do - just create custom texting application and replace with a system one.
Even if one somehow found a way to disable the texting app, it does not account for the ContentProvider's that expose the SMS and MMS data to any app that asks for it nor the API's that allow any app that asks to do so to send SMS and MMS for you. This is why you can download alternative texting apps (and why hangouts recently turned into a combination sms/chatting app).
Sorry, but you're asking to do something that requires ripping out the guts of the OS, from what I understand.
Related
I've seen some "app locking" solutions in the Google Play store and I was wondering how those apps work. I'd like to build something similar.
I realize that this might require some special permission or maybe request the app to be added as device administrator.
Is there some broadcast that is triggered just before an app is launched that I can intercept and do some action (e.g. launch an activity that will request the user to fill a password)? I've read some lengthy discussions how this is not a good idea and the only idea is to have a background service that will continuously poll the running processes and check for changes, but I think retrieving this list every second and checking it for chances is not good for the battery and I think other app locking apps out there must be using a different approch.
If possible, without the need for a rooted phone.
I want to write an android app that changes the android standard message sms GUI giving it an extra send button. The one send button should be the usual one and the other should be the one that uses my application to send the message. How do I add this extra button in the android standard sms message GUI? Anyone got an example code on how to do this?
Kind regards
Benjamin
Ok, this you Cannot do for phones which are in the market. You will need to grab hold of the sources and come up with a custom ROM for users to flash.
However, as another option, you can build your own SMS application and let users install so. When users need to send a SMS, they will be asked whether we default/your app needs to be used. This way is a much cleaner approach and more reachable to users.
In my application, after receiving a specific message i do some task. It works well but when some other sms applications like HookUp(in micromax) and go sms pro is installed in device, these application also gets the message. I have set highest priority to my application. I want to stop bypassing the sms to these application. Please help
Thanks in advance
I want to stop them But dont know how?
Ask the user to uninstall those apps.
My guess is that the tiebreaker for BroadcastReceivers registered at the same priority is installation order. That seems to be the behavior, based on described behavior in these StackOverflow questions. Hence, if these other apps were installed before yours, they will get the broadcasts first, and there is nothing that you can do about it.
If the user values your application enough, they will uninstall those other apps (which definitely gives you priority), perhaps reinstalling them later (which may give you priority).
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).
I'm trying to figure out how to request another Android device for permission to access its location. Maybe through some link on a SMS to launch Google latitude?
The point is it should be instantaneous, like a Notification or an SMS.
What would be the closest strategy you can think of?
UPDATE:
Thanks guys for all your answers. After considering them all I am still a bit confused about what strategy to adopt.
Probably is better to tell you what I'm trying to implement:
Someone is going to pick you up. You send him a request, he accepts and the app shows you how far away he is and how long it will take him to get to you.
I didn't want the receiver to be forced to have the app cause it would lower its use. I guess that requisite could be dismissed.
Sorry for the confussion.
If you don't want the receiving user to have to install an app, you could send an SMS with a link to a website you control that uses web geolocation APIs to report position: http://dev.w3.org/geo/api/spec-source.html
The user will need to click the link in the SMS, then they will be prompted to allow the page to access their location. This will work not only on Android devices, but on any device with a browser that supports these APIs
It depends on how heavy duty your apps are.
If I were you I would write a system where the Apps would maintain a connection to a central server. That way your Apps can be notified the moment that anything happens. It could also be seamlessly integrated allowing your App (make sure you ask permission to allow it initially obviously) to send location data when requested without any interaction.
This is obviously more battery intensive for such a simple operation, but that is the best way to get instantaneous notifications.
Another way you could do it is to simply send an email to the recipient with a custom URL scheme.
Such as:
yourlocationapp://get.location/respond.to
You could parse that kind of URL in your App by setting:
<data android:scheme="yourlocationapp" />
In your intent-filter.
This requires more in the way of user interaction though.