0

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

MikeD
  • 5,004
  • 1
  • 25
  • 39
Avi L.
  • 111
  • 2
  • 8

1 Answers1

0

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

Community
  • 1
  • 1
Dayerman
  • 3,973
  • 6
  • 38
  • 54