It's not possible, and here's why:
User level apps are not supposed to be able to control system level
facilities. If your use case is within a company, you'll need a ROM
extension.
Refusing to believe this doesn't make it any less true. You can't do
it, the API isn't exposed. It's not exposed because your app
shouldn't be doing this. There is literally no endpoint that "stops"
an SMS from being sent. If you wanted to do this within a ROM, you'd
need to intercept calls to the SMS facilities (say, via `SmsManager`).
Kris
On Wed, Jan 30, 2013 at 2:01 PM, Lucas Diego <diegolucasb@gmail.com> wrote:
> Hi everybody,
>
> I have been developping a launcher for a company in order to prevent users
> (from this company of course) from doing some actions on the phone, like
> send sms text for example.
> So, I'd like to know how can I prevent user from sending sms text.
> After seaching it, all I have found is people saying that it is not
> possible. Well, I refuse to believe that. I think it's gotta be a way to do
> this;
>
> til now, all I'm getting is information about users' sms, using a extended
> class from ContentObserver, like this:
>
> public class SMSObserver extends ContentObserver {
>
> private Handler handle = null;
> private Context context;
>
> public SMSObserver(Handler handler, Context context) {
> super(handler);
> this.handle = handler;
> this.context = context;
> }
>
> @Override
> public void onChange(boolean selfChange) {
> super.onChange(selfChange);
>
> Uri uriSMS = Uri.parse("content://sms/sent");
> // Uri uriSMS = Uri.parse("content://sms/out");
> // Uri uriSMS = Uri.parse("content://sms/");
> Cursor cur =
> context.getApplicationContext().getContentResolver().query(uriSMS, null,
> null, null, null);
>
> if (cur.moveToNext()) {
> String[] nomes = cur.getColumnNames();
>
> for (String string : nomes) {
> Log.i("LAUNCHER", string);
> }
>
> Log.i("LAUNCHER", cur.getString(cur.getColumnIndex("address")));
> Log.i("LAUNCHER",
> cur.getString(cur.getColumnIndex("callback_number")));
> Log.i("LAUNCHER", cur.getString(cur.getColumnIndex("read")));
> Log.i("LAUNCHER", cur.getString(cur.getColumnIndex("type")));
> Log.i("LAUNCHER", cur.getString(cur.getColumnIndex("body")));
> }
> }
> }
>
>
>
> does anybody knows how to do it?
> any help would be really great.
>
> thanks.
>
> Lucas Diego
>
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment