astirtrotter / AB-Testing

SMS forwarding in background service (android)
Apache License 2.0
0 stars 0 forks source link

Making default app #1

Open astirtrotter opened 7 years ago

astirtrotter commented 7 years ago

When app runs, it asks user to make itself as default messaging app.

astirtrotter commented 7 years ago

Android SDK supports such dialog for only K+. Need to research more.

astirtrotter commented 7 years ago

@theresahautlacken Is there any need to make this app as default app? Forwarding works even if it's not default app.

astirtrotter commented 7 years ago

Now I blocked the codes to make as default app.

        //Process 2 of 2:  Ask to become default messaging ap
//        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
//            if (!Telephony.Sms.getDefaultSmsPackage(this).equals(getPackageName())) {
//
//                //!!!!!! The following three lines are correct?
//                Intent intent = new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT);
//                intent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME, getPackageName());
//                startActivity(intent);
//            }
//        }