Call APNDroid from my app
I am trying to write an app that calls APNDroid for enabling/disabling the 3G. I looked at the code snippets provided by the developer. I can't seem to understand how to incorporate them in my code. Here is the code snippet I am referring to:
boolean targetState = getCheckBoxState(R.id.target_state);
boolean keepMms = getCheckBoxState(R.id.keep_mms);
boolean showNotification = getCheckBoxState(R.id.show_notification);
Intent intent = new Intent(ApplicationConstants.CHANGE_STATUS_REQUEST);
int onState = ApplicationConstants.State.ON;
int offState = ApplicationConstants.State.OFF;
intent.putExtra(ApplicationConstants.开发者_高级运维TARGET_MMS_STATE, keepMms ? onState : offState);
intent.putExtra(ApplicationConstants.TARGET_APN_STATE, targetState ? onState : offState);
intent.putExtra(ApplicationConstants.SHOW_NOTIFICATION, showNotification);
MyActivity.this.startActivityForResult(intent, CHANGE_REQUEST);
Specifically, I do not understand how this code knows to call an APNDroid activity. The constants are found here
Obviously none of this is recognized by "eclipse" when I embed it in my code. Should I import something? Should I somehow give a reference to the APNDroid app?
Any help will be much appreciated.
Thank you. Avi
You first have to checkout the project. Following these steps
You also have in that piece of code the name of the Intent to call. Have a look here to see how to call the intent of another applications in Android Call or start external Application Android
精彩评论