/** print out some info about the system and JVM etc. */ public static void show() { Properties prop = System.getProperties(); JDDConsole.out.println( "Using JDD build " + jdd.Version.build + " on " + (new Date()).toString() + "\n"); JDDConsole.out.print( "Using " + prop.getProperty("java.vendor") + " JRE " + prop.getProperty("java.version")); String jit = prop.getProperty("java.compiler"); if (jit != null) JDDConsole.out.print(", " + jit + " JIT in"); JDDConsole.out.println(" " + prop.getProperty("java.vm.name")); JDDConsole.out.println( "OS " + prop.getProperty("os.name") + " on " + rt.availableProcessors() + " " + prop.getProperty("os.arch") + " CPU(s)"); JDDConsole.out.print("Total JRE memory: "); Digits.printNumber1024(rt.maxMemory()); JDDConsole.out.print(", memory currently reserved by the JRE: "); Digits.printNumber1024(usedMemory()); JDDConsole.out.println("\n"); }
DigitsApiClient getApiClient(Session session) { if (digitsApiClient != null && digitsApiClient.getSession().equals(session)) { return digitsApiClient; } digitsApiClient = new DigitsApiClient( session, twitterCore.getAuthConfig(), twitterCore.getSSLSocketFactory(), digits.getExecutorService(), new DigitsUserAgent(digits.getVersion(), Build.VERSION.RELEASE)); return digitsApiClient; }
private void startPhoneNumberActivity(Context context, Bundle bundle) { final Intent intent = new Intent(context, digits.getActivityClassManager().getPhoneNumberActivity()); intent.putExtras(bundle); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); context.startActivity(intent); }
private void startSignUpWithBundle(AuthCallback callback, Bundle bundle) { final DigitsSession session = sessionManager.getActiveSession(); digits.getScribeService().dailyPing(); if (session != null && !session.isLoggedOutUser()) { callback.success(session, null); } else { startPhoneNumberActivity(twitterCore.getContext(), bundle); } }
@Override DigitsActivityDelegate getActivityDelegate() { return new ConfirmationCodeActivityDelegate( new ConfirmationCodeScribeService(Digits.getInstance().getScribeClient())); }
@Override DigitsActivityDelegate getActivityDelegate() { return new PhoneNumberActivityDelegate(Digits.getInstance().getDigitsEventCollector()); }
DigitsClient() { this(Digits.getInstance(), TwitterCore.getInstance(), Digits.getSessionManager(), null); }