so i am building an application that is supposed to send an automated email and i'm a little lost. i've been doing some research and i just don't really understand exactly what i am doing so i'm having trouble figuring out the details. on one page i found a method that seemed like it would be what i need but the example given used '*' instead of actual value for a variable called code. here is an example of the code i am writing containing the variable:
public static Gmail init() throws IOException{
HttpTransport httpTransport = new NetHttpTransport();
JsonFactory jsonFactory = new JacksonFactory();
sClientSecrets = GoogleClientSecrets.load(jsonFactory, mClientSecretReader);
Log.d(TAG, "Client Secrets: " + sClientSecrets);
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
httpTransport,
jsonFactory,
sClientSecrets,
Arrays.asList(mScope)
).setAccessType("online").setApprovalPrompt("auto").build();
String code = "***"; // <-----how do i get code?
GoogleTokenResponse response = flow.newTokenRequest(code)
.setRedirectUri(GoogleOAuthConstants.OOB_REDIRECT_URI).execute();
GoogleCredential credential = new GoogleCredential()
.setFromTokenResponse(response);
return new Gmail.Builder(httpTransport, jsonFactory, credential)
.setApplicationName(APP_NAME).build();
}//end init()
i do not understand what i am supposed to use for this variable. i feel that i should know but... i don't. please point this out to me. thanks in advance.