Java Code Examples for com.akdeniz.googleplaycrawler.GooglePlayAPI#checkin()

The following examples show how to use com.akdeniz.googleplaycrawler.GooglePlayAPI#checkin() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UploadLogic.java    From raccoon4 with Apache License 2.0 6 votes vote down vote up
@Override
protected void onDoInBackground() {
	PlayProfile pp = globals.get(PlayProfile.class);

	if (pp.getAgent() == null) {
		// TODO: rewrite the GooglePlayAPI. The whole device config stuff is
		// hardcoded and poorly exposed.
		pp.setAgent(new GooglePlayAPI("", "").getUseragent());
	}

	GooglePlayAPI api = PlayManager.createConnection(pp);
	api.setClient(LoginLogic.createLoginClient());
	try {
		if (pp.getGsfId() == null) {
			api.checkin(); // Generates the GSF ID
			api.login();
			api.uploadDeviceConfig();
			pp.setGsfId(api.getAndroidID());
		}
	}
	catch (Exception e) {
		err = e;
		e.printStackTrace();
	}
}
 
Example 2
Source File: InitWorker.java    From Raccoon with Apache License 2.0 6 votes vote down vote up
@Override
protected String doInBackground() throws Exception {
	publish("");
	// Register the account with GPlay.
	GooglePlayAPI service = App.createConnection(archive);
	service.setLocalization(Locale.getDefault().getCountry());
	if ("".equals(archive.getAndroidId())) {
		service.checkin();
		service.login();
		service.uploadDeviceConfig();
	}
	else {
		service.login();
	}
	// Persist credentials through a separate object...
	Archive a = new Archive(archive.getRoot());
	a.setUserId(archive.getUserId());
	a.setPassword(archive.getPassword());
	a.setAndroidId(service.getAndroidID());
	a.saveCredentials();
	// ... and transport back the new aid, so we only modify the submitted
	// archive on the UI thread.
	return service.getAndroidID();
}
 
Example 3
Source File: NewProfile.java    From raccoon4 with Apache License 2.0 5 votes vote down vote up
@Test
public void test() throws Exception {
	String uid = System.getProperty("raccoon.dev.gmail");
	assertNotNull("No credentials!", uid);
	String pwd = System.getProperty("raccoon.dev.gmail.pw");
	assertNotNull("No credentials!", pwd);
	GooglePlayAPI api = new GooglePlayAPI(uid, pwd);
	api.login();
	api.checkin();
	api.uploadDeviceConfig();
	System.out.println(api.details("de.onyxbits.listmyapps"));
}